Make sure javascript actually works when loading a page in its seperate tab. fixes #1898