Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox 68: local files now treated as cross-origin; is there a way to override?

Firefox 68 fixes a security problem with local files (https://www.mozilla.org/en-US/security/advisories/mfsa2019-21/#CVE-2019-11730), but in so doing breaks testing code locally. Is there a way to override this as can be done with Chrome and Opera (e.g., --allow-file-access-from-files)?

I cannot find anything relevant on the Firefox site, and cannot find a suitable command-line option or anything in about:config.

try {
    main = opener.document;
    }
    catch (e) {
    console.log(e);
    console.log(e.name);
    }
}

I get the following messages in the console:

DOMException: "Permission denied to access property "document" on cross-origin object"
SecurityError
like image 773
JeffC Avatar asked Jul 12 '19 02:07

JeffC


People also ask

How do I turn off cross origin policy in Firefox?

"In Firefox, the preference that disables CORS is content. cors. disable. Setting this to true disables CORS, so whenever that's the case, CORS requests will always fail with this error." developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/…

How do I fix CORS request not HTTP?

This often occurs if the URL specifies a local file, using the file:/// scheme. To fix this problem, make sure you use HTTPS URLs when issuing requests involving CORS, such as XMLHttpRequest , Fetch APIs, Web Fonts ( @font-face ), and WebGL textures, and XSL stylesheets.

How do I get to about config in Firefox?

Opening about:configType about:config in the address bar and press Enter. A warning page may appear. Click Accept the Risk and Continue to go to the about:config page. Click Show All to view all preferences currently set in the profile or use the Search preference name box to filter the list.


1 Answers

In my case: Firefox ver. 98.0.2 (64-bit) going to about:config and changing the flag helped: security.fileuri.strict_origin_policy = false

like image 179
user3611642 Avatar answered Sep 27 '22 22:09

user3611642