Created
February 5, 2016 05:59
-
-
Save archywillhe/6a414d2f7c1baf3ef723 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 Fuck FuckAdBlock Functionally | |
// @author 0a- | |
// @namespace 0a- | |
// @description A functional alternative of FuckFuckAdblock by Mechazawa | |
// @license WTFPl | |
// @version 0 | |
// @include * | |
// @run-at document-start | |
// @updateURL https://github.com/0a-/FuckFuckAdblockFunctionally/raw/master/FuckFuckAdBlockFunctionally.user.js | |
// @grant none | |
// ==/UserScript== | |
(function(window) { | |
var _ = function(){}; | |
var fuck = function(fn,fns){ | |
fns.push(fn); //side effect here since this is OO. Otherwise could have written: fns = fns.concat(fn) | |
var partiallyFuck = function(fn){ return fuck(fn,fns)}; | |
var thunk = function(){ | |
fns.map(function(a){a(); | |
window.fuckAdBlock = fuck(_,[]); //forced to do side effect here due to OO | |
window.blockAdBlock = fuck(_,[]); //forced to do side effect here due to OO | |
}); return true}; | |
return { | |
on: _, | |
setOption: _, | |
clearEvent:_, | |
onDetected: partiallyFuck, | |
onNotDetected: partiallyFuck, | |
emitEvent: thunk, | |
check: thunk | |
} | |
} | |
window.fuckAdBlock = fuck(_,[]); | |
window.blockAdBlock = fuck(_,[]); | |
})(window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment