I am getting this wiered error only on Safari browser. Don't know why. I am using AngularJS 1.3.x.
So how do I detect which libraries may be using this. And why only in safari I get this error ? Is there a way via JS to enable or disable WebGL ?
I am getting this wiered error only on Safari browser. Don't know why. I am using AngularJS 1.3.x.
So how do I detect which libraries may be using this. And why only in safari I get this error ? Is there a way via JS to enable or disable WebGL ?
Put this at the top of your HTML?
As long as this appears before any other scripts it should block webgl.
The script above changes replaces the function
someCanvas.getContext
so that when some other JavaScript tries to create a "webgl" context it returnsnull
which means creating the context fails. Otherwise if JavaScript asks for a different kind of context it calls the originalgetContext
function.As long as this script is executed first it should prevent other JavaScript on the page from creating a webgl context. It won't prevent JavaScript in iframes from creating contexts. You'd need to add the same solution to each iframe.