RapidLeech Popup Skipper

Attempts to bypass the ad popup window on RapidLeech-based sites

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         RapidLeech Popup Skipper
// @namespace    pk.qwerty12
// @version      0.1
// @author       qwerty12
// @description  Attempts to bypass the ad popup window on RapidLeech-based sites
// @include      *
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function () {
    'use strict';
    document.addEventListener("DOMContentLoaded", function() {
        var tload = document.forms['transload'];
        if (tload && document.documentElement.textContent.toLowerCase().indexOf('leech') > -1)
        {
            var btn = document.getElementsByName('btnTransload');
            if (btn && btn[0])
                btn[0].parentNode.removeChild(btn[0]);

            btn = tload.elements;
            for (var i = 0; i < btn.length; ++i) {
                var type = btn[i].type;
                if (type === 'button' || type === 'submit')
                    btn[i].parentNode.removeChild(btn[i]);
            }

            btn = document.createElement('div');
            btn.style.border = '6px lime solid';
            btn.style.width = '200px';

            var hackedbtn = document.createElement('input');
            hackedbtn.style.font = '180% arial';
            hackedbtn.style.letterSpacing = '-.05em';
            hackedbtn.style.width = '200px';
            hackedbtn.style.height = '50px';
            hackedbtn.type = 'button';
            hackedbtn.value = 'Bypass!!';
            hackedbtn.addEventListener('click', function() {
                tload.submit();
            }, false);

            btn.appendChild(hackedbtn);
            tload.appendChild(btn);
        }
    });
}());