❌SKIN CANCER RISK:
Avoid tanning through a window as it will increase your skin cancer risk. Since the UVA has a longer wavelength, it can penetrate materials more easily, and when the sun is filtered through a window, this effectively filters out the majority of UVB radiation, but only minimally filters out UVAs. What's the significance of that, you ask? This can lead to significant health problems, because in addition to destroying vitamin D3, UVA's also increase oxidative stress. UVA is one of the primary culprits behind skin cancer, and it increases photo aging of your skin (D’Orazio et al., 2013).
Stop exposing yourself to the sun through windows. It will NOT help you synthesise Vitamin D and can actually cause more harm than good. Best to expose your body to sun OUTSIDE.