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

wrong timezone used when showing the notifications (and some related notification issues) #19

Closed
R-Adrian opened this issue Oct 7, 2021 · 2 comments
Labels

Comments

@R-Adrian
Copy link

R-Adrian commented Oct 7, 2021

i decided to enable the notifications from this addon to see when it would clear old history... big mistake, so i disabled notifications again because of these:

(1) after the first cleanup of the day, the notifications that keep appearing every few minutes are mentioning the same 'before date' with the time as 00:00:00... what's the point of doing the same thing over and over?
I'd understand this if the addon would also use the current time (hh:mm:ss) when calculating the reference timestamp to delete before of, but since it's ignoring the time and just rounding up to days why show the notification if it didn't clean anything?

(2) as a result of the issue above, i'm getting a TON of cleanup notifications when simply reading random articles online... maybe the default "idle length" is not long enough when the notifications option is enabled?

and (3) - the notifications that show up say that the cleanup action happened at a time that differs by a few hours from the current local time. Looks to me that the time reported in the notification is the UTC time instead of the local time.

@Rayquaza01
Copy link
Owner

The notifications are mainly there for debugging purposes (also in an attempt to see if I can reproduce #5.) Because clearing history is done silently in the background, it's hard to tell exactly when (or if) it's working. The notifications make it much more obvious when the extension triggers. The notifications are disabled by default and require an optional permission because they are very intrusive for normal use.

The notification triggers every time it attempts to clear history, regardless of if anything was cleared. The extension can't tell if it cleared anything or how much it cleared because history.deleteRange() does not provide this information. It simply requests that the browser delete history, but gives no feedback on what was deleted.

The date shouldn't be displayed in UTC unless your device has UTC as local time. In deleteHistory(), the time is set using the local methods (e.g. Date.setHours() instead of Date.setUTCHours()) and the date string in the notification is made with Date.toLocaleString(), so the date in the notification should display in your locale.

@R-Adrian
Copy link
Author

R-Adrian commented Oct 8, 2021

image

even though the timezone of my system is correctly set, Firefox Date.setHours() seems to report the timezone as UTC ... hmmmm...

i looked further into why is this happening ... and it seems to be caused by the browser preference privacy.resistFingerprinting being set to true. For testing, i set it to false and tried running that testing script again and this time it produced the expected result with timezone.

https://wiki.mozilla.org/Security/Fingerprinting
and here it says Timezone is spoofed to 'UTC'

Since timezone info can be used for fingerprinting a browser/user i can see now why it returns UTC as timezone when the resistFingerprinting preference is set, so i'll close this ticket - getting UTC time is expected behaviour in this mode.

@R-Adrian R-Adrian closed this as completed Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants