[FIXED] NoScript breaks Service Workers

Ask for help about NoScript, no registration needed to post
User avatar
ZeroUnderscoreOu
Posts: 12
Joined: Sat Aug 26, 2017 1:19 am
Contact:

[FIXED] NoScript breaks Service Workers

Post by ZeroUnderscoreOu »

I'm using web version of Spotify and most images (e.g. album covers) are not loading for me. In console, requests for images fail with NS_ERROR_INTERCEPTION_FAILED. If I open images in a new tab, they load normally. If I disable NoScript or disable restrictions for the tab, images load normally and stay after I re-enable NoScript or tab restrictions. Choosing to set everything to temporary trusted has no effect.

Firefox 98 x64 on Windows, NoScript 11.3.7.
0_o
Mozilla/5.0 (X11; Linux i686; rv:100.0) Gecko/20100101 Firefox/100.0
User avatar
Giorgio Maone
Site Admin
Posts: 9455
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript breaks Service Workers

Post by Giorgio Maone »

I cannot reproduce.
Could you please share your NoScript Options>Export file?
Thanks!
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0
barbaz
Senior Member
Posts: 10851
Joined: Sat Aug 03, 2013 5:45 pm

Re: NoScript breaks Service Workers

Post by barbaz »

I can't reproduce it either. I tested only with ServiceWorkers enabled, the site doesn't work for me either, but not in the way described - images load fine for me without disabling NoScript.
*Always* check the changelogs BEFORE updating that important software!
-
User avatar
ZeroUnderscoreOu
Posts: 12
Joined: Sat Aug 26, 2017 1:19 am
Contact:

Re: NoScript breaks Service Workers

Post by ZeroUnderscoreOu »

Giorgio Maone wrote: Mon Mar 14, 2022 10:38 pm I cannot reproduce.
Could you please share your NoScript Options>Export file?
Thanks!
Sent it in DM (I hope you don't mind, I'd rather not post it publicly).
0_o
Mozilla/5.0 (X11; Linux i686; rv:100.0) Gecko/20100101 Firefox/100.0
User avatar
Giorgio Maone
Site Admin
Posts: 9455
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript breaks Service Workers

Post by Giorgio Maone »

ZeroUnderscoreOu wrote: Mon Mar 14, 2022 10:46 pm Sent it in DM (I hope you don't mind, I'd rather not post it publicly).
Thank you, that's been very helpful.
This was a combination of unusual settings and a shortcoming of capability need reporting which went unnoticed so far and I've just fixed in latest development build:
v 11.4rc3
============================================================
x Include ServiceWorker-initiated fetch requests in UI
reporting (thanks 0_o for report)

x Remove redundant style patching

Fetch requests initiated by service workers (such as those used by Spotify to cache album covers locally) were not reported in the UI: it's something quite tricky, because service workers have no associated tab, hence NoScript would need to keep track of all the tab containing documents which may be using the service worker and report back to all of them.

Therefore you could not notice that scdn.com (set to DEFAULT because you use the full address UI listing and surgically enabled only https://open.scdn.co) was the destination of fetch requests to retrieve images, which were blocked because you unchecked the "fetch" capability from the DEFAULT preset.

In other words, this would have not happened if you kept one of those two default settings you changed: either the "fetch" capability enabled in the DEFAULT preset (which would have made the image requests work transparently) or the domain-scoped UI listing (which would have made you
set the whole ...scdn.com to TRUSTED and enable fetch that way).

The good news is that I've fixed the reporting issue in 11.4rc3, therefore when the serviceWorker first attempts to load the covers (but not later, because then they're permanently cached) you should see a "...scdn.com" line in the popup, set to the DEFAULT preset. Then if you switch to the CUSTOM preset you should see that the "fetch" capability is required, and you can even surgically enable just that capability and only when it is in the context of spotify.com. Or otherwise do like most users: set ...scdn.com to TRUSTED and forget about it ;)
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0
User avatar
ZeroUnderscoreOu
Posts: 12
Joined: Sat Aug 26, 2017 1:19 am
Contact:

Re: NoScript breaks Service Workers

Post by ZeroUnderscoreOu »

Thank you very much for a quick fix and extensive explanation! I just tried the development build and everything works well.
As you can see by my unusual settings, I'm the "target audience" of NoScript and I appreciate all the work you put into its development.
0_o
Mozilla/5.0 (X11; Linux i686; rv:100.0) Gecko/20100101 Firefox/100.0
Post Reply