Skip to content

Instantly share code, notes, and snippets.

@wodim
Created February 29, 2020 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wodim/e8dfedd35df1483770fa3dcd9fbe4381 to your computer and use it in GitHub Desktop.
Save wodim/e8dfedd35df1483770fa3dcd9fbe4381 to your computer and use it in GitHub Desktop.
TwinStar
// ==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