Last active
December 25, 2016 23:15
-
-
Save noromanba/af8bd6eb81ffadbe6dfaa6dbbd8efdc4 to your computer and use it in GitHub Desktop.
remove lompat.in redirector for UserScript
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 lompat.drop | |
// @namespace http://noromanba.flavors.me | |
// @description remove lompat.in redirector for UserScript | |
// @include http://example.com/DIY | |
// @grant none | |
// @noframes | |
// @run-at document-end | |
// @version 2016.12.25.0 | |
// @homepage https://gist.github.com/noromanba/af8bd6eb81ffadbe6dfaa6dbbd8efdc4 | |
// @downloadURL https://gist.github.com/noromanba/af8bd6eb81ffadbe6dfaa6dbbd8efdc4/raw/lompat-drop.user.js | |
// @license MIT License http://nrm.mit-license.org/2016 | |
// @author noromanba http://noromanba.flavors.me | |
// @icon https://upload.wikimedia.org/wikipedia/commons/thumb/3/32/TW_PHW64.svg/128px-TW_PHW64.svg.png | |
// ==/UserScript== | |
// Icon (PD by By pfry19855) | |
// https://commons.wikimedia.org/wiki/File%3ATW_PHW64.svg | |
// Devel | |
// https://gist.github.com/noromanba/af8bd6eb81ffadbe6dfaa6dbbd8efdc4 | |
(() => { | |
'use strict'; | |
const detox = (ctx) => { | |
if (!ctx.querySelectorAll) return; | |
Array.from(document.body.querySelectorAll([ | |
'a[href^="http://www.loncatin.pw/?go="]', | |
'a[href^="http://securelink.lompat.in/?go="]', | |
]), link => { | |
// redirector syntax | |
// http://www.loncatin.pw/?go=<44_DIGIT_BASE64> | |
// http://securelink.lompat.in/?go=<44_DIGIT_BASE64> | |
link.href = atob(link.search.slice(1).replace(/go=/, '')); | |
}); | |
}; | |
detox(document.body); | |
new MutationObserver(records => { | |
records.forEach(record => { | |
detox(record.target); | |
}); | |
}).observe(document.body, { childList: true, subtree: true }); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment