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

timezone spoof for date.parse throws NaN #583

Open
Thorin-Oakenpants opened this issue Jun 1, 2024 · 4 comments
Open

timezone spoof for date.parse throws NaN #583

Thorin-Oakenpants opened this issue Jun 1, 2024 · 4 comments

Comments

@Thorin-Oakenpants
Copy link

STR

example

https://github.com/arkenfox/TZP/blob/43c20737b4aeeeef4f2b119c89087a2223c7485e/js/region.js#L873-L901

@sereneblue
Copy link
Owner

Thanks for reporting @Thorin-Oakenpants.

It seems this is caused when a date pre-modern timezones is used. I have to do some further review to see what's the best way to handle those dates.

@Thorin-Oakenpants
Copy link
Author

Thorin-Oakenpants commented Jun 9, 2024

there's a lot more going on - e.g. even when not specifying spoof language, you modify the resolved locale for Intl.DateTimeFormat to en-US - at odds with all the rest (if you are not en-US of course)

IANAE on your code or webextensions, but you can simply pass undefined as the locale and timezone as the timeZone - for all the Intl and for toLocaleString and toLocaleDateString

edit: and when spoofing as e.g. Russian, nothing changes with navigator.language(s) to match, and locales are left alone: I'm not sure what your strategy is here, it's all so paradoxical :)

@khodedawsh
Copy link

I've noticed some problems with timezone, it causes problems with some websites, i can guess it's the same issue as the one mentioned here.

@Thorin-Oakenpants
Copy link
Author

Thorin-Oakenpants commented Feb 16, 2025

Image

  • timezone mismatches in Temporal so we get mixed
    • I'm spoofing as America/Winnipeg and my OS timezone is Pacific/Auckland
  • timezone offset (it's getting your current offset using lastModified strings and some dates)
    • my real time is 2025-02-16 16-10-48
    • date is "tampered" with showing winnipeg time correct at 2025-02-15 21-10-48
    • control date is "tampered" with and IDK what on earth that is supposed to represent
      • if not tampered with it shows winnipeg time
    • the rest all show auckland time
    • EXSLT time offset is taken as the real value when we have mixed results
  • timezone offsets (this is a history of offsets)
    • date.parse throws an error, as already mentioned
    • getTimezoneOffet is tampered with
    • the rest are not, which creates a mixed result

issues man ... you have issues :) anyway .. just thought I would alert to Temporal and all that is coming your way 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants