Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Is there a way to disable javascript in local file:// for firefox? #589

Closed
vzjrz opened this issue Jul 14, 2016 · 12 comments
Closed

Is there a way to disable javascript in local file:// for firefox? #589

vzjrz opened this issue Jul 14, 2016 · 12 comments

Comments

@vzjrz
Copy link

vzjrz commented Jul 14, 2016

Just noticed that javascript runs on local html files. My rules:

matrix-off: about-scheme true
matrix-off: behind-the-scene true
matrix-off: chrome-extension-scheme true
matrix-off: chrome-scheme true
matrix-off: localhost true
matrix-off: opera-scheme true
* * * block
* * cookie block
* * frame block
* * plugin block
* 1st-party css allow
* 1st-party image allow

Noscript does seem disable local js.

@Snapy
Copy link

Snapy commented Jul 19, 2016

Remove matrix-off: localhost true.

@vzjrz
Copy link
Author

vzjrz commented Jul 19, 2016

@Snapy I tried removing that rule but it still runs js. I even removed everything except * * * block and still nothing.

@ghost
Copy link

ghost commented Jul 24, 2016

Why you just dont try modify the javascript.enable=false preference inside the about:config ?

@vzjrz
Copy link
Author

vzjrz commented Jul 25, 2016

@debiangirl Yeah that would disable javascript everywhere but it wouldn't allow me to quickly control it on a case by case basis like I do with umatrix.

@Thorin-Oakenpants
Copy link

Thorin-Oakenpants commented Jul 26, 2016

What does file-scheme file-scheme script block do?

@gorhill
Copy link
Owner

gorhill commented Jul 26, 2016

uMatrix/uBO inject a content security policy ("CSP") directive in response headers to prevent inline script tags from executing. I verified that with Chromium/Firefox, their respective handler for response headers is not invoked -- hence no CSP can be injected.

@Atavic
Copy link

Atavic commented Dec 9, 2017

@vzjrz addons like maone's no script can block/unblock JS with an icon.

@gorhill
Copy link
Owner

gorhill commented Dec 9, 2017

@Atavic: that does not work with NoScript 10, which is webext-based like uMatrix.

@Atavic
Copy link

Atavic commented Dec 9, 2017

Ajjj... Right. What about policy-control

AMO

@Thorin-Oakenpants
Copy link

Thorin-Oakenpants commented Dec 10, 2017

@gorhill : quick question (semi related i think, please don't shoot me). See ghacks-user.js issue, Bugzilla 1368682 etc. No one is sure yet if this is a problem in web content, but it certainly can be done manually eg entering C:\$MFT\foo - anyway to block this in uM or uBo?

Edit: https://www.bleepingcomputer.com/news/microsoft/filesystem-bug-hangs-or-crashes-windows-7-and-windows-8-1/
^^ probably explains it nicely. No one is sure if this bit "or the path is secretly loaded in the background of a web page, as an image's source URL" can be accomplished, see bugzilla, ghacks issue comments

@gorhill
Copy link
Owner

gorhill commented Dec 11, 2017

anyway to block this in uM or uBo?

This would need to be tried -- see what the logger reports. If the logger reports the URL, then it should be blockable. I don't have Windows, so I can't try.

@gorhill
Copy link
Owner

gorhill commented Sep 16, 2018

The new NoScript succeeds in blocking JS from file: URL. I looked into it and it does so by injecting the CSP directive through a <meta http-equiv...> in the DOM at document_start time -- clever.

I will bring this technique to uMatrix. Note that this would still not solve the case for Chromium, this is possible in Firefox because it supports registering content scripts dynamically.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants