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
feat(api): add page.emulateTimezone(timezoneId) #4949
Conversation
683bcd2
to
56c6743
Compare
56c6743
to
a8c9eea
Compare
a8c9eea
to
d62aea8
Compare
This enables dynamically changing the timezone of the page.
d62aea8
to
6072b66
Compare
@mathiasbynens I'm curious to know what's needed or if this will make it into puppeteer? thx! |
@crobinson42 It's currently blocked on a Chromium roll. You can track the progress of that here: #5058 It sounds like you have a use case for this feature? Please let us know what you plan on doing with it :) |
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.
Thanks!
try { | ||
await this._client.send('Emulation.setTimezoneOverride', {timezoneId: timezoneId || ''}); | ||
} catch (exception) { | ||
if (exception.message.includes('Invalid timezone')) |
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.
nit: Braces for multi-line if.
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.
The current puppeteer code style doesn't allow braces around single-line if
bodies.
Co-Authored-By: Simon <simon.zuend@gmail.com>
CLAs look good, thanks! |
This enables dynamically changing the timezone of the page.
This enables dynamically changing the timezone of the page.
Blocked on a Chromium roll to v79.0.3923.0 (r699550) or later, though.