Skip Bit Heroes Ads

Allows to skip ads on Bit Heroes, but keep get the rewards

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Skip Bit Heroes Ads
// @version      0.81
// @description  Allows to skip ads on Bit Heroes, but keep get the rewards
// @author       Spychopat
// @include      https://www.kongregate.com/games/juppiomenz/bit-heroes
// @match        https://www.kongregate.com/games/juppiomenz/bit-heroes
// @grant        none
// @namespace http://tampermonkey.net/
// ==/UserScript==

(function() {
    'use strict';

    var ul = document.getElementById("quicklinks");
    var li = document.createElement("li");
    li.appendChild(document.createTextNode('● Ads skipper by Spychopat ●'));
    li.style.color="white";
    ul.appendChild(li);

    setInterval(function() {
        var frame = document.getElementById("epom-tag-container-iframe");
        var msg = document.getElementsByClassName("ironrv-complete-text").length;
        if(frame) {
            // make the close cross instantly visible
            document.querySelector('.ironrv-close').style = "";
            // close the ad frame if offer is completed
            if(msg > 0){
                setTimeout(function () {
                    document.querySelector('.ironrv-close').click();
                }, 1000);
            }
            // fire regular reward
            if(frame.contentWindow.Common)
                frame.contentWindow.Common.onReward();
        }
    }, 200);
})();