Clean URI

  • Published: 2005-05-30 21:42
  • Modified: 2005-09-29 11:22
  • Author: TarquinWJ
  • Requires: Opera 8.0
  • Install as: Opera User JS

Learn how to install scripts

Report a bug

Attempts to recognise links that use redirected URLs ( and replace them with the direct URL. Also optionally attempts to work with links that use in either the href or onclick event handler - even if ‘disable script’ is used to disable regular page scripts.

Optionally (configurable in the source), it can create a ‘CleanURL’ link instead of replacing the original link.

The replaced link’s tooltip will show what has been changed. The link will be given an additional rel value ‘redirected’, and the custom ‘replacedurl’ attribute which contains the original URL (for use with content:attr(replacedurl);).

For replaced links, these can be selected for styling using
a[rel~="redirected"] and CleanURL links can be selected using
a[rel~="redirected"] + a Test the script on the test page.

Warning: some websites (such as Yahoo login) rely on the redirect behaviour, and may stop working if you use this script. You should only use this script if you are sure you can deal with those problems when they arise. If needed, you can prevent this script running on those sites by adding lines like this inside the UserScript comment block at the top of the script file:
// @exclude*