您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Some shitty sites track you to know when you are on that given tab, this script fools the site making it to think you are always with that given tab focused.
当前为
// ==UserScript== // @name Block Visibility Detections/Stop visibility tracking // @description Some shitty sites track you to know when you are on that given tab, this script fools the site making it to think you are always with that given tab focused. // @include * // @version 1.0 // @namespace https://gf.qytechs.cn/users/927418 // ==/UserScript== let events_to_block = [ "visibilitychange", "webkitvisibilitychange", "mozvisibilitychange", "hasFocus", "blur", "focus", "mouseleave" ] for (event_name of events_to_block) { document.addEventListener(event_name, function (event) { event.preventDefault(); event.stopPropagation(); event.stopImmediatePropagation(); }, true); } for (event_name of events_to_block) { window.addEventListener(event_name, function (event) { event.preventDefault(); event.stopPropagation(); event.stopImmediatePropagation(); }, true); } document.hasFocus = function () { return true; }; document.onvisibilitychange = null; Object.defineProperty(document, "visibilityState", { value: "visible" }); Object.defineProperty(document, "hidden", { value: false }); Object.defineProperty(document, "mozHidden", { value: false }); Object.defineProperty(document, "webkitHidden", { value: false }); Object.defineProperty(document, "webkitVisibilityState", { value: "visible" }); window.addEventListener('WheelEvent', function (event) { event.stopImmediatePropagation(); }, true); window.addEventListener('visibilitychange', function (event) { event.stopImmediatePropagation(); }, true); window.addEventListener('blur', function (event) { event.stopImmediatePropagation(); }, true); window.addEventListener('mouseleave', function (event) { event.stopImmediatePropagation(); }, true); window.addEventListener('mouseEvent', function (event) { event.stopImmediatePropagation(); }, true); window.addEventListener('mouseEvent.button', function (event) { event.stopImmediatePropagation(); }, true); window.addEventListener('keypress', function (event) { event.stopImmediatePropagation(); }, true); var s = document.createElement('script'); s.textContent = '(function() {' + 'var a = Node.prototype.addEventListener;' + 'Node.prototype.addEventListener = function(e) {' + "if (e !== 'visibilitychange' && e !== 'webkitvisibilitychange') {" + 'a.apply(this, arguments)' + '}}' + '})()' ; (document.head || document.documentElement).appendChild(s); s.remove(); Object.defineProperty(document, "hidden", { value : false}); for (var event_name of ["visibilitychange", "webkitvisibilitychange", "blur"]) { window.addEventListener(event_name, function(event) { event.stopImmediatePropagation(); }, true); }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址