您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Disables websockets
当前为
// ==UserScript== // @name Disable Websockets // @namespace http://tampermonkey.net/ // @version 1.1 // @description Disables websockets // @author Fast // @include * // @grant none // @run-at document-start // @license MIT // ==/UserScript== WebSocket2 = WebSocket; /*eslint-disable-line*/ WebSocket = function(addy) { /*eslint-disable-line*/ console.log('WS: Trying to open.'); var ws; if (!this.blocked) { console.log('WS: Not blocked, allowing.'); ws = new WebSocket2(addy); this.open_sockets.push(ws); return ws; } else { console.log('WS: Blocked.'); } }; WebSocket.toggle = function() { WebSocket.prototype.blocked = !WebSocket.prototype.blocked; var sockets = WebSocket.prototype.open_sockets; if (WebSocket.prototype.blocked) { console.log('WS: Blocking. Removing Old Sockets.'); sockets.forEach(function(socket, index, sockets) { console.log("WS: Closing -", index); socket.close(); }); WebSocket.prototype.open_sockets = []; console.log("WS: Sockets left open -", WebSocket.prototype.open_sockets.length); } else { console.log("WS: Unblocking"); } }; WebSocket.prototype.close = function() { return true; }; WebSocket.prototype.open_sockets = []; WebSocket.prototype.blocked = true;
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址