您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Disables WebGL support, keeping only basic 2D canvas. That reduces potential exploits via OpenGL and broken drivers but can break many websites requiring OpenGL. Some most common ones are excluded.
// ==UserScript== // @name Disable WebGL API // @description Disables WebGL support, keeping only basic 2D canvas. That reduces potential exploits via OpenGL and broken drivers but can break many websites requiring OpenGL. Some most common ones are excluded. // @namespace disablewebglapi // @author k3abird // @include * // @exclude https://*.google.com/* // @exclude https://github.com/* // @exclude https://www.shadertoy.com/* // @exclude https://www.youtube.com/* // @version 1.0 // @run-at document-start // ==/UserScript== (function() { console.log("disable-webgl-api: will remove canvas and webGL support"); const kb_canvas_getContext = HTMLCanvasElement.prototype.getContext; HTMLCanvasElement.prototype.getContext = function(name) { if (name == "webgl" || name == "experimental-webgl" || name == "webgl2") { console.log("disable-webgl-api: disabled "+name) return null; } console.log("disable-webgl-api: allowing context of type "+name) return kb_canvas_getContext.apply(this, arguments); } })();