NoScript blocks scripts on local page even after temporary allowing them

Ask for help about NoScript, no registration needed to post
3plus4i
Posts: 1
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: 10849
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
Post Reply