From the MDN :
When a user opened a page using a
file:///
URI in Firefox 67 and earlier, the origin of the page was defined as the directory from which the page was opened. Resources in the same directory and its subdirectories were treated as having the same origin for purposes of the CORS same-origin rule.In response to CVE-2019-11730, Firefox 68 and later define the origin of a page opened using a
file:///
URI as unique. Therefore, other resources in the same directory or its subdirectories no longer satisfy the CORS same-origin rule. This new behavior is enabled by default using theprivacy.file_unique_origin
preference.
Also :
CORS requests may only use the HTTPS URL scheme, but the URL specified by the request is of a different type. This often occurs if the URL specifies a local file, using a
file:///
URL.To fix this problem, simply 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.
The suggestion to "simply make sure you use HTTPS URLs" when using @font-face
is fine and all for files that are on a server, but what about HTML files that are supposed to be run locally?
For example, some of the HTML files I work on are used as documentation for Java products. These products are shipped to our customers and our customers are expected to open these HTML files on their laptops and desktops (without running a web server) if they want to learn how to use our products.
The only way I can think of to keep using our Web Fonts (which includes some icon fonts) is to embed the fonts in my CSS files instead of linking them externally.
Are there other options I'm overlooking?