How to enable Webgl in Firefox on Ubuntu

By | July 30, 2020

WebGL

WebGL (Web Graphics Library) is a JavaScript API for rendering interactive 3D graphics and 2D graphics[2] within any compatible web browser without the use of plug-ins. 

Software based renderer

Webgl might not work directly on your system if there is no supporting hardware or graphics card available. Even then webgl can be made available inside firefox through the mesa software based renderer. To enable it following steps below

Install the Mesa off-screen rendering extension

$ sudo apt-get install libosmesa6

Next find out the location of the library installed by the package. On my system it was located at the following location for example

/usr/lib/x86_64-linux-gnu/libOSMesa.so.6.5.3

The actual location on your system can be different.

Now open firefox and do the following

1. Go to about:config
2. Search for webgl.osmesalib
3. Type in the path of the mesa library in the value of this preference.
4. Restart firefox

Test it

Now open the following url
http://get.webgl.org/

It would say "Your browser supports WebGL" and play a spinning cube animation.

Cssdeck also has a webgl item here
http://cssdeck.com/labs/sakura

For technical information about webgl support in firefox check
http://www.doesmybrowsersupportwebgl.com/

It should say Yay and display additional information about the webgl support.

If they all work fine, then webgl is enabled properly.

About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

One thought on “How to enable Webgl in Firefox on Ubuntu

Leave a Reply

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