Could you clarify what issue you're reporting here, and ideally post a testcase that demonstrates the issue? Or alternately, the following might explain what you're seeing here, if I'm understanding things correctly. I think I may have reconstructed what you're describing locally, but I'm not sure. My setup: two local web servers (using `python3 -m http.server [port]`), one hosting some HTML, one hosting a font. The first one references a webfont hosted on the other one. (I used the webfont that you linked in bug 1872503 comment 1.) The font does indeed fail to get used (in Firefox as well as in Chrome), and Firefox DevTools shows me this error/explanation: > Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8999/NotoSansMono-Regular.ttf. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200. > > downloadable font: download failed (font-family: "NotoSansMono-Regular" style:normal weight:400 stretch:100 src index:0): bad URI or cross-site access not allowed > source: http://localhost:8999/NotoSansMono-Regular.ttf ``` The note about `Access-Control-Allow-Origin` is a hint. Cross-site font loads are not allowed by default on the web unless allowed via CORS and the `Access-Control-Allow-Origin` header in particular. Images don't have this restriction, for historical reasons (too much of the legacy web would break if this restriction were added). I think that explains your mention in comment 0 here of 'image loading via "url" works', where I think you're observing that font load is rejected but the image load is allowed. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#what_requests_use_cors for some documentation on this.
Bug 1872569 Comment 5 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Could you clarify what issue you're reporting here, and ideally post a testcase that demonstrates the issue? Or alternately, the following might explain what you're seeing here, if I'm understanding things correctly. I think I may have reconstructed what you're describing locally, but I'm not sure. My setup: two local web servers (using `python3 -m http.server [port]`), one hosting some HTML, one hosting a font. The first one references a webfont hosted on the other one. (I used the webfont that you linked in bug 1872503 comment 1.) The font does indeed fail to get used (in Firefox as well as in Chrome), and Firefox DevTools shows me this error/explanation: > Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8999/NotoSansMono-Regular.ttf. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200. > > downloadable font: download failed (font-family: "NotoSansMono-Regular" style:normal weight:400 stretch:100 src index:0): bad URI or cross-site access not allowed > source: http://localhost:8999/NotoSansMono-Regular.ttf The note about `Access-Control-Allow-Origin` is a hint. Cross-site font loads are not allowed by default on the web unless allowed via CORS and the `Access-Control-Allow-Origin` header in particular. Images don't have this restriction, for historical reasons (too much of the legacy web would break if this restriction were added). I think that explains your mention in comment 0 here of 'image loading via "url" works', where I think you're observing that font load is rejected but the image load is allowed. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#what_requests_use_cors for some documentation on this.