Greasy Fork

破解切屏检测

破解所有网站的切屏检测

目前为 2023-01-03 提交的版本。查看 最新版本

// ==UserScript==
// @name         破解切屏检测
// @namespace    http://tampermonkey.net/
// @version      0.1.1
// @description  破解所有网站的切屏检测
// @author       share121
// @match        *://*/*
// @grant        none
// @run-at       document-start
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    ["visibilitychange", "blur", "focus", "focusin", "focusout"].forEach(
        (e) => {
            window.addEventListener(
                e,
                (e) => {
                    e.stopImmediatePropagation && e.stopImmediatePropagation();
                    e.stopPropagation();
                    e.preventDefault();
                    return false;
                },
                true
            );
        }
    );
})();