Skip to content

Instantly share code, notes, and snippets.

@GarnetSunset
Last active September 2, 2019 23:29
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 GarnetSunset/a232644ac355299ce1f6780d9a5b8a90 to your computer and use it in GitHub Desktop.
Save GarnetSunset/a232644ac355299ce1f6780d9a5b8a90 to your computer and use it in GitHub Desktop.
// ==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