firefoxcorssame-origin-policy

How to enable CORS on Firefox


How can I allow CORS on Firefox?

I easily managed it on Chrome and Internet Explorer, but I am totally failing at it with Firefox. I edited the following about:config entry

security.fileuri.strict_origin_policy = false

This attempt has been posted several times here and is told on other sites too, but it doesn't have any effect. I read the Mozilla guide to same-origin policies:

Cross-Origin Resource Sharing (CORS)

but it just explains CORS and the related topics. A workaround to enable it on Firefox is not listed.

Is there a definitive solution?

PS: FORCECORS does not work either somehow...


Solution

  • Do nothing to the browser. CORS is supported by default on all modern browsers (and since Firefox 3.5).

    The server being accessed by JavaScript has to give the site hosting the HTML document in which the JS is running permission via CORS HTTP response headers.


    security.fileuri.strict_origin_policy is used to give JS in local HTML documents access to your entire hard disk. Don't set it to false as it makes you vulnerable to attacks from downloaded HTML documents (including email attachments).