🚫🔞 防沉迷终结者 🕺🎮

[❤️支持全面] 支持 4399 (部分网页游戏到点不踢),7k7k,17yy,37,9377,游戏狗,u7u9,7724,07073,4366 [😱别怕大人] 大人来了就按"大人键" [🕶 手动破解] 防沉迷破解不成功? 对着防沉迷弹窗按快捷键 [😵‍💫万能规则] 误杀率高, 几乎没卵用的功能

ติดตั้งสคริปต์นี้?
สคริปต์ที่แนะนำของผู้เขียน

คุณอาจชื่นชอบ 一键下载 flash 游戏

ติดตั้งสคริปต์นี้
  1. // ==UserScript==
  2. // @name 🚫🔞 防沉迷终结者 🕺🎮
  3.  
  4. // @description [❤️支持全面] 支持 4399 (部分网页游戏到点不踢),7k7k,17yy,37,9377,游戏狗,u7u9,7724,07073,4366 [😱别怕大人] 大人来了就按"大人键" [🕶 手动破解] 防沉迷破解不成功? 对着防沉迷弹窗按快捷键 [😵‍💫万能规则] 误杀率高, 几乎没卵用的功能
  5.  
  6. // @namespace https://fcmsb250.github.io/
  7. // @version 5.0.0
  8. // @icon https://dsy4567.github.io/logo.svg
  9. // @author dsy4567 https://greasyfork.org/zh-CN/users/822325 | https://github.com/dsy4567
  10. // @run-at document-start
  11. // @license GPL-3.0
  12.  
  13. // @compatible firefox firefox + tampermonkey 测试通过
  14. // @compatible chrome chrome/360安全浏览器 + tampermonkey 测试通过
  15. // @compatible edge edge + tampermonkey 测试通过
  16.  
  17. // @match *://*.17yy.com/*
  18. // @match *://*.4399.com/*
  19. // @match *://*.7k7k.com/*
  20. // @match *://*.aiwan4399.com/*
  21. // @match *://*.iwan4399.com/*
  22. // @match *://*.zxwyouxi.com/*
  23. // @match *://*.5054399.net/*
  24. // @match *://*.5054399.com/*
  25. // @match *://h5.07073.com/*
  26. // @match *://*.7724.com/*
  27. // @match *://*.u7u9.com/*
  28. // @match *://*.9377.com/*
  29. // @match *://*.37.com/*
  30. // @match *://*.4366.com/*
  31.  
  32. // @grant GM_addStyle
  33. // @grant GM_addValueChangeListener
  34. // @grant GM_getValue
  35. // @grant GM_info
  36. // @grant GM_notification
  37. // @grant GM_openInTab
  38. // @grant GM_registerMenuCommand
  39. // @grant GM_setValue
  40. // @grant GM_unregisterMenuCommand
  41. // @grant unsafeWindow
  42.  
  43. // @homepageURL https://fcmsb250.github.io/
  44. // @supportURL https://github.com/dsy4567/Fucking-Anti-Indulgence/
  45.  
  46. // ==/UserScript==
  47.  
  48. "use strict";
  49. let D = new Date();
  50.  
  51. function setValue(value, defaultValue, callback) {
  52. if (GM_getValue(value, defaultValue) == "1") {
  53. GM_setValue(value, "0");
  54. } else if (GM_getValue(value, defaultValue) == "0") {
  55. GM_setValue(value, "1");
  56. } else {
  57. GM_setValue(value, defaultValue);
  58. }
  59. if (callback) {
  60. callback();
  61. }
  62. }
  63. function initStorage(value, defaultValue, callback) {
  64. if (GM_getValue(value, null) == null) {
  65. GM_setValue(value, defaultValue);
  66. }
  67. if (callback) {
  68. callback();
  69. }
  70. }
  71. function checkValue(value) {
  72. if (GM_getValue(value) == "1") {
  73. return "✅已启用 ";
  74. } else if (GM_getValue(value) == "0") {
  75. return "❌已停用 ";
  76. } else {
  77. return "⚠️配置错误 ";
  78. }
  79. }
  80. /** @returns {HTMLCanvasElement | HTMLScriptElement | HTMLIFrameElement} */
  81. function qs(selector) {
  82. return document.querySelector(selector);
  83. }
  84. /** @returns {(HTMLCanvasElement | HTMLScriptElement | HTMLIFrameElement)[]} */
  85. function qsa(selector) {
  86. return document.querySelectorAll(selector);
  87. }
  88.  
  89. initStorage("安装日期", String(Math.floor(D.getTime() / 1000 / 60 / 60 / 24)));
  90. initStorage("停用快捷键", "0");
  91. initStorage("开发环境", "0");
  92.  
  93. var daysUsed =
  94. Math.ceil(D.getTime() / 1000 / 60 / 60 / 24) -
  95. Number(GM_getValue("安装日期"));
  96. let pageLoaded = false;
  97. let popupStyle = { remove: () => {} };
  98. let lastMenuId = 0;
  99. let realAddress_17yy = "";
  100. /** @type {Function} */
  101. let _playLoading;
  102. let devConfig = {};
  103. let succeeded = false;
  104. let gamePlatform = "";
  105.  
  106. const locationHref = location.href;
  107. const host = location.host;
  108. const pathname = location.pathname;
  109. const U = new URL(location.href);
  110.  
  111. if (GM_getValue("开发环境") == "1") {
  112. devConfig.EnableConsoleOutput = 1;
  113. devConfig.EnableDebugging = 1;
  114. // devConfig.DisableAutomaticCracking = 1;
  115. devConfig.exportVariables = 1;
  116. } else {
  117. devConfig.EnableConsoleOutput = 0;
  118. devConfig.EnableDebugging = 0;
  119. devConfig.DisableAutomaticCracking = 0;
  120. devConfig.exportVariables = 0;
  121. }
  122.  
  123. (() => {
  124. const a = host.split(".");
  125. for (let i = 0; i < a.length; i++) {
  126. const ss = a[i];
  127. if (ss === "com" || ss === "cn") {
  128. gamePlatform = a[i - 1];
  129. break;
  130. }
  131. }
  132. })();
  133.  
  134. const /** @type {Record<string, (() => void)[]>} */ rules = {
  135. 4399: [
  136. // 使防沉迷尝试读取某些全局变量时报错
  137. // https://www.4399.com/flash/223745_2.htm
  138. () => {
  139. Object.defineProperty(unsafeWindow, "smevent", {
  140. value: null,
  141. writable: false,
  142. });
  143. Object.defineProperty(unsafeWindow, "PageWebApiSdk", {
  144. value: null,
  145. writable: false,
  146. });
  147. Object.defineProperty(unsafeWindow, "getBizid", {
  148. value: null,
  149. writable: false,
  150. });
  151. },
  152. // https://h.4399.com/zzy/236117.htm
  153. () => {
  154. if (
  155. host !== "h.4399.com" ||
  156. (host === "h.4399.com" && !pathname.includes("/play/"))
  157. )
  158. return;
  159.  
  160. if (devConfig.EnableDebugging) {
  161. debugger;
  162. }
  163.  
  164. log(["4399 手机端防沉迷"]);
  165.  
  166. const url = unsafeWindow.webServer + unsafeWindow.gameiframe;
  167. if (url && unsafeWindow.webServer && unsafeWindow.gameiframe) {
  168. succeeded = 1;
  169. location.href = url;
  170. }
  171. },
  172. // https://www.4399.com/flash/209443.htm
  173. () => {
  174. if (
  175. host !== "h.api.4399.com" ||
  176. (host === "h.api.4399.com" && pathname !== "/g.php")
  177. )
  178. return;
  179.  
  180. if (devConfig.EnableDebugging) {
  181. debugger;
  182. }
  183.  
  184. log(["4399 h5页游防沉迷(h.api.4399.com/g.php)"]);
  185.  
  186. const gameId = U.searchParams.get("gameId");
  187. if (!gameId) return;
  188. fetch("https://h.api.4399.com/intermodal/user/grant2", {
  189. method: "POST",
  190. body: `gameId=${gameId}&authType=cookie&cookieValue=${getMiddleString(
  191. "Pauth=",
  192. ";",
  193. document.cookie
  194. )}`,
  195. headers: {
  196. "Content-Type":
  197. "application/x-www-form-urlencoded; charset=UTF-8",
  198. },
  199. })
  200. .then(res => res.json())
  201. .then(resp => {
  202. log([resp]);
  203. if (resp.data.game.gameUrl)
  204. location.href = resp.data.game.gameUrl;
  205. else throw new Error("[防沉迷终结者] gameUrl 为空");
  206. })
  207. .catch(err => console.error(err));
  208. succeeded = 1;
  209. },
  210. ],
  211.  
  212. // 4399 在线玩
  213. zxwyouxi: [
  214. // https://www.zxwyouxi.com/g/100057159
  215. () => {
  216. if (
  217. host !== "www.zxwyouxi.com" ||
  218. (host === "www.zxwyouxi.com" && !pathname.startsWith("/g/"))
  219. )
  220. return;
  221.  
  222. if (devConfig.EnableDebugging) {
  223. debugger;
  224. }
  225.  
  226. log(["4399 h5页游防沉迷(www.zxwyouxi.com/g/)"]);
  227.  
  228. fetch("https://h.api.4399.com/intermodal/user/grant2", {
  229. method: "POST",
  230. body: `gameId=${getMiddleString(
  231. "/g/",
  232. "",
  233. locationHref,
  234. "3"
  235. )}&authType=token&userId=${getMiddleString(
  236. "4399_HTML5_PREVIEW_USERID=",
  237. ";",
  238. document.cookie
  239. )}&accessToken=${getMiddleString(
  240. "HTML5_ACCESS_TOKEN=",
  241. ";",
  242. document.cookie
  243. )}`,
  244. headers: {
  245. "Content-Type":
  246. "application/x-www-form-urlencoded; charset=UTF-8",
  247. },
  248. })
  249. .then(res => res.json())
  250. .then(resp => {
  251. log([resp]);
  252. if (resp.data.game.gameUrl)
  253. location.href = resp.data.game.gameUrl;
  254. else throw new Error("[防沉迷终结者] gameUrl 为空");
  255. })
  256. .catch(err => console.error(err));
  257. succeeded = 1;
  258. },
  259. ],
  260. "7k7k": [
  261. // http://www.7k7k.com/swf/205652.htm
  262. () => {
  263. if (!unsafeWindow.play22) return;
  264.  
  265. if (devConfig.EnableDebugging) {
  266. debugger;
  267. }
  268.  
  269. log(["7k7k防沉迷"]);
  270.  
  271. unsafeWindow.play22.playLoading();
  272. if (!_playLoading) {
  273. _playLoading = unsafeWindow.play22.playLoading;
  274. }
  275. unsafeWindow.play22.playLoading = () => {}; // 防止重复调用
  276. succeeded = 1;
  277. },
  278. // http://m.7k7k.com/flash/205652.htm
  279. () => {
  280. if (
  281. host !== "m.7k7k.com" ||
  282. (host === "m.7k7k.com" &&
  283. !pathname.includes("/flash/") &&
  284. host === "m.7k7k.com" &&
  285. !pathname.includes("/swf/"))
  286. )
  287. return;
  288.  
  289. if (devConfig.EnableDebugging) {
  290. debugger;
  291. }
  292.  
  293. log(["7k7k手机端防沉迷"]);
  294.  
  295. unsafeWindow.open = null;
  296. const f = () => {
  297. removeListeners("div.gameInfo_begin.jsbegin");
  298. qs("div.gameInfo_begin.jsbegin").addEventListener(
  299. "click",
  300. () =>
  301. fetch(unsafeWindow.gameInfo.gameUrl)
  302. .then(res => res.text())
  303. .then(html => {
  304. location.href = getMiddleString(
  305. 'gameUrl: "',
  306. '",',
  307. html,
  308. "1"
  309. );
  310. })
  311. );
  312. };
  313. pageLoaded ? f() : addEventListener("DOMContentLoaded", f);
  314. succeeded = 1;
  315. },
  316. // http://h5.7k7k.com/mb/mb2/5b5dd7da8ad23b748f9ea32a7a3cedfa.html?gid=f5c4dbf7fb41d89d76a333332f33f853&tid=94606&qs=1
  317. () => {
  318. if (
  319. host !== "m.7k7k.com" ||
  320. (host === "m.7k7k.com" &&
  321. !pathname.includes("/web/H5GAMES.html"))
  322. )
  323. return;
  324.  
  325. if (devConfig.EnableDebugging) {
  326. debugger;
  327. }
  328.  
  329. log(["7k7k h5页游防沉迷"]);
  330.  
  331. fetch(
  332. `//h5.7k7k.com/api_redirect/game/start/?client=0&account=${getMiddleString(
  333. "userid=",
  334. ";",
  335. document.cookie,
  336. "2"
  337. )}&appkey=${getMiddleString(
  338. "gid=",
  339. "&",
  340. locationHref,
  341. "2"
  342. )}&uid=${getMiddleString(
  343. "userid=",
  344. ";",
  345. document.cookie,
  346. "2"
  347. )}&tid=${getMiddleString("tid=", "&", locationHref, "2")}`
  348. )
  349. .then(res => res.json())
  350. .then(json => {
  351. location.href = json.url;
  352. });
  353. succeeded = 1;
  354. },
  355. () => {
  356. if (
  357. !host.includes("h5.7k7k.com") ||
  358. (host.includes("h5.7k7k.com") &&
  359. !pathname.includes("/game/"))
  360. )
  361. return;
  362.  
  363. if (devConfig.EnableDebugging) {
  364. debugger;
  365. }
  366.  
  367. log(["7k7k h5页游(手机端)防沉迷"]);
  368.  
  369. fetch(
  370. `//h5.7k7k.com/api_redirect/game/start/?client=0&account=${getMiddleString(
  371. "userid=",
  372. ";",
  373. document.cookie,
  374. "2"
  375. )}&appkey=${unsafeWindow.gid[0]}&uid=${getMiddleString(
  376. "userid=",
  377. ";",
  378. document.cookie,
  379. "2"
  380. )}&tid=${unsafeWindow.tid}`
  381. )
  382. .then(res => res.json())
  383. .then(json => {
  384. location.href = json.url;
  385. });
  386. succeeded = 1;
  387. },
  388. ],
  389. "17yy": [
  390. // https://www.17yy.com/f/play/246085.html
  391. // https://www.17yy.com/f/play/246568.html
  392. () => {
  393. if (
  394. host !== "www.17yy.com" ||
  395. (host === "www.17yy.com" && !pathname.startsWith("/f/play"))
  396. )
  397. return;
  398.  
  399. if (devConfig.EnableDebugging) {
  400. debugger;
  401. }
  402.  
  403. log(["17yy防沉迷"]);
  404.  
  405. try {
  406. if (qs("#flashgame").src === realAddress_17yy) return;
  407. } catch (e) {}
  408. try {
  409. if (qs("#flash_frame").src === realAddress_17yy) return;
  410. } catch (e) {}
  411.  
  412. fetch("//www.17yy.com/e/payapi/vip_ajax.php", {
  413. method: "POST",
  414. body: `action=getStatus&id=${getMiddleString(
  415. "/f/play/",
  416. ".html",
  417. locationHref,
  418. "3"
  419. )}`,
  420. headers: {
  421. "Content-Type":
  422. "application/x-www-form-urlencoded; charset=UTF-8",
  423. },
  424. })
  425. .then(res => res.json())
  426. .then(resp => {
  427. try {
  428. qs("#flashgame").src = realAddress_17yy =
  429. "//" +
  430. unsafeWindow.server +
  431. "/" +
  432. unsafeWindow.classes +
  433. "/" +
  434. unsafeWindow.date +
  435. "/" +
  436. resp.data.game_path;
  437. } catch (e) {}
  438. try {
  439. qs("#flash_frame").src = realAddress_17yy =
  440. "//" +
  441. unsafeWindow.server +
  442. "/" +
  443. unsafeWindow.classes +
  444. "/" +
  445. unsafeWindow.date +
  446. "/" +
  447. resp.data.game_path;
  448. } catch (e) {}
  449. });
  450. succeeded = 1;
  451. },
  452. ],
  453. 7724: [
  454. // https://www.7724.com/XuanCaiTuXing/
  455. () => {
  456. if (
  457. host !== "i.7724.com" ||
  458. (host === "i.7724.com" &&
  459. !locationHref.includes("/user/danjilogin?url="))
  460. )
  461. return;
  462.  
  463. if (devConfig.EnableDebugging) {
  464. debugger;
  465. }
  466.  
  467. log(["7724防沉迷"]);
  468.  
  469. let url = getMiddleString(
  470. "danjilogin?url=",
  471. undefined,
  472. locationHref,
  473. "1"
  474. );
  475. location.href = url;
  476. succeeded = 1;
  477. },
  478. ],
  479. 4366: [
  480. // http://wvw.4366.com/game_login.php?game=bscq&server=new
  481. () => {
  482. if (
  483. !host.includes("wvw.4366.com") ||
  484. (host.includes("wvw.4366.com") &&
  485. !pathname.includes("/game_login.php"))
  486. )
  487. return;
  488.  
  489. if (devConfig.EnableDebugging) {
  490. debugger;
  491. }
  492.  
  493. log(["4366防沉迷"]);
  494.  
  495. fetch(locationHref)
  496. .then(res => res.text())
  497. .then(html => {
  498. let url = getMiddleString(
  499. 'align="left" id="iframe" src="',
  500. '" name="mainFrame" scrolling="auto"',
  501. html,
  502. "1"
  503. );
  504. location.href = url;
  505. });
  506. succeeded = 1;
  507. },
  508. ],
  509. 37: [
  510. // https://game.37.com/server_list_901.html
  511. () => {
  512. if (
  513. !host.includes("game.37.com") ||
  514. (host.includes("game.37.com") &&
  515. !pathname.includes("/play.php"))
  516. )
  517. return;
  518.  
  519. if (devConfig.EnableDebugging) {
  520. debugger;
  521. }
  522.  
  523. log(["37防沉迷"]);
  524.  
  525. fetch(locationHref)
  526. .then(res => res.text())
  527. .then(html => {
  528. let url = getMiddleString(
  529. 'src="//gameapp.37.com/controller/enter_game.php',
  530. '" id="mainFrame"',
  531. html,
  532. "1",
  533. "//gameapp.37.com/controller/enter_game.php"
  534. );
  535. location.href = url;
  536. });
  537. succeeded = 1;
  538. },
  539. ],
  540. 9377: [
  541. // http://www.9377.com/bscq/
  542. () => {
  543. if (
  544. !host.includes("wvw.9377.com") ||
  545. (host.includes("wvw.9377.com") &&
  546. !pathname.includes("/game_login.php"))
  547. )
  548. return;
  549.  
  550. if (devConfig.EnableDebugging) {
  551. debugger;
  552. }
  553.  
  554. log(["9377防沉迷"]);
  555.  
  556. fetch(locationHref)
  557. .then(res => res.text())
  558. .then(html => {
  559. let url = getMiddleString(
  560. 'id="iframe" src="',
  561. '" name="mainFrame" scrolling="auto"',
  562. html,
  563. "1"
  564. );
  565. location.href = url;
  566. });
  567. succeeded = 1;
  568. },
  569. ],
  570. };
  571. const blackList = [
  572. "#addiv",
  573. "#anti-indulge",
  574. "#anti-indulge-prompt",
  575. "#Anti_mask",
  576. "#Anti_open",
  577. "#app > div > div.cover.splash",
  578. "#chCoverDiv",
  579. "#codepop6",
  580. "#cover",
  581. "#div_dialog",
  582. "#easyDialogBox",
  583. "#fcmIframe",
  584. "#Guide",
  585. "#loginCertify",
  586. "#messageBox",
  587. "#overlay",
  588. "#page_wallpaper > div.xiaowei.xiaowei-orange > div.xw-left > div.xw-game > div.xw-top > div > div",
  589. "#pop2",
  590. "#pusher",
  591. "#shadow",
  592. "#swfdiv > div.box",
  593. "#tc100",
  594. "#yx_log",
  595.  
  596. ".codegs",
  597. ".cmMask",
  598. ".fixedModal",
  599. ".mask",
  600. ".play_load",
  601. ".popup-c",
  602. ".realName",
  603. ".sdkDialog",
  604. ".toolDialog",
  605. ".ui-forbidden",
  606. ".webtipss",
  607.  
  608. "body > div.show_box.popup_bg",
  609. "div[style*='z-index: 99999']",
  610. ];
  611.  
  612. /**
  613. * 为某个字符串获取两个字符串中间的字符串(不包括那两个字符串)
  614. * @param {String} begin
  615. * @param {String} end (可以是空字符串)
  616. * @param {String} target
  617. * @param {String | undefined} type "1": 网址, "2": 字母 + 数字, "3": 数字 (可选)
  618. * @param {String | undefined} append 在匹配到字符串, 判断字符串类型之前, 给匹配到的字符串前面追加指定的字符串 (可选)
  619. * @returns {String}
  620. */
  621. function getMiddleString(begin, end, target, type, append) {
  622. target = target.substring(target.indexOf(begin) + begin.length);
  623. if (end) {
  624. target = decodeURI(target.substring(0, target.indexOf(end)));
  625. }
  626. if (append) {
  627. target = append + target;
  628. }
  629. switch (type) {
  630. case "1":
  631. if (!(/^https?:\/\//gi.test(target) || target.startsWith("//"))) {
  632. throw new Error("[防沉迷终结者] 不正确的字符串类型");
  633. }
  634. break;
  635. case "2":
  636. if (!/^[0-9a-zA-Z]*$/g.test(target)) {
  637. throw new Error("[防沉迷终结者] 不正确的字符串类型");
  638. }
  639. break;
  640. case "3":
  641. if (isNaN(Number(target))) {
  642. throw new Error("[防沉迷终结者] 不正确的字符串类型");
  643. }
  644. break;
  645.  
  646. default:
  647. break;
  648. }
  649. return target;
  650. }
  651.  
  652. function removeListeners(selector) {
  653. qsa(selector).forEach(oldElement => {
  654. const newElement = oldElement.cloneNode(true);
  655. oldElement.parentNode.replaceChild(newElement, oldElement);
  656. });
  657. }
  658.  
  659. function capitalizeFirstLetter(str) {
  660. str = str[0].toUpperCase() + str.substring(1, str.length);
  661. return str;
  662. }
  663.  
  664. /** @param {any[]} data */
  665. function log(data) {
  666. if (devConfig.EnableConsoleOutput)
  667. console.log("[防沉迷终结者]", ...data, locationHref);
  668. }
  669.  
  670. function useGeneralRules() {
  671. const idOrClassNameOfGame = [
  672. "flash",
  673. "game",
  674. "play",
  675. "youxi",
  676. "swf",
  677. "flash",
  678. ];
  679. const idOrClassNameOfAnti = [
  680. "anti",
  681. "fcm",
  682. "verify",
  683. "mask",
  684. "certify",
  685. "dialog",
  686. "popup",
  687. "login",
  688. "cover",
  689. ];
  690. let temp = [];
  691. let style = "";
  692.  
  693. idOrClassNameOfGame.forEach(str => {
  694. temp.push(
  695. "iframe[id*='" + str + "'],",
  696. "iframe[class*='" + str + "'],",
  697. "iframe[id*='" + str.toUpperCase() + "'],",
  698. "iframe[class*='" + str.toUpperCase() + "'],",
  699. "iframe[id*='" + capitalizeFirstLetter(str) + "'],",
  700. "iframe[class*='" + capitalizeFirstLetter(str) + "'],"
  701. );
  702. });
  703. temp.forEach(str => {
  704. style += str;
  705. });
  706. style += `#qwqawaqaq
  707. {
  708. display: block !important;
  709. left: 0 !important;
  710. top: 0 !important;
  711. position: absolute !important;
  712. z-index: 999999 !important;
  713. }`;
  714. temp = [];
  715.  
  716. idOrClassNameOfAnti.forEach(str => {
  717. temp.push(
  718. "[id*='" + str + "'],",
  719. "[class*='" + str + "'],",
  720. "[id*='" + str.toUpperCase() + "'],",
  721. "[class*='" + str.toUpperCase() + "'],",
  722. "[id*='" + capitalizeFirstLetter(str) + "'],",
  723. "[class*='" + capitalizeFirstLetter(str) + "'],"
  724. );
  725. });
  726. temp.forEach(str => {
  727. style += str;
  728. });
  729. style += `#qwqawaqaq
  730. {
  731. display: none !important;
  732. min-width: 0 !important;
  733. width: 0 !important;
  734. max-width: 0 !important;
  735. min-height: 0 !important;
  736. height: 0 !important;
  737. max-height: 0 !important;
  738. z-index: -999 !important;
  739. font-size: 0 !important;
  740. overflow: hidden !important;
  741. }`;
  742. temp = [];
  743.  
  744. GM_addStyle(style);
  745. }
  746.  
  747. function registerMenuCommand() {
  748. const menus = [
  749. [
  750. "⚠️沉迷于游戏不利于身心健康,请合理安排游戏时间,适度游戏⚠️",
  751. undefined,
  752. undefined,
  753. ],
  754. ["❤️您已尽情欢乐" + daysUsed + "天", undefined, undefined],
  755. [
  756. "👉再次破解(alt + 鼠标中键)",
  757. () => {
  758. succeeded = 0;
  759. if (_playLoading) {
  760. unsafeWindow.play22.playLoading = _playLoading;
  761. }
  762. crackAnti();
  763. removeMask();
  764. },
  765. undefined,
  766. ],
  767. [
  768. "👉大人来了(shift + 鼠标中键)(解除请使用再次破解)",
  769. () => {
  770. hideGame();
  771. },
  772. undefined,
  773. ],
  774. [
  775. "👉手动破解(鼠标指向防沉迷弹窗, 然后按 shift + alt + 鼠标右键)",
  776. () => {
  777. alert("请将鼠标指向防沉迷弹窗, 然后按 shift + alt + 鼠标右键");
  778. },
  779. undefined,
  780. ],
  781. [
  782. "👉万能规则(不保证实用性)",
  783. () => {
  784. GM_setValue("使用万能规则", Math.random());
  785. },
  786. undefined,
  787. ],
  788. [
  789. checkValue("停用快捷键") + " 停用快捷键",
  790. () => {
  791. setValue("停用快捷键", "0", () => {
  792. registerMenuCommand();
  793. });
  794. },
  795. undefined,
  796. ],
  797. [
  798. "👍 给个好评/📝 反馈问题",
  799. () => {
  800. GM_openInTab(
  801. "https://greasyfork.org/zh-CN/scripts/437233/feedback"
  802. );
  803. },
  804. undefined,
  805. ],
  806. [
  807. "⛔解决访问错误",
  808. () => {
  809. location.href = location.href;
  810. },
  811. undefined,
  812. ],
  813. [
  814. "⛔7k7k强制登录",
  815. () => {
  816. location.href =
  817. "http://www.7k7k.com/swf/204220.htm#fai-doLogin";
  818. },
  819. undefined,
  820. ],
  821. ];
  822. lastMenuId = lastMenuId || 0;
  823.  
  824. // TM
  825. for (
  826. let menuId = lastMenuId - menus.length * 2;
  827. menuId < lastMenuId + menus.length * 2;
  828. menuId++
  829. ) {
  830. GM_unregisterMenuCommand(menuId);
  831. }
  832.  
  833. // VM
  834. menus.forEach(menu => {
  835. GM_unregisterMenuCommand(menu[0]);
  836. });
  837. GM_unregisterMenuCommand("✅已启用 停用快捷键");
  838. GM_unregisterMenuCommand("❌已停用 停用快捷键");
  839. GM_unregisterMenuCommand("⚠️配置错误 停用快捷键");
  840.  
  841. menus.forEach(menu => {
  842. const displayName = menu[0];
  843. const func = menu[1];
  844. const accessKey = menu[2];
  845.  
  846. lastMenuId = GM_registerMenuCommand(displayName, func, accessKey);
  847. });
  848. }
  849.  
  850. function hideGame() {
  851. log(["大人来了"]);
  852. try {
  853. popupStyle.remove();
  854. log(["已去除样式"]);
  855. } catch (err) {}
  856.  
  857. popupStyle = GM_addStyle(
  858. '*{margin:0;padding:0}ul{list-style:none;}.fl{float:left;}.fr{float:right;}.mysdkDialog{position:absolute;left:50%;top:50vh;margin:-210px 0 0 -309px;width:618px;z-index:20020}.mysdkDialog .myfcmdialog{color:black;position:absolute;left:0;top:0;width:620px;padding-bottom:30px;font-family:"microsoft yahei";font-size:14px;background:#fff;border-radius:8px;}.mysdkDialog .myfcmdialog .close-btn{position:absolute;right:0;top:0;width:40px;height:40px;background-color:red;line-height:40px;cursor:pointer;display:none}.mysdkDialog .myfcmdialog .title{line-height:30px;text-align:center;font-size:22px;font-weight:700;padding:25px 0 0;margin:0 40px;color:#454545;border:0;height:auto;float:none;width:auto;text-indent:0;}.mysdkDialog .myfcmdialog .stitle{text-align:left;line-height:1.6;margin:15px 40px 0;font-size:16px;}.mysdkDialog .myfcmdialog .stitle span{color:#ffa92d;}.mysdkDialog .myfcmdialog .mod-tip{margin:20px 40px 0;background:#F0F0F0;padding:12px 15px;border-radius:4px;color:#333;text-align:left}.mysdkDialog .myfcmdialog .tip-title{font-size:16px;font-weight:400;}.mysdkDialog .myfcmdialog .tip-info{margin-top:5px;line-height:26px;font-size:14px;}.mysdkDialog .myfcmdialog .tip-info li{font-size:16px;line-height:26px}.mysdkDialog .myfcmdialog .tip-info a{color:#FAA61B;text-decoration:underline;margin:0 4px;cursor:pointer;}.mysdkDialog .myfcmdialog .mod-btn{text-align:center;font-size:0;line-height:0;margin:25px 40px 0;}.mysdkDialog .myfcmdialog .mod-btn .btn-fcmprimary{display:inline-block;width:140px;height:38px;line-height:38px;border:1px solid #69bb01;color:#69bb01;font-size:14px;margin:0 15px;border-radius:5px;cursor:pointer;}.mysdkDialog .myfcmdialog .mod-btn .fr,.mysdkDialog .myfcmdialog .mod-btn .fl{width:250px;margin:0;}.mysdkDialog .myfcmdialog .mod-btn .btn-fcmprimary:hover{-webkit-filter:brightness(1);filter:brightness(1)}.mysdkDialog .myfcmdialog .mod-btn .btn-identity{background-color:#69bb01;color:#f8ffef}.fcmIframe{position:absolute;left:50%;top:270px;margin:0 0 0 -309px;width:618px;height:354px;z-index:2019;border:0 none;background-color:#000}.countDown{background:#eee;border-radius:3px;padding:10px;text-align:center;margin:20px 40px 0;font-size:16px;color:#666}.countDown .txt1{font-size:16px;height:28px;line-height:28px;color:#717171;}.countDown .txt2{height:40px;line-height:40px;font-size:26px;font-weight:bold;color:#54ba3d;}.mycmMask{display:none;width:100%;position:absolute;left:0;top:0;background:rgb(0,0,0);}'
  859. );
  860. const popup = document.createElement("div");
  861. popup.className = "mysdkDialog";
  862. popup.innerHTML +=
  863. '<div class="myfcmdialog"><span class="close-btn">关闭</span><h2 class="title">未成年限制登录提醒</h2><div class="stitle">您使用的是未成年账号,仅周五、周六、周日及法定节假日晚上8:00-9:00可以游戏!当前已被限制!</div><div class="countDown" style=""><p class="txt1">下次可玩游戏时段</p><p class="txt2">本周五晚上8:00-9:00</p></div><div class="countDown" style="display:none">当前已限制游戏</div><div class="mod-tip" style=""><h3 class="tip-title">温馨提示:</h3><ul class="tip-info">1.如果身份信息有误,请点击<a href="https://u.4399.com/profile/realname-bizId-1199006632.html" target="_blank">》》申请修改《《</a><br>2.如果您身份信息已经变动,可点击<a target="_self" href="#">》》刷新身份《《</a></ul></div><div class="mod-btn" style=""><span class="btn-fcmprimary">更换账号</span><span class="btn-fcmprimary">确定</span></div></div>';
  864. document.body.appendChild(popup);
  865. const mask = document.createElement("div");
  866. mask.className = "mycmMask";
  867. mask.style.cssText =
  868. "height: " +
  869. document.documentElement.offsetHeight +
  870. "px; z-index: 9999; display: block";
  871. mask.innerHTML = "";
  872. document.body.appendChild(mask);
  873. }
  874.  
  875. function crackAnti() {
  876. let /** @type {(() => void)[]} */ rule;
  877. Object.keys(rules).forEach(ruleName => {
  878. if (gamePlatform.includes(ruleName)) rule = rules[ruleName];
  879. });
  880. if (succeeded || !rule) {
  881. return log(["破解被取消或未匹配规则"]);
  882. }
  883.  
  884. const begin = new Date().getTime();
  885.  
  886. for (const func of rule) {
  887. try {
  888. func();
  889. if (succeeded) break;
  890. } catch (e) {
  891. console.error(e);
  892. }
  893. }
  894.  
  895. log(["破解结束, 用时" + (new Date().getTime() - begin) + "ms"]);
  896. }
  897.  
  898. function removeMask() {
  899. try {
  900. for (let i = 0; i < blackList.length; i++) {
  901. const element = blackList[i];
  902. qsa(element)?.forEach(el => {
  903. el.remove();
  904. log(["-破解成功- " + element]);
  905. });
  906. }
  907.  
  908. [".mycmMask", ".myfcmdialog", ".mysdkDialog"].forEach(element => {
  909. qsa(element)?.forEach(el => {
  910. el.remove();
  911. log(["-解除大人来了成功- " + element]);
  912. });
  913. });
  914.  
  915. try {
  916. popupStyle.remove();
  917. log(["已去除样式"]);
  918. } catch (err) {}
  919. } catch (err) {
  920. console.error(err);
  921. }
  922. }
  923.  
  924. // 添加加样式表
  925. if (!devConfig.DisableAutomaticCracking) {
  926. let css = "";
  927. for (let i = 0; i < blackList.length; i++) {
  928. const element = blackList[i];
  929. css += element + ",";
  930. }
  931. css += `#qwqawaqaq
  932. {
  933. display: none !important;
  934. min-width: 0 !important;
  935. width: 0 !important;
  936. max-width: 0 !important;
  937. min-height: 0 !important;
  938. height: 0 !important;
  939. max-height: 0 !important;
  940. z-index: -999 !important;
  941. font-size: 0 !important;
  942. overflow: hidden !important;
  943. }`;
  944. GM_addStyle(css);
  945. log(["添加样式表成功"]);
  946. }
  947.  
  948. if (devConfig.exportVariables) {
  949. unsafeWindow.exportVariables = () => {
  950. // GM_*
  951. unsafeWindow._GM_addStyle = GM_addStyle;
  952. unsafeWindow._GM_getValue = GM_getValue;
  953. unsafeWindow._GM_info = GM_info;
  954. unsafeWindow._GM_notification = GM_notification;
  955. unsafeWindow._GM_openInTab = GM_openInTab;
  956. unsafeWindow._GM_registerMenuCommand = GM_registerMenuCommand;
  957. unsafeWindow._GM_setValue = GM_setValue;
  958. unsafeWindow._GM_unregisterMenuCommand = GM_unregisterMenuCommand;
  959.  
  960. // 普通变量
  961. unsafeWindow._D = D;
  962. unsafeWindow._lastMenuId = lastMenuId;
  963. unsafeWindow._succeeded = succeeded;
  964. unsafeWindow._devConfig = devConfig;
  965. unsafeWindow._blackList = blackList;
  966.  
  967. // 自定函数
  968. unsafeWindow._setValue = setValue;
  969. unsafeWindow._initStorage = initStorage;
  970. unsafeWindow._checkValue = checkValue;
  971. unsafeWindow._registerMenuCommand = registerMenuCommand;
  972. unsafeWindow._hideGame = hideGame;
  973. unsafeWindow._crackAnti = crackAnti;
  974. unsafeWindow._removeMask = removeMask;
  975. unsafeWindow._popupStyle = popupStyle;
  976. };
  977. unsafeWindow.exportVariables();
  978. }
  979.  
  980. // 一些不着急执行的代码
  981. setTimeout(() => {
  982. GM_addValueChangeListener("使用万能规则", () => {
  983. useGeneralRules();
  984. });
  985.  
  986. // 快捷键
  987. document.addEventListener(
  988. "mousedown",
  989. e => {
  990. if (GM_getValue("停用快捷键") == "0") {
  991. if (e.button == 1 && e.shiftKey && !e.altKey) {
  992. hideGame();
  993. }
  994. if (e.button == 2 && e.shiftKey && e.altKey) {
  995. let el = document.elementFromPoint(e.x, e.y);
  996. log([
  997. "-手动破解成功- ." +
  998. el.className +
  999. " #" +
  1000. el.id +
  1001. " <" +
  1002. el.tagName +
  1003. ">",
  1004. ]);
  1005. el.style.display = "none";
  1006. }
  1007. if (e.button == 1 && e.altKey && !e.shiftKey) {
  1008. succeeded = 0;
  1009. crackAnti();
  1010. removeMask();
  1011. }
  1012. }
  1013. },
  1014. true
  1015. );
  1016.  
  1017. if (location.host === "www.7k7k.com") {
  1018. try {
  1019. document.querySelector("div.login_no").title =
  1020. "✨防沉迷终结者支持7k7k强制登录, 请移步至脚本菜单";
  1021. } catch (e) {}
  1022.  
  1023. if (location.href.includes("fai-doLogin"))
  1024. document
  1025. .querySelector("div.login_no > div.h_login.login_btn > span")
  1026. .click();
  1027. }
  1028.  
  1029. if (qs("script[src*='chpenmljpdpkebnohfbbdpfelabcnlnp']")) {
  1030. GM_registerMenuCommand(
  1031. "⚠️您已经安装了防沉迷终结者浏览器扩展, 不推荐二者同时使用"
  1032. );
  1033. }
  1034.  
  1035. registerMenuCommand();
  1036. });
  1037.  
  1038. addEventListener("DOMContentLoaded", () => {
  1039. pageLoaded = true;
  1040.  
  1041. setTimeout(() => {
  1042. qsa("canvas").forEach(element => {
  1043. element.addEventListener(
  1044. "mousedown",
  1045. e => {
  1046. if (GM_getValue("停用快捷键") == "0") {
  1047. if (e.button == 1 && e.shiftKey) {
  1048. hideGame();
  1049. }
  1050. if (e.button == 1 && e.altKey) {
  1051. succeeded = 0;
  1052. crackAnti();
  1053. removeMask();
  1054. }
  1055. }
  1056. },
  1057. true
  1058. );
  1059. });
  1060. }, 5000);
  1061. });
  1062.  
  1063. addEventListener("load", () => {
  1064. !devConfig.DisableAutomaticCracking && crackAnti();
  1065. });
  1066. !devConfig.DisableAutomaticCracking && crackAnti();
  1067.  
  1068. log(["脚本执行完毕, 用时" + (new Date().getTime() - D.getTime()) + "ms "]);