UserJS.org

Prevent malicious redirects targeting Opera users

  • Published: 2005-10-25 22:27
  • Modified: 2005-10-25 23:27
  • Author: Øystein R. Ryen
  • Requires: Opera 8.0
  • Install as: Opera User JS

Learn how to install scripts

Report a bug

This script attempts to remove malicious redirects specifically targeting Opera users.

It does so by checking if the script attempts to detect Opera either by checking for Opera in the ua-string or checking for window.opera, if it finds it; check if there is a redirect somewhere in the code. If there is, remove anyone leading to about:blank or contains the words: unsupported,oldbrowser,badbrowser or invalidbrowser; this way even if the site looks for Opera in a different context the chances of the script breaking a page is slim since there is little chance these words are used in valid urls.

Version history

  • v2.0: Now prints a message to the javascript console when a redirect has been prevented, will prevent redirection even if the Opera detection was done in a linked script, improvements to (hopefully) catch more blocking attempts.