Skip to content
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

Closed
jendrikw opened this issue Jul 10, 2018 · 6 comments
Closed

Fonts do not load in firefox when docs are accesed from a file url #5706

jendrikw opened this issue Jul 10, 2018 · 6 comments

Comments

@jendrikw
Copy link

When using cargo doc --open, the docs are generated and placed in target/doc and the url file:///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:
image

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

@alexcrichton
Copy link
Member

Oh dear! cc @rust-lang/docs, y'all may be interested in this issue

@luser
Copy link
Contributor

luser commented Jul 12, 2018

I filed this in the Rust repo a while back: rust-lang/rust#34681

@ehuss
Copy link
Contributor

ehuss commented Sep 17, 2019

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?

@luser
Copy link
Contributor

luser commented Sep 17, 2019

This seems to work fine now in Firefox 69.

@luser
Copy link
Contributor

luser commented Sep 17, 2019

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.

@ehuss
Copy link
Contributor

ehuss commented Sep 17, 2019

Thanks @luser.

I'll close this for now. If there are any other problems, please file a new issue or comment on #4966 which would be the solution for most of these kinds of problems.

@ehuss ehuss closed this as completed Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants