Can security cameras work through windows?

Sometimes we can feel like setting up security cameras on the window ledges to secure our home and its surroundings, but would it be efficient?
A lot of people wonder whether mounting the security camera to see through the window or glass will work out. Well, it depends on man