Greasy Fork

Greasy Fork is available in English.

奇安信-奇安学堂-屏蔽切屏检测

绕过网站的切屏检测

当前为 2024-05-16 提交的版本,查看 最新版本

// ==UserScript==
// @name         奇安信-奇安学堂-屏蔽切屏检测
// @match        *://*/*
// @run-at       document-start
// @grant        none
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  绕过网站的切屏检测
// @author       Houyuxi
// @license      MIT
// ==/UserScript==

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

document.hasFocus = () => true;
Object.defineProperty(document, "hidden", {
  get() {
    return false;
  }
});