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

Can Kiwix remember user settings of Dark theme? #612

Closed
alextooter opened this issue Apr 4, 2020 · 12 comments · Fixed by #613
Closed

Can Kiwix remember user settings of Dark theme? #612

alextooter opened this issue Apr 4, 2020 · 12 comments · Fixed by #613
Assignees
Labels

Comments

@alextooter
Copy link

I like the Dark theme in v2.7,it's beautiful.After I close Kiwix page,then reopen it,Kiwix not remember my choose of Dark theme.

Can we store this option in somewhere,don't let me choose everytime?

@Jaifroid
Copy link
Member

Jaifroid commented Apr 4, 2020

Hi @alextooter, it should be able to. Which platform are you using, so I can troubleshoot?

@Jaifroid Jaifroid self-assigned this Apr 4, 2020
@Jaifroid Jaifroid added the bug label Apr 4, 2020
@alextooter
Copy link
Author

alextooter commented Apr 4, 2020

Hi @alextooter, it should be able to. Which platform are you using, so I can trobuleshoot?

I am using macOS 10.15.4,Firefox 74.0.1,kiwix 2.7.0
My way of using kiwix:click the icon on toolbar,kiwix open with light theme,then I choose Dark+invert(wikimedia*),it turn to dark theme.Close this tab,open it,using Light theme again.

@Jaifroid
Copy link
Member

Jaifroid commented Apr 4, 2020

OK, thanks, @alextooter . I presume that's in the Firefox extension?

@Jaifroid
Copy link
Member

Jaifroid commented Apr 4, 2020

@alextooter I reproduce the bug in Firefox Extension on Windows 10. However, it is not just with this feature, it is with any feature that stores its settings in a cookie. Something must have been deprecated. Very sorry not to have picked this up in testing.

@mossroy can you reproduce? In the Firefox extension, try changing any setting in Config that should persist between tab sessions, and they are lost the next time the Kiwix JS tab is opened.

@Jaifroid
Copy link
Member

Jaifroid commented Apr 4, 2020

Proof that cookies are disabled in Firefox browser extension:

In the extension tab devtools type document.cookie="username=John Doe" and then document.cookie Result:

image

In a normal tab opening file:///.../kiwix-js/www/index.html:

image

@Jaifroid
Copy link
Member

Jaifroid commented Apr 4, 2020

Looking at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_the_Cookies_API, I see we should have a permissions entry in our manifest.json to use the Cookies API in Firefox Extensions:

image

We don't have this.

@mossroy
Copy link
Contributor

mossroy commented Apr 4, 2020

I reproduce this issue with Firefox 74 (on Ubuntu), not on Chromium 80. I also reproduce on Firefox 68.6 ESR (on Windows 8.1).
So this seems to be Firefox-specific.
Adding

"permissions": [
    "tabs",
    "cookies",
    "<all_urls>"
],

in manifest.json does not help : it seems to be a permission to access cookies from other tabs/websites

@Jaifroid
Copy link
Member

Jaifroid commented Apr 4, 2020

I suggest a possible solution to this in #613 .

@mossroy
Copy link
Contributor

mossroy commented Apr 4, 2020

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1418961#c6 , it seems to be the expected behavior in Firefox extensions :

Cookies are only supported in HTTP documents

So we'll have to find another way to store the user preferences. I'll have a look at #613

@Jaifroid
Copy link
Member

Jaifroid commented Apr 4, 2020

OK. It seems this is since 55/56! I guess our users generally didn't change the defaults, then!

@mossroy
Copy link
Contributor

mossroy commented Apr 4, 2020

It's not that surprising : in Firefox extension, you can not use SW mode, so this setting can not be changed. And the theme and cache settings are recent. So the only setting that could be affected since a long time is the "Permanently hide active content warning"

@Jaifroid Jaifroid linked a pull request Apr 6, 2020 that will close this issue
@Jaifroid
Copy link
Member

@alextooter We are about to merge into master a fix for this issue that works in development testing on Firefox extension and that we very much hope will work in production. Please note that you will have to wait for a new release, which may take some time as we usually accumulate a number of features before making a new release.

Jaifroid added a commit that referenced this issue Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants