https://dashradio.com/
When accessing the site, the default radio station should start playing. When clicking "Play" on any of the radio stations, its music should start. None of this happens.
I narrowed the filter to /fingerprint2.min.js from EasyPrivacy.
A workaround would be to deactivate this filter entirely like this:
@@||dashradio.com/wp-content/themes/dash-2.1.4/library/js/libs/fingerprint2.min.js$script,first-party
but I don't want to load this tracker if possible.
I tried this
dashradio.com##script:inject(abort-on-property-write.js, Fingerprint2)
But it only changes the error message from
ReferenceError: Fingerprint2 is not defined
to
TypeError: Fingerprint2 is not a constructor
And still no music.
Is it possible to fake this js and how ?
I don't think there is a need for these
I also tried to get some help from EasyList/EasyPrivacy guys but their suggestion did not work either:
||dashradio.com^*/fingerprint2.$script,important,redirect=noopjs
I don't see how, with the filters uBO can use, even if I set Fingerprint2, by adding
dashradio.com##script:inject(set-constant.js, Fingerprint2, noopFunc)
I get
Uncaught TypeError: (intermediate value).get is not a function
at g (ajax.min.js:1)
at A (ajax.min.js:1)
at HTMLAnchorElement.<anonymous> (ajax.min.js:1)
at HTMLDocument.dispatch (jquery.js:3)
at HTMLDocument.r.handle (jquery.js:3)
if I click play, so allowing
@@||dashradio.com/*/library/js/libs/fingerprint2.min.js$script,first-party
seems to be the only way for uBO to unbreak the player.
I will add the filter, as the site is basically useless if the radio statons won't play any music ;).
Thanks for looking into it.
I tried another way: a userscript which injects the bare minimum for the site to work.
It just injects this in a script tag:
Fingerprint2 = function() { return Fingerprint2.prototype = {get:function(){}} }
And voil脿, no tracking and music can go on !
I can ask if we would add such a script to uBO-resources.
Indeed it works and is very bare minimum to restore the functionality, I quickly added a scriptlet like this -
# fingerprint-defuser
fp-defuser.js application/javascript
var Fingerprint2 = function() { return Fingerprint2.prototype = { get:function(){} } };
Given how much it fingerprints, it would definitely be preferable to avoid whitelisting.
With the new scriptlet, the following works on my side to unbreak the site while not allowing fingerprint script:
||dashradio.com^*/fingerprint2.min.js$script,redirect=fingerprint2.js,first-party
@gorhill What prevents from making it generic?
*/fingerprint2.js$script,important,redirect=fingerprint2.js
*/fingerprint2.min.js$script,important,redirect=fingerprint2.js
Thanks.
I added the minimal API to unbreak the case here. If wholly blocking fingerprint2.js does not cause breakage, than it's preferable to replacing it with a partial API which could cause more breakage.
Wait, what happened to the scriptlet? I thought redirect=fingerprint2.js was going to replace the whitelist.
uBlock-resources auto updates every 7 days.
https://github.com/gorhill/uBlock/blob/master/assets/assets.json#L20
To be sure that every user has redirect=fingerprint2.js, we have to wait a week before we can remove the exception and add the redirect filter.
In Firefox and uBO from AMO resources.txt updates only with extension.
Sorry, I forgot about that, I tested with the dev version.
Most helpful comment
Thanks for looking into it.
I tried another way: a userscript which injects the bare minimum for the site to work.
It just injects this in a script tag:
Fingerprint2 = function() { return Fingerprint2.prototype = {get:function(){}} }And voil脿, no tracking and music can go on !