{"id":834,"date":"2025-05-30T18:42:55","date_gmt":"2025-05-30T10:42:55","guid":{"rendered":"http:\/\/www.cmd137blog.top\/?p=834"},"modified":"2025-09-02T15:59:11","modified_gmt":"2025-09-02T07:59:11","slug":"%e6%b2%b9%e7%8c%b4%e8%84%9a%e6%9c%ac%ef%bc%9atampermonkeybjfu%e6%99%ba%e6%85%a7%e8%af%be%e5%a0%82%e9%98%b2%e6%9a%82%e5%81%9c%e5%8a%a9%e6%89%8b","status":"publish","type":"post","link":"http:\/\/www.cmd137blog.top\/?p=834","title":{"rendered":"\u6cb9\u7334\u811a\u672c\uff1aTampermonkey:BJFU\u667a\u6167\u8bfe\u5802\u9632\u6682\u505c\u52a9\u624b"},"content":{"rendered":"\n<p><a href=\"https:\/\/gist.github.com\/CMD137\/64a6d184b5f5aee63be65ba77bcac3b3\">Tampermonkey:BJFU\u667a\u6167\u8bfe\u5802\u9632\u6682\u505c\u52a9\u624b<\/a><\/p>\n\n\n\n<p>\u8fd9\u4e2a\u811a\u672c\u4f1a\u6bcf 5 \u79d2\u68c0\u67e5\u4e00\u6b21\u4f60\u7684\u6d3b\u52a8\u72b6\u6001\uff0c\u5982\u679c\u68c0\u6d4b\u5230\u4f60 20 \u79d2\u5185\u6ca1\u6709\u79fb\u52a8\u9f20\u6807\u6216\u6309\u952e\uff0c\u5c31\u4f1a\u81ea\u52a8\u6a21\u62df\u4e00\u4e2a\u5fae\u5c0f\u7684\u9f20\u6807\u79fb\u52a8\uff0c\u4ece\u800c\u907f\u514d\u89e6\u53d1\u7f51\u7ad9\u7684\u4e0d\u6d3b\u52a8\u68c0\u6d4b\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u4f7f\u7528\u65b9\u6cd5<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u672c\u5730\u5bfc\u5165\uff1a<\/h2>\n\n\n\n<p>\u70b9\u51fb\u4e0a\u65b9\u8fde\u63a5\u4e0b\u8f7d\u6e90\u4ee3\u7801.js\u6587\u4ef6\uff0c\u5728\u6cb9\u7334\u201c\u5b9e\u7528\u5de5\u5177\u201d\u4e2d\u201c\u5bfc\u5165\u201d\uff0c\u201c\u9009\u62e9\u6587\u4ef6\u201d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u81ea\u5df1\u521b\u5efa\u811a\u672c\uff1a<\/h2>\n\n\n\n<p>\u590d\u5236\u4e0b\u9762\u7684\u6e90\u4ee3\u7801\uff0c\u81ea\u5df1\u521b\u5efa\u811a\u672c\uff0c\u7c98\u8d34\u3002<\/p>\n\n\n\n<p>&#8212;-2025\/5\/30  \u6d4b\u8bd5\u6709\u6548<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Greasy Fork\uff1a<\/h2>\n\n\n\n<p><em><a href=\"https:\/\/greasyfork.org\/zh-CN\/scripts\/537751-bjfu%E6%99%BA%E6%85%A7%E8%AF%BE%E5%A0%82%E9%98%B2%E6%9A%82%E5%81%9C%E5%8A%A9%E6%89%8B\">BJFU\u667a\u6167\u8bfe\u5802\u9632\u6682\u505c\u52a9\u624b<\/a><\/em><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u6e90\u4ee3\u7801<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ ==UserScript==\n\/\/ @name         BJFU\u667a\u6167\u8bfe\u5802\u9632\u6682\u505c\u52a9\u624b\n\/\/ @namespace    http:\/\/www.cmd137blog.top\/\n\/\/ @version      0.1\n\/\/ @description  \u81ea\u52a8\u68c0\u6d4b\u5e76\u6a21\u62df\u9f20\u6807\u6d3b\u52a8\uff0c\u9632\u6b62\u89c6\u9891\u56e0\u957f\u65f6\u95f4\u4e0d\u52a8\u800c\u6682\u505c\n\/\/ @author       CMD137\n\/\/ @match        *:\/\/bjfu.smartclass.cn\/*\n\/\/ @grant        none\n\/\/ ==\/UserScript==\n\n(function() {\n    'use strict';\n    \/\/ \u914d\u7f6e\u53c2\u6570\n    const CHECK_INTERVAL = 5000; \/\/ \u6bcf5\u79d2\u68c0\u67e5\u4e00\u6b21\n    const INACTIVITY_THRESHOLD = 20000; \/\/ 20\u79d2\u65e0\u6d3b\u52a8\u89c6\u4e3a\u4e0d\u6d3b\u8dc3\n    const SIMULATION_MOVEMENT = 1; \/\/ \u6a21\u62df\u79fb\u52a8\u7684\u50cf\u7d20\u503c\n    let lastActivityTime = Date.now();\n    let isSimulating = false;\n    let lastMouseX = 0;\n    let lastMouseY = 0;\n\n    \/\/ \u8bb0\u5f55\u9f20\u6807\u6d3b\u52a8\n    document.addEventListener('mousemove', function(e) {\n        lastActivityTime = Date.now();\n        lastMouseX = e.clientX;\n        lastMouseY = e.clientY;\n        isSimulating = false;\n    });\n\n    document.addEventListener('keydown', function() {\n        lastActivityTime = Date.now();\n        isSimulating = false;\n    });\n\n    \/\/ \u68c0\u6d4b\u5e76\u6a21\u62df\u6d3b\u52a8\n    setInterval(function() {\n        const now = Date.now();\n        const inactiveTime = now - lastActivityTime;\n\n        if (inactiveTime &gt;= INACTIVITY_THRESHOLD &amp;&amp; !isSimulating) {\n            simulateActivity();\n        }\n    }, CHECK_INTERVAL);\n\n    \/\/ \u6a21\u62df\u9f20\u6807\u6d3b\u52a8\n    function simulateActivity() {\n        isSimulating = true;\n\n        \/\/ \u5fae\u5c0f\u79fb\u52a8\u9f20\u6807\n        const moveEvent = new MouseEvent('mousemove', {\n            clientX: lastMouseX + SIMULATION_MOVEMENT,\n            clientY: lastMouseY + SIMULATION_MOVEMENT,\n            bubbles: true,\n            cancelable: true,\n            view: window\n        });\n\n        document.dispatchEvent(moveEvent);\n\n        \/\/ \u8bb0\u5f55\u6a21\u62df\u6d3b\u52a8\u65f6\u95f4\n        lastActivityTime = Date.now();\n        lastMouseX += SIMULATION_MOVEMENT;\n        lastMouseY += SIMULATION_MOVEMENT;\n\n        console.log('\u6a21\u62df\u9f20\u6807\u6d3b\u52a8\uff0c\u9632\u6b62\u89c6\u9891\u6682\u505c');\n        \/\/alert(\"test....\");\n    }\n})();<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Tampermonkey:BJFU\u667a\u6167\u8bfe\u5802\u9632\u6682\u505c\u52a9\u624b \u8fd9\u4e2a\u811a\u672c\u4f1a\u6bcf 5 \u79d2\u68c0\u67e5\u4e00\u6b21\u4f60\u7684\u6d3b\u52a8\u72b6\u6001\uff0c\u5982\u679c\u68c0\u6d4b\u5230\u4f60  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-834","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.cmd137blog.top\/index.php?rest_route=\/wp\/v2\/posts\/834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.cmd137blog.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.cmd137blog.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.cmd137blog.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.cmd137blog.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=834"}],"version-history":[{"count":5,"href":"http:\/\/www.cmd137blog.top\/index.php?rest_route=\/wp\/v2\/posts\/834\/revisions"}],"predecessor-version":[{"id":840,"href":"http:\/\/www.cmd137blog.top\/index.php?rest_route=\/wp\/v2\/posts\/834\/revisions\/840"}],"wp:attachment":[{"href":"http:\/\/www.cmd137blog.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.cmd137blog.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=834"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.cmd137blog.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}