Athorcis / Eclyspia Disarm Adblock Detector

// ==UserScript==
// @name        Eclyspia Disarm Adblock Detector
// @description A script that bypass attempts to detect Adblock on eclyspia.com
// @namespace   athorcis
// @include     http://www.eclypsia.com/*
// @version     1.0
// @grant       unsafeWindow
// @require https://greasyfork.org/scripts/7465-disarm-adblock-detectors/code/Disarm%20Adblock%20Detectors.js?version=31790
// @run-at      document-start
// ==/UserScript==
/*jslint devel: true */
/*global unsafeWindow, DAD */

DAD(function (window, utils) {
    "use strict";
    
    var userID, userToken;
    
    function advertListener(data, callback) {
        callback({ status: "OK", userId: userID, userToken: userToken });
    }
    
    function proxyIOSocketOn(caller, args) {
        var type = args[0];
        
        if (type === "advert") {
            args[1] = advertListener;
        }
        
        caller(args);
    }
    
    function proxyIOConnect(caller, args) {
        var socket = caller(args);
        
        utils.createProxy(socket, "on", proxyIOSocketOn);
        
        return socket;
    }
    
    return {
        css: "#adv_tester { display: block !important; height: 1px }",

        exports: {
            OA_show: utils.noop,
            
            sas: {
                setup: utils.noop,
                
                call: utils.noop
            }
        },

        init: function () {
            var script,
                jQuery = window.jQuery,
                iframeWrapper = jQuery(".webTvIframeWrapper");

            userID = window.userID;
            
            if (iframeWrapper.length) {
                try {
                    script =  iframeWrapper.next().next("script")[0].innerHTML;
                    userToken = utils.extractString(script, { before: "userToken" });

                    utils.createProxy(unsafeWindow.io, "connect", proxyIOConnect);
                } catch (exception) {
                    console.error(exception);
                }
            } else {
                console.warn("unable to find .webTvIframeWrapper");
            }
        }
    };
});