NoScript blocks scripts on local page even after temporary allowing them

Ask for help about NoScript, no registration needed to post
3plus4i
Posts: 2
Joined: Sun May 05, 2024 3:39 pm

NoScript blocks scripts on local page even after temporary allowing them

Post by 3plus4i »

I have a locally stored HTML page as a frontend for some js, that I created a few weeks ago. It worked fine in the beginning, but since several days ago, it occasionally refuses to execute the js, even if I temporary allow for local files. I'm getting Content-Security-Policy errors for the inline js then, because they violate the policy "script-src-attr 'none'". It doesn't load the js from file either though, nor the css, throwing a processing error "DOMException: CSSStyleSheet.cssRules getter: Not allowed to access cross-origin stylesheet". Firefox 125.0.3 on Xubuntu.

The weird thing is that it works totally fine on some days and not at all on others. I can also confirm that it is related to NoScrip, because it works as soon as I deactivate NoScrip entirely, in the Firefox addon settings.

I have no idea if it's related to the files being loaded from my harddrive, I never experienced this issue anywhere else. It works fine on jsfiddle.net, where I originally got it from, to have a copy available offline. I only did minor formatting changes and had to write the header. Here are the files: https://drive.google.com/drive/folders/ ... sp=sharing
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0
barbaz
Senior Member
Posts: 10860
Joined: Sat Aug 03, 2013 5:45 pm

Re: NoScript blocks scripts on local page even after temporary allowing them

Post by barbaz »

I'm using Firefox 125.0.2 on Xubuntu and I'm unable to reproduce this. Not sure what to look for in the page's JS working, but I'm not seeing the CSP errors when scripts are allowed for the page, and its CSS is loading correctly.

What NoScript version are you using?
Do you have some other extension that maybe sometimes blocking NoScript's internal messaging system? If you're using uBlock Origin you need these rules in uBlock Origin Dashboard > My Rules for NoScript to work correctly -

Code: Select all

no-csp-reports: noscript-csp.invalid false
* https://noscript-csp.invalid/ csp_report allow
behind-the-scene https://[ff00::]/nscl/ xmlhttprequest allow
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0
3plus4i
Posts: 2
Joined: Sun May 05, 2024 3:39 pm

Re: NoScript blocks scripts on local page even after temporary allowing them

Post by 3plus4i »

I've tried several variants over the past weeks, all have failed at least once, but most of the time it's working. for the past days I've loaded a different local page first, one where allowing scripts never failed, allow file: there and then load the troublesome file. It hasn't failed in over a week. That makes it very hard to debug, if even I can't reproduce it reliably. The only way that used to fail quite reliably was trying to allow scrips on the troublesome file directly.

I'm using v 11.4.29
barbaz wrote: Sun May 05, 2024 6:12 pm Do you have some other extension that maybe sometimes blocking NoScript's internal messaging system?
Seems unlikely. The only other extensions I have running are Greasemonkey, AdBlocker for YouTube, Return YouTube Dislike, Cookie Quick Manager and the Cookie Clicker Mod Manager. All of them have been installed since at least a year ago.

I've carried this Firefox profile around for well over a decade, could that play a role?
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0
Post Reply