Bug 213455 - Web Inspector: Add support for timezone override in the Page agent
Summary: Web Inspector: Add support for timezone override in the Page agent
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-22 02:47 PDT by Philippe Normand
Modified: 2020-07-02 08:35 PDT (History)
15 users (show)

See Also:


Attachments
Patch (16.76 KB, patch)
2020-06-22 03:05 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff
Patch (17.19 KB, patch)
2020-06-22 04:54 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff
Patch (17.60 KB, patch)
2020-06-22 09:24 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff
Patch (17.54 KB, patch)
2020-06-24 02:35 PDT, Philippe Normand
bburg: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2020-06-22 02:47:21 PDT
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.
Comment 1 Philippe Normand 2020-06-22 03:05:43 PDT
Created attachment 402460 [details]
Patch
Comment 2 EWS Watchlist 2020-06-22 03:06:18 PDT
This patch modifies the inspector protocol. Please ensure that any frontend changes appropriately use feature checks for new protocol features.
Comment 3 Philippe Normand 2020-06-22 04:54:17 PDT
Created attachment 402462 [details]
Patch
Comment 4 Philippe Normand 2020-06-22 09:24:18 PDT
Created attachment 402482 [details]
Patch
Comment 5 Darin Adler 2020-06-23 13:02:57 PDT
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.
Comment 6 Philippe Normand 2020-06-24 02:35:57 PDT
Created attachment 402631 [details]
Patch
Comment 7 Philippe Normand 2020-06-24 03:09:53 PDT
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 8 BJ Burg 2020-06-24 14:51:28 PDT
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.