Try to use the same code for Web (changing window1 with webpage1) and see the errors that it shows.
I agree.