Redirect links using Tampermonkey

// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https:///
// @grant none
// ==/UserScript==

(function() {
‘use strict’;
alert(‘initial :’ + window.location.href);
if(!window.location.href.indexOf(‘test.eu’)){
console.log(‘before replacing’);
window.location.replace(window.location.href.replace(“eu”, “is”));
console.log(‘after replacing’);
}
// Your code here…
})();

Advertisements