How can I permanently disable WebGL in Google Chrome?

Posted on

Problem :

I know how to disable WebGL in Chrome by adding the command in the shortcut target box.

However if I open a hyperlink and no instance of Chrome is already open via this shortcut, WebGL will be enabled.

Is it possible to disable WebGL no matter how Chrome is opened?

I’m using Chrome 13.0.782.215 on Windows 7 64-bit.

Solution :

Unfortunately, the Chromium devs are slow (and apparently loathe) to handle command-line parameters when setting it as the default web browser.

Until they get around to doing it (if ever), you’ll need to set any arguments yourself for each and every registry entry (and shortcut) each time your command-line needs change.

This can become quite cumbersome since there are several registry locations in which the executable is stored, and thus would need to be updated (no less than a dozen default locations). I’ve come up with a pretty handy workaround that makes it much easier to update and maintain.

If you don’t get a good answer for this (and it’s looking like you won’t, even if one gets automatically accepted for the bounty), you would be well within your rights to file a bug report against Chromium – after all, it’s a security issue. In my opinion, if they really care about security, WebGL should be disabled by default for all users. There should at least be a way to disable it from the chrome://settings page.

I will describe how to add an invocation parameter for Firefox, which I use, and you can adapt the procedure to Chrome. This involves editing the registry, so take first all due precautions, including creating a system restore point.

Open regedit, and search forHKEY_CLASSES_ROOT.htm and HKEY_CLASSES_ROOT.html. Click on both, and you will see a (Default) entry, which for Firefox contains the value FirefoxHTML.

Now position yourself on HKEY_CLASSES_ROOTFirefoxHTMLshellopencommand. The (Default) entry contains the Firefox command invocation. Modify it to include the additional parameter (-disable-webgl in your case).

This should have instant effect, but you might possibly need to logout and login.

EDIT

Other registry keys to verify that they use the same handler (FirefoxHTML) are:

HKEY_CLASSES_ROOT.shtml
HKEY_CLASSES_ROOT.xht
HKEY_CLASSES_ROOT.xhtm
HKEY_CLASSES_ROOT.xhtml
HKEY_CLASSES_ROOTHTTPshellopencommand
HKEY_CLASSES_ROOThttpsshellopencommand
HKEY_CLASSES_ROOTftpshellopencommand

One slightly hackish way of doing this would be to create a chrome.bat somewhere in your %PATH%. In it you have [drive]:PathTochrome.exe --disable-webgl %1.

Then change the default link handler to use your chrome.bat instead of Chrome.

Leave a Reply

Your email address will not be published. Required fields are marked *