Problem: I want to replace the use of one website with another, by changing the URL.
Solution: Using Greasemonkey, rewrite the location of the browser.
For this example, Wikipedia is replaced with Infogalactic.
// Tested 2016-10-28 on Windows 10 64bit, using Pale Moon 26.5.0 (x64) and Greasemonkey 1.15.1 signed. // ==UserScript== // @name Wikipedia to Infogalactic redirector // @namespace wikipedia_to_infogalactic_redirector // @description Redirect Wikipedia links to Infogalactic // @include http://en.wikipedia.org/* // @include https://en.wikipedia.org/* // @version 1.0 // @grant none // ==/UserScript== //window.alert( window.location.href.replace( "en.wikipedia.org/wiki", "infogalactic.com/info" ) ); window.location = window.location.href.replace( "en.wikipedia.org/wiki", "infogalactic.com/info" );
This rewrites the URL after it is visited, meaning the first website must be loaded before the second one is redirected-to. While it's amusing to burn the bandwidth of the disliked website, it takes time to load the new page.