There are ways to configure the timezone with the TZ environment variable, but having a generic API for this in the Page agent would be nice to have as well. It would also allow fine-grained control over multiple pages, for instance it's not possible currently to have two pages in different timezones. For automation and testing purposes this is a limitation currently.
Created attachment 402460 [details] Patch
This patch modifies the inspector protocol. Please ensure that any frontend changes appropriately use feature checks for new protocol features.
Created attachment 402462 [details] Patch
Created attachment 402482 [details] Patch
Comment on attachment 402482 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402482&action=review > Source/WebCore/inspector/agents/InspectorPageAgent.h:119 > + void setTimeZone(ErrorString&, const String*) override; This is failing to compile in Windows, saying it’s not overriding anything.
Created attachment 402631 [details] Patch
That error means InspectorBackendDispatchers.h in DerivedSources wasn't re-generated to take into account the Page.json change. Looks like a win (CMake) bug.
Comment on attachment 402631 [details] Patch If this enhancement isn't exposed in Web Inspector user interface, why is it being added to Web Inspector Protocol? Given that this enhancement doesn't have to do with debugging and inspection, it seems like something more suitable as a WebDriver extension capability (webkit:timezone or similar) or extension command. I'm not sure whether arbitrarily overriding the timezone after a page has loaded makes sense–for example, cookie expiration would not be affected by this change as it exists currently. It will also not line up with time data that the embeddng application provides via other interfaces, such as extensions.