User.js: PSA: uBO: block workers & add exceptions [added to wiki]

Created on 10 May 2018  路  4Comments  路  Source: arkenfox/user.js

@gorhill if you have time

With FF60+ having deprecated the dom.workers.enabled pref, I thought it would be nice to add an example to our uBO scripts (because not everyone has uMatrix)

Is this correct? source

To block all workers

||$csp=worker-src 'none'

Below is what the reddit answer said for exceptions, but may be impractical for maintaining/reading 20 or 100 exceptions. Is there a way for an additional line(s) to allow an exception

||$csp=worker-src 'none',domain=~exceptiondomain.com|~exceptiondomain2.com

TIA

FYI

Most helpful comment

Prevent workers everywhere:

*$csp=worker-src 'none'

Exception, do not prevent workers on example.org:

@@||example.org^$csp=worker-src 'none'

I didn't try it but I am pretty that should work.

Edit: fixed typo in second filter.

All 4 comments

Prevent workers everywhere:

*$csp=worker-src 'none'

Exception, do not prevent workers on example.org:

@@||example.org^$csp=worker-src 'none'

I didn't try it but I am pretty that should work.

Edit: fixed typo in second filter.

Thanks. The reddit OP said that's what he tried and it didn't work (i.e *$csp=worker-src 'none'; <- note he has a semi colon at the end which I have no idea if that was just in his post or his filter). I'll test it all out later on

OK, haven't tested it, but I will put my faith in everyone else :gulp: Added to the wiki. Hope I got the FF58+ and uM v1.2.0 info correct


  • Workers (requires FF58+)

    • If you have uMatrix 1.2.0+, there is a new switch: "Forbid web workers", use that instead.

    • Note: dom.workers.enabled was deprecated in FF60

    • Prevent workers everywhere (first line below)

    • Exception, do not prevent workers on example.org (second line below)

*$csp=worker-src 'none'
@@||example.org^$csp=worker-src 'none'

^^ I have tested this a few days ago and I am using it for the last few days and it works as it should.

Cheers

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TerkiKerel picture TerkiKerel  路  4Comments

Thorin-Oakenpants picture Thorin-Oakenpants  路  7Comments

ArchangeGabriel picture ArchangeGabriel  路  7Comments

crssi picture crssi  路  4Comments

Thorin-Oakenpants picture Thorin-Oakenpants  路  5Comments