您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
给 Idle Detection API 的调用者一个虚假的 active 响应
当前为
// ==UserScript== // @name Idle Detection Bypasser // @name:zh 绕过 Idle Detection // @name:zh-CN 绕过 Idle Detection // @namespace https://github.com/flyhaozi // @version 0.1.0 // @description Give a fake active response to the caller of the Idle Detection API // @description:zh 给 Idle Detection API 的调用者一个虚假的 active 响应 // @description:zh-CN 给 Idle Detection API 的调用者一个虚假的 active 响应 // @author flyhaozi // @match https://*/* // @match http://*/* // @grant none // ==/UserScript== (function() { 'use strict'; if (!('IdleDetector' in window)) { return console.log('Idle Detector is not available.'); } let callback = null; window.IdleDetector.prototype.addEventListener = function(type, listener, options) { callback = listener; console.log('Idle Detection Detected!'); }; window.IdleDetector.prototype.start = function() { Object.defineProperty(this, 'userState', { value: 'active', writable: false }); Object.defineProperty(this, 'screenState', { value: 'unlocked', writable: false }); callback && callback({ currentTarget: this, target: this }); console.log('Idle Detection Bypassed!'); }; })();