avoid undefined Window error in some userscripts