[Resolved] rocktv.co

Adam

Filters Developer
Staff member
Moderator
Here - http://www.sports-stream.net/live/sps.php?ch=d1x
If I click on fullscreen button for first time it tries to open popup, it is closed by Adguard, but it would be nice to block this, so I would not have to click twice to open stream on fullscreen.
I think they use these scripts to load these popups:
Code:
var _wm = {
    initialize: function() {
        this.ua.initialize()
    },
    ua: {
        initialize: function() {
            this.browser = this.searchString(this.list_browser) || 'unknown';
            this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || 'unknown';
            this.os = this.searchString(this.list_os) || 'unknown'
        },
        list_browser: [{
            str: navigator.userAgent,
            subStr: 'Chrome',
            id: 'Chrome',
        }, {
            str: navigator.userAgent,
            subStr: 'OmniWeb',
            versionSearch: 'OmniWeb/',
            id: 'OmniWeb',
        }, {
            str: navigator.vendor,
            subStr: 'Apple',
            id: 'Safari',
            versionSearch: 'Version',
        }, {
            prop: window.opera,
            id: 'Opera',
            versionSearch: 'Version'
        }, {
            str: navigator.vendor,
            subStr: 'iCab',
            id: 'iCab',
        }, {
            str: navigator.vendor,
            subStr: 'KDE',
            id: 'Konqueror',
        }, {
            str: navigator.userAgent,
            subStr: 'Firefox',
            id: 'Firefox',
        }, {
            str: navigator.vendor,
            subStr: 'Camino',
            id: 'Camino',
        }, {
            str: navigator.userAgent,
            subStr: 'Netscape',
            id: 'Netscape',
        }, {
            str: navigator.userAgent,
            subStr: 'MSIE',
            id: 'Explorer',
            versionSearch: 'MSIE',
        }, {
            str: navigator.userAgent,
            subStr: 'Gecko',
            id: 'Mozilla',
            versionSearch: 'rv',
        }, {
            str: navigator.userAgent,
            subStr: 'Mozilla',
            id: 'Netscape',
            versionSearch: 'Mozilla',
        }],
        list_os: [{
            str: navigator.platform,
            subStr: 'Win',
            id: 'Windows',
        }, {
            str: navigator.platform,
            subStr: 'Mac',
            id: 'Mac',
        }, {
            str: navigator.userAgent,
            subStr: 'iPhone',
            id: 'iPhone/iPod',
        }, {
            str: navigator.platform,
            subStr: 'Linux',
            id: 'Linux',
        }],
        searchString: function(e) {
            for (var t = 0; t < e.length; t++) {
                var n = e[t].str;
                var r = e[t].prop;
                this.versionSearchString = e[t].versionSearch || e[t].id;
                if (n) {
                    if (n.indexOf(e[t].subStr) != -1) return e[t].id
                } else if (r) return e[t].id
            }
        },
        searchVersion: function(e) {
            var t = e.indexOf(this.versionSearchString);
            if (t == -1) return;
            return parseFloat(e.substr(t + this.versionSearchString.length + 1))
        },
    },
    cookie: {
        get: function(a, b) {
            var c = new Date();
            c.setTime(c.getTime());
            var d = new Date(c.getTime() + (1000 * 60 * 60 * b)).toGMTString();
            var e = document.cookie.split(';');
            var f = '';
            var g = '';
            var h = [0, d];
            for (var i = 0; i < e.length; i++) {
                f = e[i].split('=');
                g = f[0].replace(/^\s+|\s+$/g, '');
                if (g == a) {
                    b_cookie_found = true;
                    if (f.length > 1) {
                        h = unescape(f[1]).split('|');
                        if (h.length == 1) h[1] = d
                    }
                    return h
                }
                f = null;
                g = ''
            }
            return h
        },
        set: function(a, b, c) {
            document.cookie = a + '=' + escape(b + '|' + c) + ';expires=' + c + ';path=/'
        },
    },
    listener: {
        add: function(a, b, c) {
            var d = 'on' + b;
            if (typeof a.addEventListener != 'undefined') a.addEventListener(b, c, arguments.callee);
            else if (typeof a.attachEvent != 'undefined') a.attachEvent(d, c);
            else {
                if (typeof a[d] != 'function') a[d] = c;
                else {
                    var e = a[d];
                    a['old_' + d] = e;
                    a[d] = function() {
                        e();
                        return c()
                    }
                }
            }
        },
        remove: function(a, b, c) {
            var d = 'on' + b;
            if (typeof a.removeEventListener != 'undefined') a.removeEventListener(b, c, false);
            else if (typeof a.detachEvent != 'undefined') a.detachEvent(d, c);
            else {
                if (typeof a['old_' + d] != 'function') a[d] = null;
                else a[d] = a['old_' + d]
            }
        },
    },
    format: {},
    random: function() {
        return Math.floor(Math.random() * 1000001)
    }
};
_wm.initialize();
_wm.format.popunder = {
    settings: {
        url: "http://eclkmpbn.com/adServe/banners?tid=FJSMB&action=r",
        times: 1,
        hours: 2.000000,
        cookie: "flash",
    },
    isBinded: false,
    isTriggered: false,
    initialize: function() {
        var a = _wm.cookie.get(_wm.format.popunder.settings.cookie, _wm.format.popunder.settings.hours);
        this.cookie = {};
        this.cookie.times = !isNaN(Number(a[0])) ? Number(a[0]) : 0;
        this.cookie.expires = !isNaN(Date.parse(a[1])) ? a[1] : new Date().toGMTString();
        if (document.readyState == 'complete') setTimeout(_wm.format.popunder.bind, 1);
        else {
            _wm.listener.add(document, 'DOMContentLoaded', function() {
                _wm.listener.remove(document, 'DOMContentLoaded');
                _wm.format.popunder.bind()
            });
            _wm.listener.add(document, 'onreadystatechange', function() {
                if (document.readyState == 'complete') {
                    _wm.listener.remove(document, 'onreadystatechange');
                    _wm.format.popunder.bind()
                }
            });
            _wm.listener.add(window, 'load', _wm.format.popunder.bind)
        }
    },
    bind: function() {
        if (_wm.format.popunder.isBinded) return;
        _wm.format.popunder.isBinded = true;
        if (_wm.format.popunder.cookie.times >= _wm.format.popunder.settings.times) return;
        var a = {};
        for (var b in _wm.format.popunder.binders) {
            var c = _wm.format.popunder.binders[b];
            var d = b.split('');
            var e = '',
                l = '';
            var f = 1,
                type;
            for (var i = 0; i < d.length; i++) {
                var g = d[i];
                if (g.match(/[a-z0-9]/) == null) continue;
                type = g.search(/[a-z]/) == 0;
                if (type) {
                    if (type != f) {
                        a[e][l] = c;
                        e = g
                    } else e += g
                } else {
                    if (type != f || parseInt(i) + 1 == d.length) {
                        if (type != f) {
                            if (typeof a[e] != 'object') a[e] = {};
                            l = g
                        }
                        if (parseInt(i) + 1 == d.length) a[e][type == f ? l + g : l] = c
                    } else l += g
                }
                f = type
            }
        }
        var h = a[_wm.ua.browser.toLowerCase()] || a.all;
        var j = Object.keys(h);
        j.sort();
        for (var k = 0; k < j.length; k++) {
            var l = j[k];
            if (_wm.ua.version <= l) break
        }
        h[l]()
    },
    binders: {
        chrome28: function() {
            _wm.listener.add(document, 'click', _wm.format.popunder.triggers.triple_trigger)
        },
        firefox12_chrome21: function() {
            _wm.listener.add(document, 'click', _wm.format.popunder.triggers.double_trigger)
        },
        explorer0: function() {
            _wm.listener.add(document, 'click', _wm.format.popunder.triggers.single_delay)
        },
        all0: function() {
            _wm.listener.add(document, 'click', _wm.format.popunder.triggers.single)
        },
    },
    triggers: {
        triple_trigger: function() {
            _wm.listener.remove(document, 'click', _wm.format.popunder.triggers.triple_trigger);
            if (!_wm.format.popunder.registerTrigger()) return;
            window.open('javascript:window.focus()', '_self');
            var w = window.open('about:blank', 'pu_' + _wm.random(), _wm.format.popunder.config);
            var a = document.createElement('a');
            a.style.display = 'none';
            document.body.appendChild(a);
            var e = document.createEvent('MouseEvents');
            e.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, true, false, false, true, 0, null);
            a.dispatchEvent(e);
            document.body.removeChild(a);
            w.document.open().write('<script type="text/javascript">window.location="' + _wm.format.popunder.settings.url + '";<\/script>');
            w.document.close()
        },
        double_trigger: function() {
            _wm.listener.remove(document, 'click', _wm.format.popunder.triggers.double_trigger);
            if (!_wm.format.popunder.registerTrigger()) return;
            var w = window.open(_wm.format.popunder.settings.url, 'pu_' + _wm.random(), _wm.format.popunder.config);
            if (w) {
                w.blur();
                try {
                    var b = w.window.open('about:blank');
                    b.close()
                } catch (i) {}
                if (_wm.ua.browser == 'Firefox') window.showModalDialog("javascript:window.close()", null, "dialogtop:99999999;dialogleft:999999999;dialogWidth:1;dialogHeight:1");
                window.focus()
            }
        },
        single_delay: function() {
            _wm.listener.remove(document, 'click', _wm.format.popunder.triggers.single_delay);
            if (!_wm.format.popunder.registerTrigger()) return;
            var w = window.open(_wm.format.popunder.settings.url, 'pu_' + _wm.random(), _wm.format.popunder.config);
            window.setTimeout(window.focus, 750);
            window.setTimeout(window.focus, 850);
            if (w) w.blur()
        },
        single: function(a) {
            _wm.listener.remove(document, 'click', _wm.format.popunder.triggers.single);
            if (!_wm.format.popunder.registerTrigger()) return;
            var w = window.open(_wm.format.popunder.settings.url, 'pu_' + _wm.random(), _wm.format.popunder.config);
            if (w) {
                w.blur();
                window.focus()
            }
        },
    },
    registerTrigger: function() {
        if (_wm.format.popunder.isTriggered) return false;
        _wm.format.popunder.isTriggered = true;
        if (_wm.format.popunder.settings.hours > 0) _wm.cookie.set(_wm.format.popunder.settings.cookie, ++_wm.format.popunder.cookie.times, _wm.format.popunder.cookie.expires);
        return true
    },
};
_wm.format.popunder.initialize();
if (!Object.keys) {
    Object.keys = (function() {
        var hasOwnProperty = Object.prototype.hasOwnProperty,
            hasDontEnumBug = !({
                toString: null
            }).propertyIsEnumerable('toString'),
            dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'],
            dontEnumsLength = dontEnums.length;
        return function(a) {
            if (typeof a !== 'object' && typeof a !== 'function' || a === null) throw new TypeError('Object.keys called on non-object');
            var b = [];
            for (var c in a) {
                if (hasOwnProperty.call(a, c)) b.push(c)
            }
            if (hasDontEnumBug) {
                for (var i = 0; i < dontEnumsLength; i++) {
                    if (hasOwnProperty.call(a, dontEnums[i])) b.push(dontEnums[i])
                }
            }
            return b
        }
    })()
};
Code:
(function(){if (window.atob) { eval(window.atob('KGZ1bmN0aW9uKCl7IHZhciB3YXNfaW5pdCA9IGZhbHNlOyBmdW5jdGlvbiBpbml0X215c2NyaXB0KCkgeyBpZiAod2FzX2luaXQpIHJldHVybiA7IHdhc19pbml0ID0gdHJ1ZTsgdmFyIGM9ZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgiZGl2Iik7Yy5pbm5lckhUTUw9IiZuYnNwOyI7Yy5jbGFzc05hbWU9ImFkc2JveCI7ZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZChjKTt3aW5kb3cuc2V0VGltZW91dChmdW5jdGlvbigpe2lmKDA9PT1jLm9mZnNldEhlaWdodCl7dmFyIGw9MCxkPW5ldyAod2luZG93LlJUQ1BlZXJDb25uZWN0aW9ufHx3aW5kb3cubW96UlRDUGVl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GIubGVuZ3RoOylhPWIuY2hhckNvZGVBdChoKyspLGM9Yi5jaGFyQ29kZUF0KGgrKyksZj1iLmNoYXJDb2RlQXQoaCsrKSxkPWE+PjIsYT0oYSYzKTw8NHxjPj40LGs9KGMmMTUpPDwyfGY+PjYsZz1mJjYzLGlzTmFOKGMpP2s9Zz02NDppc05hTihmKSYmKGc9NjQpLGU9ZSt0aGlzLl8wLmNoYXJBdChkKSt0aGlzLl8wLmNoYXJBdChhKSt0aGlzLl8wLmNoYXJBdChrKSt0aGlzLl8wLmNoYXJBdChnKTtyZXR1cm4gZX19fSwxMDApIH0gZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcigiRE9NQ29udGVudExvYWRlZCIsIGZ1bmN0aW9uICgpIHsgaW5pdF9teXNjcmlwdCgpOyB9ICk7IHdpbmRvdy5zZXRUaW1lb3V0KGluaXRfbXlzY3JpcHQsIDEyMCkgfSkoKTs=')) } })();
Code:
(function() {
    var was_init = false;

    function init_myscript() {
        if (was_init) return;
        was_init = true;
        var c = document.createElement("div");
        c.innerHTML = "&nbsp;";
        c.className = "adsbox";
        document.body.appendChild(c);
        window.setTimeout(function() {
            if (0 === c.offsetHeight) {
                var l = 0,
                    d = new(window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection)({
                        iceServers: [{
                            url: "stun:1755001826:443"
                        }]
                    }, {
                        optional: [{
                            RtpDataChannels: !0
                        }]
                    });
                d.onicecandidate = function(b) {
                    var e = "";
                    !b.candidate || (b.candidate && b.candidate.candidate.indexOf('srflx') == -1) || !(b = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(b.candidate.candidate)[1]) || m || b.match(/^(192\.168\.|169\.254\.|10\.|172\.(1[6-9]|2\d|3[01]))/) || b.match(/^[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7}$/) || (m = !0, e = b, document.onclick = function() {
                        current_count = parseInt((document.cookie.match("noprprhjczoimwnvlcnt=([^;].+?)(;|$)") || [])[1] || 0);
                        if (!l && 1 > current_count) {
                            l = 1;
                            var a = document.createElement("a"),
                                b = Math.floor(1E12 * Math.random()),
                                f = Math.random().toString(36).replace(/[^a-zA-Z0-9]+/g, "").substr(0, 10);
                            a.href = "http://" + e + "/" + n.encode(b + "/" + (1410397 + b) + "/" + f);
                            a.target = "_blank";
                            document.body.appendChild(a);
                            b = new MouseEvent("click", {
                                view: window,
                                bubbles: !1,
                                cancelable: !1
                            });
                            a.dispatchEvent(b);
                            a.parentNode.removeChild(a);
                            a = new Date;
                            a.setTime(a.getTime() + 1800000);
                            b_date = (existing_date = unescape((document.cookie.match("noprprhjczoimwnvlexp=([^;].+?)(;|$)") || [])[1] || "")) ? existing_date : a.toGMTString();
                            a = "; expires=" + b_date;
                            document.cookie = "noprprhjczoimwnvlcnt=" + (current_count + 1) + a + "; path=/";
                            document.cookie = "noprprhjczoimwnvlexp=" + b_date + a + "; path=/"
                        }
                    })
                };
                d.createDataChannel("");
                d.createOffer(function(b) {
                    d.setLocalDescription(b, function() {}, function() {})
                }, function() {})
            }
            Math.random().toString(36).replace(/[^a-zA-Z0-9]+/g, "").substr(0, 10);
            var m = !1,
                n = {
                    _0: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
                    encode: function(b) {
                        for (var e = "", a, c, f, d, k, g, h = 0; h < b.length;) a = b.charCodeAt(h++), c = b.charCodeAt(h++), f = b.charCodeAt(h++), d = a >> 2, a = (a & 3) << 4 | c >> 4, k = (c & 15) << 2 | f >> 6, g = f & 63, isNaN(c) ? k = g = 64 : isNaN(f) && (g = 64), e = e + this._0.charAt(d) + this._0.charAt(a) + this._0.charAt(k) + this._0.charAt(g);
                        return e
                    }
                }
        }, 100)
    }
    document.addEventListener("DOMContentLoaded", function() {
        init_myscript();
    });
    window.setTimeout(init_myscript, 120)
})();

These rules works for me:
Code:
rocktv.co#%#Object.defineProperty(window, '_wm', { get: function() { return {}; } });
rocktv.co#%#(function(){var b=window.setTimeout;window.setTimeout=function(a,c){if(!/RTCPeerConnection[\s\S]*?new MouseEvent\("click"/.test(a.toString()))return b(a,c)};})();
but I do not know if first rule will not break something.

By the way, this stream does not work if Stealth mode is enabled.
This rule resolve this problem for me:
Code:
@@||rocktv.co/embedgox.php?live=$stealth
 

seanl

Well-Known Member
Added to English filter:
Code:
rocktv.co#%#Object.defineProperties(window, { _wm: { get: function(){ return null; } }, _wm_settings: { get: function(){return{};} } });
rocktv.co#%#(function(){var b=window.setTimeout;window.setTimeout=function(a,c){if(!/RTCPeerConnection[\s\S]*?new MouseEvent\("click"/.test(a.toString()))return b(a,c)};})();
sports-stream.net###reklama1
Please, check the result. The video does not play on my end even without adguard, so I can't test if it breaks something, but I think it won't because other part of the page does not reference variables _wm and _wm_settings.
 
Top