Closed Thomasc5 closed 3 years ago
I cannot confirm this. It works for me. Please test this again.
One more question: In your screenshot it looks like you're not clearing the offline website data, but the title of this issue suggests you're clearing the data. Of course, when you're clearing offline website data it won't keep your settings because you're clearing them! So my advice would be: If you want to keep your settings then don't clear them.
This is how I reproduce the problem:
Change some default settings:
Enable Zhongwen and it works as expected:
Disable Zhongwen. Clear everything out in the browser before closing it.
Wait a few seconds. Launch browser. Go to the same page and enable Zhongwen. The settings would return to default:
p.s. If the above problem can't be reproduced, try clear the browser and relaunch it a few more times. p.p.s. I had tried the following test cases: 1. clear everything except cookies; 2 clear everything except offline website data. None of these seems to help keeping the Zhongweng's settings. p.p.p.s. Just tested the unofficial fork on the same PC (Firefox 72.0.2 on Win 7), it doesn't have this problem.
Thank you so much.
It looks like you are clearing your offline website data. This will clear your Zhongwen settings as well. So it works as expected.
I know nothing about programming. But shouldn't an extension settings be saved somewhere else that they won't get reset when users clear their browsing history?
e.g. "Although this API is similar to Window.localStorage it is recommended that you don't use Window.localStorage in extension code. Firefox will clear data stored by extensions using the localStorage API in various scenarios where users clear their browsing history and data for privacy reasons, while data saved using the storage.local API will be correctly persisted in these scenarios."
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/local
The problem is, Zhongwen for Chrome - which shares the same codebase with Zhongwen for Firefox -has been using the localStorage API for many years. At the time it was written, the storage.local API didn't even exist. If I were to change it now, then tens of thousands of users would lose their settings. If I were to start all over again, I would use the storage.local API, but making such a critical change that will affect such a large number of users in my opinion is not worth the trouble. I don't know how often you clear your offline website data, probably not on a daily basis. Even so, if the only problem for you is having to change the font size afterwards then I would hope this is acceptable to you.
The problem is even if I just clear the "cookies" (i.e. leave the offline website data untouched), the settings would still be reset to default.
Anyway, I understand the dilemma. I'll try figure out how to hardcode the large font size as the default.
Thank you
The problem is even if I just clear the "cookies" (i.e. leave the offline website data untouched), the settings would still be reset to default.
Anyway, I understand the dilemma. I'll try figure out how to hardcode the large font size as the default.
Thank you
If you're still having problem then I suggest checking out Stylus extension (Extension to modify any CSS on the fly). I do not know if user config is persistent after clearing offline website data though. Here's the CSS to increase Zhongwen Lookup Dict size btw
/* Chinese Lookup Dict - Zhongwen */
#zhongwen-window .w-hanzi-small,
#zhongwen-window .w-pinyin-small {
font-size: 40px !important;
}
#zhongwen-window .w-def-small {
font-size: 34px !important;
}
I tested it again with FF 84.0.1. Even when clearing everything (cookies, site preferences and offline website data), after a browser restart all my Zhongwen specific settings are retained.
I'm closing this since I cannot reproduce the problem.
To reproduce:
p.s. The unofficial fork of zhongwen doesn't have this problem.
Thank you