Description
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.
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