-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fonts do not load in firefox when docs are accesed from a file url #5706
Comments
Oh dear! cc @rust-lang/docs, y'all may be interested in this issue |
I filed this in the Rust repo a while back: rust-lang/rust#34681 |
I believe this is no longer an issue as of firefox 68.0.2. Can anyone confirm if it is still a problem or should this be closed? |
This seems to work fine now in Firefox 69. |
For reference it looks like this behavior was changed in Firefox in https://bugzilla.mozilla.org/show_bug.cgi?id=1565942, which landed in Firefox 69 and was backported to 68.0.2. |
When using
cargo doc --open
, the docs are generated and placed intarget/doc
and the urlfile:///path/to/project/target/doc/cratename/index.html
is opened in the default browser.Due to CORS restrictions, Firefox does not allow pages from file urls to access fonts further up in the directory tree, so the fonts in
target/docs
are not loaded.The docs then look like this:
I found some an archived artivel on MDN describing the policy: https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs. When setting the key
security.fileuri.strict_origin_policy
to false, the fonts get loaded as expected.A solution would have to change the directory structure of the output, or move the index.html one level up. I am not sure how documentation of workspaces is handled.
Debug info:
cargo 1.29.0-nightly (af9e40c 2018-07-05)
Firefox 61.0.1
The text was updated successfully, but these errors were encountered: