-
-
Notifications
You must be signed in to change notification settings - Fork 558
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
1119 Privacy - Query Page and Dom.storage #2026
Conversation
5f9b64b
to
99c7182
Compare
handle localStorage being null Signed-off-by: Chris Miceli <chrismiceli@outlook.com>
localStorage.setItem("barchart_chkbox", true); | ||
if (localStorage) { | ||
localStorage.setItem("barchart_chkbox", true); | ||
} | ||
} | ||
|
||
bargraphs.click(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that I left the click functions for settings a storage object unguarded so there is a console error message to indicate the saving failed. I guarded initialization routines that set storage to prevent further code running during initialization from getting blocked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's about L233 inutils.js
?
function stateSaveCallback(itemName, data) {
localStorage.setItem(itemName, JSON.stringify(data));
}
I tried your PR locally and I wasn't able to display the query log in FF with dom.stroage=disabled. I got errors about stateSaveCallback
I intentionally left the modification methods untouched so that the user could see an error in the console about why their settings are not being persisted in storage. I could log a more specific message in those cases. Let me see why query log isn't loading. |
implement memory storage for functionality in case of no storage Signed-off-by: Chris Miceli <chrismiceli@outlook.com>
I pushed a commit @yubiuser to address the query log not loading. I now use a memory storage mechanism which won't survive page loads but enables callbacks to trigger correctly. |
be explicit for undefined Signed-off-by: Chris Miceli <chrismiceli@outlook.com>
fix else Signed-off-by: Chris Miceli <chrismiceli@outlook.com>
It happens to anyone. No need to rush. |
Confirm query log is working now. |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-ftl-v5-14-web-v5-11-and-core-v5-9-released/53529/1 |
handle localStorage being null
Signed-off-by: Chris Miceli chrismiceli@outlook.com
By submitting this pull request, I confirm the following:
{please fill any appropriate checkboxes, e.g: [X]}
{Please ensure that your pull request is for the 'devel' branch!}
git rebase
)git commit --signoff
)What does this PR aim to accomplish?:
Addresses #1119
How does this PR accomplish the above?:
This PR defaults all storage access to as if the item wasn't present to allow execution of scripts to continue. Note that I left some cases where a user interacts with a setting so that there is an indication the preference/setting wasn't persisted.
What documentation changes (if any) are needed to support this PR?:
None, unless we want to officially document when storage is disabled.