Disable WebGL API

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.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

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

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

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

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

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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);
    }
})();