Created
February 29, 2020 12:48
-
-
Save wodim/e8dfedd35df1483770fa3dcd9fbe4381 to your computer and use it in GitHub Desktop.
TwinStar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Twinstar | |
// @match http://*.twinstar.cz/* | |
// @match https://*.twinstar.cz/* | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var re = /https?:\/\/(www\.)?wowhead.com\//; | |
document.body.addEventListener('mousedown', function(el) { | |
var targ = el.target || el.srcElement; | |
while (targ && targ.tagName !== 'A') { | |
targ = targ.parentNode; | |
} | |
if (targ && targ.href && targ.href.match(re)) { | |
targ.href = targ.href.replace(re, 'https://classic.wowhead.com/'); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment