Disable WebGL on all pages (modified)

This script will disable WebGL on all sites (but with few site exceptions included to make online games work properly)

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         Disable WebGL on all pages (modified)
// @version      2025.10.08
// @description  This script will disable WebGL on all sites (but with few site exceptions included to make online games work properly)
// @author       Joey_JTS
// @license MIT
// @include      http://*
// @include      https://*
// @exclude      *://agar.io
// @exclude      *://classic.minecraft.net
// @exclude      *://crazygames.com
// @exclude      *://diep.io
// @exclude      *://newgrounds.com
// @exclude      *://ruffle.rs
// @exclude      *://scratch.mit.edu
// @exclude      *://slither.io
// @exclude      *://turbowarp.org
// @namespace    https://greasyfork.org/en/users/761382
// @unwrap
// @run-at       document-idle
// @unwrap
// @grant        none
// ==/UserScript==

(function () {
  "use strict";

  const originalGetContext = HTMLCanvasElement.prototype.getContext;
  HTMLCanvasElement.prototype.getContext = function (contextType) {
    if (contextType === "webgl" || contextType === "webgl2") {
      console.log("WebGL is disabled by Tampermonkey");
      return null;
    }
    return originalGetContext.apply(this, arguments);
  };
})();