I have a specific issue I want to solve right now, but the topic is phrased more generally as I would love the answer to this as well. But this might be an XY-problem because of this, so here’s the actual problem I want to solve:

I am using LibreWolf as my main browser, and it has WebGL disabled by default to avoid fingerprinting. I would like to keep it this way, but I am currently also making some internal tools for myself that requires WebGL (map renders with Plotly in Dash).

Is there a way to tell LibreWolf to enable WebGL only for specific sites, so that I don’t have to manually toggle this when I want to look at my maps? My initial thought was that this could be solved with a site-specific about:config.

You can use NoScript.
Enable WebGL in LibreWolf/Firefox, block it with NoScript and manage a white list adding manually sites you need.

@cyberwolfie@lemmy.ml
creator
link
fedilink
117d

That seems like a very simple option. Does NoScript in any way interfere with uBlock Origin or any of the settings in LibreWolf? As in, can I just allow everything except WebGL, turn on WebGL in about:config and have the exact same behavior as before?

I’m not sure if NoScript can block webgl specifically

@cyberwolfie@lemmy.ml
creator
link
fedilink
116d

It can. I’ve tried out the solution, and it works as described. Very simple and nice:)

@MrSoup@lemmy.zip
link
fedilink
2
edit-2
17d

I use Firefox with uBlock and NoScript plus other addons and seems to be no interference between those two.
Should not be an issue on LibreWolf.

NB I have not used LibreWolf, I don’t think there are any site specific toggles in about:config. This probably doesn’t help but some Android Webviews do allow this.

You probably considered this already but as a workaround could you use one browser when you need WebGL and another when you do not.

You can’t really separate any and all about:config settings per-site, neither the whole setting store in it’s entirety, but there are a few workarounds.

Generally for any about:config: you can make separate firefox profiles with their own about:config variations and use those sites in their own profile.
You can use the in-browser profile manager at about:profiles, or the little window that allows selection before startup with the firefox -P command. Works on windows too, but with .exe and the full path to it.

Then there are certain about:config settings have a pair that limits or excludes certain sites (privacy.resistFingerprinting is like that)

For webgl, I’m not sure if there’s such an about:config setting, but there’s a workaround. I have reenabled webgl in about:config, and instead blocked it with a uBlock rule, and defined exceptions to that rule for a few sites where I want it to work:

*##+js(aopr, WebGLRenderingContext.prototype.getExtension)
*##+js(aopr, WebGLRenderingContext.prototype.getParameter)

demo.f4map.com#@#+js(aopr, WebGLRenderingContext.prototype.getExtension)
demo.f4map.com#@#+js(aopr, WebGLRenderingContext.prototype.getParameter)

duckduckgo.com#@#+js(aopr, WebGLRenderingContext.prototype.getExtension)
duckduckgo.com#@#+js(aopr, WebGLRenderingContext.prototype.getParameter)

The above uBO rules use scriptlets, there are various, they can do very specific funny things with websites by running code snippets preapproved by the uBO devs. The uBO wiki on github has docs on what does aopr do. There’s also 2 exceptions, both for the maps.
When I first set it up I had known this as a proper webgl blocking solution, but if anyone could verify it I would be thankful. I think I got the first 2 lines from the uBO wiki, but I don’t remember.

@cyberwolfie@lemmy.ml
creator
link
fedilink
4
edit-2
18d

Cheers, this seems to be a good way to solve this for me! And thanks for also giving a way to have different profiles, was not aware of that!

Create a post

A place to discuss privacy and freedom in the digital world.

Privacy has become a very important issue in modern society, with companies and governments constantly abusing their power, more and more people are waking up to the importance of digital privacy.

In this community everyone is welcome to post links and discuss topics related to privacy.

Some Rules

  • Posting a link to a website containing tracking isn’t great, if contents of the website are behind a paywall maybe copy them into the post
  • Don’t promote proprietary software
  • Try to keep things on topic
  • If you have a question, please try searching for previous discussions, maybe it has already been answered
  • Reposts are fine, but should have at least a couple of weeks in between so that the post can reach a new audience
  • Be nice :)

Related communities

Chat rooms

much thanks to @gary_host_laptop for the logo design :)

  • 0 users online
  • 84 users / day
  • 537 users / week
  • 1.5K users / month
  • 6.58K users / 6 months
  • 1 subscriber
  • 2.31K Posts
  • 53.5K Comments
  • Modlog