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

feat(api): add page.emulateTimezone(timezoneId) #4949

Merged
merged 4 commits into from Oct 23, 2019
Merged

Conversation

mathiasbynens
Copy link
Member

@mathiasbynens mathiasbynens commented Sep 17, 2019

This enables dynamically changing the timezone of the page.

Blocked on a Chromium roll to v79.0.3923.0 (r699550) or later, though.

docs/api.md Outdated Show resolved Hide resolved
test/emulation.spec.js Show resolved Hide resolved
This enables dynamically changing the timezone of the page.
@crobinson42
Copy link

@mathiasbynens I'm curious to know what's needed or if this will make it into puppeteer? thx!

@mathiasbynens
Copy link
Member Author

@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 :)

Copy link
Collaborator

@szuend szuend left a 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'))
Copy link
Collaborator

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.

Copy link
Member Author

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.

test/emulation.spec.js Outdated Show resolved Hide resolved
@puppeteer puppeteer deleted a comment from googlebot Oct 23, 2019
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

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

Successfully merging this pull request may close these issues.

None yet

5 participants