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

Open Doc local doesn't keep dark theme when switching page. #8208

Closed
Stargateur opened this issue May 5, 2020 · 6 comments
Closed

Open Doc local doesn't keep dark theme when switching page. #8208

Stargateur opened this issue May 5, 2020 · 6 comments
Labels
C-bug Category: bug

Comments

@Stargateur
Copy link

When doc is open on local the dark theme is not set for all local page just for the module you are on.

@Stargateur Stargateur added the C-bug Category: bug label May 5, 2020
@ehuss
Copy link
Contributor

ehuss commented May 6, 2020

This is likely due to same-origin restrictions for file URLs with localStorage. You may want to check the settings of your browser, or try a different browser.

@Stargateur
Copy link
Author

Stargateur commented May 6, 2020

I can check the setting if you tell me what to do... My use case is for firefox, edge is worse doesn't even remember my choice if I refresh the page, chrome handle it correctly. This look more like a cargo problem than a browser config problem. I don't see why I should need to config firefox to someone else than the default.

https://bugzilla.mozilla.org/show_bug.cgi?id=507361 suggest a bug that have been fixed without any configuration needed.

@ehuss
Copy link
Contributor

ehuss commented May 6, 2020

I think with firefox you have to set security.fileuri.strict_origin_policy to false for it to work. Note that I don't necessarily recommend doing that, since it is on by default for a reason, so evaluate your security needs as necessary.

I think the only solution is for Cargo to have a webserver, and to stop using file: URLs. This is tracked in #4966.

You can also run your own server. If you have python installed, it is pretty easy to do with python -m http.server in the target/doc directory.

@Stargateur
Copy link
Author

Stargateur commented May 6, 2020

already set to true, it's the default, unless I missing something this option is not related to localstorage.

Nevermind false work but why true doesn't work ?

Local documents have access to other local documents in the same directory and in subdirectories, but not directory listings. (Default)

http://kb.mozillazine.org/Security.fileuri.strict_origin_policy

@ehuss
Copy link
Contributor

ehuss commented May 6, 2020

I don't really know, it's possible the docs haven't been updated. Same-origin for "file" changed a little over a year ago (https://www.mozilla.org/en-US/security/advisories/mfsa2019-21/#CVE-2019-11730), and they've been tweaking it since then (like adding font support).

Regardless, I don't think things are going to universally work without a local web server.

@ehuss
Copy link
Contributor

ehuss commented May 23, 2020

Closing in favor of #4966.

@ehuss ehuss closed this as completed May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants