Check window.close

  • Published: 2005-06-16 22:46
  • Modified: 2005-09-19 09:19
  • Author: TarquinWJ
  • Requires: Opera 8.0
  • Install as: Opera User JS

Learn how to install scripts

Report a bug

With most browsers, if a page tries to close the window using window.close(), the browser checks if they should be allowed to close the window (if they opened it), and prompts for permission if not. In Opera, there is no such restriction.

This script makes Opera mimic the behaviour of other browsers, to prevent malicious sites from closing windows that they did not open, or do not have permission to close.