A window or glass looks a lot like WeatherHost's lexan dome. I tried mine through a window at a steep angle for a while, but that was not a solution. Mine is currently mounted under the eaves on the porch with no enclosure, about 30cm back from the gutter/dripline. It has never gotten wet and we had some driving rains the last few days. Astak Mole, which is probably the same weather-tolerance as the Foscam.
Apparently, moths like IR light as much as visible light, because in the summer they are constantly tripping the motion detection by flying into the camera. But I also catch the occasional spider winning a midnight snack.