Greasy Fork

Greasy Fork is available in English.

Shellshock.io Remove adblocker message

Block the adblocker message

当前为 2022-07-28 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Shellshock.io Remove adblocker message
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Block the adblocker message
// @author       mewen25
// @match        https://shellshock.io/
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @run-at       document-start
// ==/UserScript==

window.XMLHttpRequest = class extends window.XMLHttpRequest {

	open( method, url ) {
		if ( url.indexOf( 'shellshock.js' ) > - 1 ) {
			this.isScript = true;
		}
		return super.open( ...arguments );
	}

	get response() {
		if ( this.isScript ) {
			let code = super.response;
            const ad = /showAdBlockerVideo\(\),setTimeout\(\(\)=>\{vueApp\.hideAdBlockerVideo\(\),vueApp\.gameUiRemoveClassForNoScroll\(\),yi\(\)\},1e4\)\)\}/.exec(code)[0];

			console.log( '[INJECTING] - anti anti-adblock');

            const replaceAd = 'hideAdBlockerVideo(),setTimeout(()=>{yi()},100))}';

            code = code.replace(ad, replaceAd);
            return code;
 		}
		return super.response;
	}
};