Skip Bit Heroes Ads

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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);
})();