Last active
September 2, 2019 23:29
-
-
Save GarnetSunset/a232644ac355299ce1f6780d9a5b8a90 to your computer and use it in GitHub Desktop.
This file contains 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 Bypass Blue Media Redirector Links | |
// @namespace https://greasyfork.org/en/users/85671-jcunews | |
// @description Bypass Blue Media redirector links | |
// @author jcunews | |
// @version 1.0.2 | |
// @license GNU AGPLv3 | |
// @match *://*/* | |
// @include https://igg-games.com/* | |
// @grant none | |
// @run-at document-start | |
// @updateURL https://gist.githubusercontent.com/GarnetSunset/a232644ac355299ce1f6780d9a5b8a90/raw/ | |
// ==/UserScript== | |
(function(a, rx) { | |
function processPage() { | |
Array.prototype.slice.call(document.links).forEach(function(e, b) { | |
if (a = e.href.match(rx)) { | |
a = (a[1] !== "h" ? "http" : "") + decodeURIComponent(a[1]); | |
if (e.textContent === e.href) { | |
e.textContent = a; | |
} else if ((b = e.href.match(/^https?:\/\/(.*)/)) && (e.textContent === (b = decodeURIComponent(b[1])))) { | |
e.textContent = b; | |
} | |
e.href = a; | |
} | |
}); | |
} | |
rx = /^https?:\/\/bluemediafiles\.com\/creatinglinks[^?]+\?xurl=(s?:\/\/[^&]+)/; | |
if (a = location.href.match(rx)) { | |
location.href = (a[1] !== "h" ? "http" : "") + decodeURIComponent(a[1]); | |
} else { | |
addEventListener("spfprocess", processPage); | |
addEventListener("spfdone", processPage); | |
addEventListener("load", processPage); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment