Skip to content

Instantly share code, notes, and snippets.

@noromanba
Last active December 25, 2016 23:15
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 noromanba/af8bd6eb81ffadbe6dfaa6dbbd8efdc4 to your computer and use it in GitHub Desktop.
Save noromanba/af8bd6eb81ffadbe6dfaa6dbbd8efdc4 to your computer and use it in GitHub Desktop.
remove lompat.in redirector for UserScript
// ==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