您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
四击页面任意位置即可关闭页面
当前为
// ==UserScript== // @name 四击关闭页面 // @namespace http://tampermonkey.net/ // @version 0.2 // @description 四击页面任意位置即可关闭页面 // @author 捈荼 // @license MIT // @match http*://*/* // @match file:///*/* // @match edge://* // @match chrome-extension://* // @run-at document-start // @grant unsafeWindow // @grant window.close // ==/UserScript== 'use strict'; (function () { if (!String.prototype.format) { String.prototype.format = function () { var args = arguments; return this.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] != 'undefined' ? args[number] : match; }); }; } else { throw 'String.prototype.format defined.'; } })(); function nclickEvent(n, interval, dom, fn) { dom.removeEventListener('dblclick', null); n = parseInt(n) < 1 ? 1 : parseInt(n); var count = 0, lastTime = 0; var handler = function (event) { var currentTime = new Date().getTime(); count = (currentTime - lastTime) < interval ? count + 1 : 0; console.log('click event: last since {0} ms;\n consecutive {1} times.\n'.format(currentTime - lastTime, count + 1)); lastTime = new Date().getTime(); if (count >= n - 1) { fn(event, n); count = 0; } }; dom.addEventListener('click', handler); } (function () { nclickEvent(4, 250, document, function (event, n) { console.log(n + 'click'); window.opener = null; window.open('', '_self'); setTimeout(function () { window.close(); }, 1); }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址