chrome-devtools-frontend 1.0.1721762 → 1.0.1726686
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/review-ui-widgets/SKILL.md +7 -7
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +12 -0
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +3 -3
- package/.agents/skills/ui-widgets/SKILL.md +2 -1
- package/docs/cookbook/dependencies.md +57 -11
- package/docs/get_the_code.md +15 -0
- package/front_end/core/i18n/collect-ui-strings.js +58 -12
- package/front_end/core/i18n/i18nImpl.ts +1 -1
- package/front_end/core/root/Runtime.ts +1 -1
- package/front_end/core/sdk/ResourceTreeModel.ts +16 -0
- package/front_end/core/sdk/WebAuthnModel.ts +17 -10
- package/front_end/entrypoints/js_app/js_app.ts +2 -5
- package/front_end/entrypoints/node_app/node_app.ts +2 -3
- package/front_end/generated/InspectorBackendCommands.ts +3 -3
- package/front_end/generated/protocol.ts +17 -0
- package/front_end/models/ai_assistance/skills/lighthouse.md +2 -1
- package/front_end/models/ai_assistance/skills/network.md +1 -0
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +26 -2
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +1 -1
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +2 -7
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +2 -2
- package/front_end/models/comment_manager/CD4ABridge.ts +4 -0
- package/front_end/models/comment_manager/CommentManager.ts +0 -6
- package/front_end/models/comment_manager/CommentThread.ts +39 -19
- package/front_end/models/elements/StyleChanges.ts +66 -0
- package/front_end/models/trace/EventsSerializer.ts +2 -7
- package/front_end/models/trace/ModelImpl.ts +0 -2
- package/front_end/models/trace/handlers/FlowsHandler.ts +37 -29
- package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +13 -6
- package/front_end/models/trace/helpers/SyntheticEvents.ts +10 -37
- package/front_end/models/trace/insights/RenderBlocking.ts +3 -1
- package/front_end/models/trace/lantern/simulation/Simulator.ts +4 -0
- package/front_end/models/trace/lantern/types/Lantern.ts +1 -0
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +92 -0
- package/front_end/panels/accessibility/SourceOrderView.ts +1 -1
- package/front_end/panels/accessibility/accessibilityAnnouncementRecordingListView.css +3 -1
- package/front_end/panels/accessibility/accessibilityAnnouncementRecordingView.css +12 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +90 -0
- package/front_end/panels/application/StorageView.ts +348 -254
- package/front_end/panels/application/SubAppsView.ts +159 -0
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/preloading/PreloadingView.ts +360 -336
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +3 -3
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +6 -3
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +17 -17
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -2
- package/front_end/panels/application/preloading/preloadingView.css +12 -4
- package/front_end/panels/application/preloading/preloadingViewDropDown.css +1 -1
- package/front_end/panels/application/storageView.css +16 -21
- package/front_end/panels/application/subAppsView.css +21 -0
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +2 -2
- package/front_end/panels/browser_debugger/browser_debugger-meta.ts +6 -8
- package/front_end/panels/comments/CommentsPane.ts +26 -9
- package/front_end/panels/comments/commentsPane.css +25 -6
- package/front_end/panels/common/CommentThreadWidget.ts +2 -2
- package/front_end/panels/common/CommentsOverlayWidget.ts +94 -35
- package/front_end/panels/common/commentThreadWidget.css +17 -0
- package/front_end/panels/common/commentsOverlay.css +5 -10
- package/front_end/panels/common/common-meta.ts +11 -1
- package/front_end/panels/elements/ClassesPaneWidget.ts +133 -89
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +7 -33
- package/front_end/panels/elements/DOMTreeElementWidget.ts +3 -1
- package/front_end/panels/elements/DOMTreeWidget.ts +19 -3
- package/front_end/panels/elements/ElementStatePaneWidget.ts +11 -1
- package/front_end/panels/elements/PropertyRenderer.ts +3 -2
- package/front_end/panels/elements/StyleEditorWidget.ts +87 -39
- package/front_end/panels/elements/StylePropertiesSection.ts +32 -5
- package/front_end/panels/elements/StylePropertyTreeElement.ts +227 -162
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -0
- package/front_end/panels/event_listeners/EventListenersView.ts +11 -8
- package/front_end/panels/layer_viewer/Layers3DView.ts +21 -37
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
- package/front_end/panels/network/NetworkConfigView.ts +12 -10
- package/front_end/panels/network/NetworkDataGridNode.ts +3 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +1 -1
- package/front_end/panels/network/RequestPayloadView.ts +12 -5
- package/front_end/panels/network/networkConfigView.css +8 -8
- package/front_end/panels/profiler/HeapProfileView.ts +28 -6
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +7 -3
- package/front_end/panels/protocol_monitor/JSONEditor.ts +0 -1
- package/front_end/panels/recorder/RecorderPanel.ts +2 -2
- package/front_end/panels/screencast/ScreencastView.ts +3 -6
- package/front_end/panels/security/SecurityPanelSidebar.ts +0 -31
- package/front_end/panels/settings/SettingsScreen.ts +1 -1
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +9 -16
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +358 -345
- package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +136 -121
- package/front_end/panels/sources/NavigatorView.ts +105 -45
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +8 -5
- package/front_end/panels/sources/SourcesNavigator.ts +421 -213
- package/front_end/panels/sources/SourcesPanel.ts +9 -5
- package/front_end/panels/sources/TabbedEditorContainer.ts +41 -18
- package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +10 -5
- package/front_end/panels/sources/sources-meta.ts +4 -15
- package/front_end/panels/sources/sourcesNavigator.css +5 -0
- package/front_end/panels/timeline/ModificationsManager.ts +0 -2
- package/front_end/panels/timeline/README.md +2 -0
- package/front_end/panels/timeline/TimelineCommentContext.ts +171 -0
- package/front_end/panels/timeline/TimelineCommentController.ts +168 -30
- package/front_end/panels/timeline/TimelinePanel.ts +4 -0
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -1
- package/front_end/panels/timeline/timeline.ts +2 -0
- package/front_end/panels/timeline/utils/Treemap.ts +8 -0
- package/front_end/panels/webauthn/WebauthnPane.ts +15 -13
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +113 -3
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +21311 -20981
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +36 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +20 -18
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.d.ts +20 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +40 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js +41 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.js +23 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js +13 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.js +18 -11
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.js +8 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +24 -12
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.js +13 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.d.ts +22 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js +75 -9
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.d.ts +18 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.js +8 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js +65 -26
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js +19 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ScreenRecording.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ScreenRecording.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ScreenRecording.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js +4 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.js +95 -8
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.d.ts +0 -8
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js +8 -24
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.js +5 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts +9 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/WaitTask.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/WaitTask.js +10 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/WaitTask.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts +10 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js +30 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.js +33 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/encoding.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/encoding.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +113 -3
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +42 -0
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +25 -22
- package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +22 -2
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +45 -2
- package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +79 -32
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +32 -12
- package/front_end/third_party/puppeteer/package/src/bidi/Input.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +18 -2
- package/front_end/third_party/puppeteer/package/src/bidi/core/Request.ts +21 -13
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +12 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +37 -16
- package/front_end/third_party/puppeteer/package/src/cdp/EmulationManager.ts +14 -11
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +7 -1
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +101 -14
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkEventManager.ts +26 -6
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +111 -29
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +37 -1
- package/front_end/third_party/puppeteer/package/src/cdp/ScreenRecording.ts +5 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +5 -0
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +122 -7
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +13 -33
- package/front_end/third_party/puppeteer/package/src/common/BrowserWebSocketTransport.ts +10 -5
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +10 -0
- package/front_end/third_party/puppeteer/package/src/common/WaitTask.ts +12 -0
- package/front_end/third_party/puppeteer/package/src/common/util.ts +39 -5
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/injected/Poller.ts +35 -3
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +4 -2
- package/front_end/third_party/puppeteer/package/src/node/NodeWebSocketTransport.ts +5 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/encoding.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +3 -0
- package/front_end/ui/comments/CommentOverlayManager.ts +2 -4
- package/front_end/ui/components/lists/List.ts +14 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +23 -14
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +3 -0
- package/front_end/ui/helpers/OpenInNewTab.ts +8 -0
- package/front_end/ui/legacy/LinkContextMenuProvider.ts +1 -1
- package/front_end/ui/legacy/ListWidget.ts +14 -18
- package/front_end/ui/legacy/TabbedPane.ts +46 -3
- package/front_end/ui/legacy/Toolbar.ts +0 -1
- package/front_end/ui/legacy/Treeoutline.ts +10 -3
- package/front_end/ui/legacy/UIUtils.ts +5 -2
- package/front_end/ui/legacy/components/inline_editor/Swatches.ts +19 -6
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +20 -11
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +27 -7
- package/front_end/ui/visual_logging/KnownContextValues.ts +5 -0
- package/package.json +1 -1
|
@@ -450,44 +450,89 @@ export abstract class Locator<T> extends EventEmitter<LocatorEvents> {
|
|
|
450
450
|
}),
|
|
451
451
|
mergeMap(handle => {
|
|
452
452
|
return from(
|
|
453
|
-
(handle as unknown as ElementHandle<HTMLElement>).evaluate(
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
453
|
+
(handle as unknown as ElementHandle<HTMLElement>).evaluate(
|
|
454
|
+
(el, newValue) => {
|
|
455
|
+
if (el instanceof HTMLSelectElement) {
|
|
456
|
+
if (
|
|
457
|
+
!Array.from(el.options).some(option => {
|
|
458
|
+
return option.value === newValue;
|
|
459
|
+
})
|
|
460
|
+
) {
|
|
461
|
+
throw new Error(
|
|
462
|
+
`Element has no option with the value "${newValue}".`,
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
return 'select';
|
|
466
|
+
}
|
|
467
|
+
if (el instanceof HTMLTextAreaElement) {
|
|
468
|
+
if (el.readOnly) {
|
|
469
|
+
throw new Error('Element is read-only.');
|
|
470
|
+
}
|
|
471
|
+
return 'typeable-input';
|
|
472
|
+
}
|
|
473
|
+
if (el instanceof HTMLInputElement) {
|
|
474
|
+
if (el.type === 'checkbox' || el.type === 'radio') {
|
|
475
|
+
return 'checkable-input';
|
|
476
|
+
}
|
|
477
|
+
if (
|
|
478
|
+
el.readOnly &&
|
|
479
|
+
[
|
|
480
|
+
'text',
|
|
481
|
+
'search',
|
|
482
|
+
'url',
|
|
483
|
+
'tel',
|
|
484
|
+
'email',
|
|
485
|
+
'password',
|
|
486
|
+
'number',
|
|
487
|
+
'date',
|
|
488
|
+
'month',
|
|
489
|
+
'week',
|
|
490
|
+
'time',
|
|
491
|
+
'datetime-local',
|
|
492
|
+
].includes(el.type)
|
|
493
|
+
) {
|
|
494
|
+
throw new Error('Element is read-only.');
|
|
495
|
+
}
|
|
496
|
+
if (el.type !== 'file' && String(newValue) !== '') {
|
|
497
|
+
// Validate without modifying the element before a possible retry.
|
|
498
|
+
const probe = document.createElement('input');
|
|
499
|
+
probe.type = el.type;
|
|
500
|
+
probe.value = String(newValue);
|
|
501
|
+
if (probe.value === '') {
|
|
502
|
+
throw new Error(
|
|
503
|
+
`Element did not accept the value "${newValue}".`,
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
switch (el.type) {
|
|
508
|
+
case 'text':
|
|
509
|
+
case 'url':
|
|
510
|
+
case 'tel':
|
|
511
|
+
case 'search':
|
|
512
|
+
case 'password':
|
|
513
|
+
case 'number':
|
|
514
|
+
case 'email':
|
|
515
|
+
return 'typeable-input';
|
|
516
|
+
default:
|
|
517
|
+
return 'other-input';
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
switch (el.getAttribute('role')) {
|
|
462
522
|
case 'checkbox':
|
|
463
523
|
case 'radio':
|
|
524
|
+
case 'switch':
|
|
464
525
|
return 'checkable-input';
|
|
465
|
-
case 'text':
|
|
466
|
-
case 'url':
|
|
467
|
-
case 'tel':
|
|
468
|
-
case 'search':
|
|
469
|
-
case 'password':
|
|
470
|
-
case 'number':
|
|
471
|
-
case 'email':
|
|
472
|
-
return 'typeable-input';
|
|
473
|
-
default:
|
|
474
|
-
return 'other-input';
|
|
475
526
|
}
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
switch (el.getAttribute('role')) {
|
|
479
|
-
case 'checkbox':
|
|
480
|
-
case 'radio':
|
|
481
|
-
case 'switch':
|
|
482
|
-
return 'checkable-input';
|
|
483
|
-
}
|
|
484
527
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
528
|
+
if (el.isContentEditable) {
|
|
529
|
+
return 'contenteditable';
|
|
530
|
+
}
|
|
488
531
|
|
|
489
|
-
|
|
490
|
-
|
|
532
|
+
return 'unknown';
|
|
533
|
+
},
|
|
534
|
+
value,
|
|
535
|
+
),
|
|
491
536
|
)
|
|
492
537
|
.pipe(
|
|
493
538
|
mergeMap(inputType => {
|
|
@@ -811,6 +856,8 @@ export abstract class Locator<T> extends EventEmitter<LocatorEvents> {
|
|
|
811
856
|
* method is chosen based on the type. `contenteditable`, select, textarea and
|
|
812
857
|
* input elements are supported. For checkboxes, radio buttons and switches
|
|
813
858
|
* specify a boolean value.
|
|
859
|
+
* Read-only elements and values the element does not accept are rejected without
|
|
860
|
+
* modifying the element.
|
|
814
861
|
*/
|
|
815
862
|
fill<ElementType extends Element>(
|
|
816
863
|
this: Locator<ElementType>,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
InterceptResolutionAction,
|
|
21
21
|
} from '../api/HTTPRequest.js';
|
|
22
22
|
import {PageEvent} from '../api/Page.js';
|
|
23
|
-
import type
|
|
23
|
+
import {DEBUG_PREFIXES, type Logger} from '../common/Debug.js';
|
|
24
24
|
import {UnsupportedOperation} from '../common/Errors.js';
|
|
25
25
|
import {stringToBase64} from '../util/encoding.js';
|
|
26
26
|
|
|
@@ -174,6 +174,15 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
174
174
|
return await this.#request.fetchPostData();
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
override async content(): Promise<Uint8Array | undefined> {
|
|
178
|
+
try {
|
|
179
|
+
return await this.#request.getRequestContent();
|
|
180
|
+
} catch (err) {
|
|
181
|
+
this.#logger?.(DEBUG_PREFIXES.error)?.(err);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
177
186
|
override headers(): Record<string, string> {
|
|
178
187
|
// Callers should not be allowed to mutate internal structure.
|
|
179
188
|
const headers: Record<string, string> = {};
|
|
@@ -315,18 +324,29 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
315
324
|
const credentials = this.#frame.page()._credentials;
|
|
316
325
|
if (credentials && !this.#authenticationHandled) {
|
|
317
326
|
this.#authenticationHandled = true;
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
327
|
+
await this.#request
|
|
328
|
+
.continueWithAuth({
|
|
329
|
+
action: 'provideCredentials',
|
|
330
|
+
credentials: {
|
|
331
|
+
type: 'password',
|
|
332
|
+
username: credentials.username,
|
|
333
|
+
password: credentials.password,
|
|
334
|
+
},
|
|
335
|
+
})
|
|
336
|
+
.catch(error => {
|
|
337
|
+
// The request may have been canceled or the page closed before the
|
|
338
|
+
// auth challenge could be answered. Tolerate these errors instead of
|
|
339
|
+
// rejecting, which would surface as an unhandled rejection.
|
|
340
|
+
this.#logger(DEBUG_PREFIXES.error)?.(error);
|
|
341
|
+
});
|
|
326
342
|
} else {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
343
|
+
await this.#request
|
|
344
|
+
.continueWithAuth({
|
|
345
|
+
action: 'cancel',
|
|
346
|
+
})
|
|
347
|
+
.catch(error => {
|
|
348
|
+
this.#logger(DEBUG_PREFIXES.error)?.(error);
|
|
349
|
+
});
|
|
330
350
|
}
|
|
331
351
|
};
|
|
332
352
|
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
PageEvent,
|
|
33
33
|
type NewDocumentScriptEvaluation,
|
|
34
34
|
type ScreenshotOptions,
|
|
35
|
+
type TabInfo,
|
|
35
36
|
} from '../api/Page.js';
|
|
36
37
|
import type {Target} from '../api/Target.js';
|
|
37
38
|
import {Coverage} from '../cdp/Coverage.js';
|
|
@@ -252,6 +253,10 @@ export class BidiPage extends Page {
|
|
|
252
253
|
return this.#frame.browsingContext.windowId;
|
|
253
254
|
}
|
|
254
255
|
|
|
256
|
+
override tabInfo(): Promise<TabInfo | null> {
|
|
257
|
+
throw new UnsupportedOperation();
|
|
258
|
+
}
|
|
259
|
+
|
|
255
260
|
override openDevTools(): Promise<Page> {
|
|
256
261
|
throw new UnsupportedOperation();
|
|
257
262
|
}
|
|
@@ -343,7 +348,14 @@ export class BidiPage extends Page {
|
|
|
343
348
|
return this.#frame.browsingContext.isJavaScriptEnabled();
|
|
344
349
|
}
|
|
345
350
|
|
|
346
|
-
override async setGeolocation(
|
|
351
|
+
override async setGeolocation(
|
|
352
|
+
options: GeolocationOptions | null,
|
|
353
|
+
): Promise<void> {
|
|
354
|
+
if (options === null) {
|
|
355
|
+
return await this.#frame.browsingContext.setGeolocationOverride({
|
|
356
|
+
coordinates: null,
|
|
357
|
+
});
|
|
358
|
+
}
|
|
347
359
|
const {longitude, latitude, accuracy = 0} = options;
|
|
348
360
|
if (longitude < -180 || longitude > 180) {
|
|
349
361
|
throw new Error(
|
|
@@ -501,7 +513,11 @@ export class BidiPage extends Page {
|
|
|
501
513
|
scale,
|
|
502
514
|
preferCSSPageSize,
|
|
503
515
|
} = parsePDFOptions(options, 'cm');
|
|
504
|
-
const pageRanges = ranges
|
|
516
|
+
const pageRanges = ranges
|
|
517
|
+
? ranges.split(',').map(range => {
|
|
518
|
+
return range.trim();
|
|
519
|
+
})
|
|
520
|
+
: [];
|
|
505
521
|
|
|
506
522
|
await firstValueFrom(
|
|
507
523
|
from(
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import * as Bidi from 'webdriver-bidi-protocol';
|
|
8
8
|
|
|
9
|
-
import {ProtocolError
|
|
9
|
+
import {ProtocolError} from '../../common/Errors.js';
|
|
10
10
|
import {EventEmitter} from '../../common/EventEmitter.js';
|
|
11
11
|
import {inertIfDisposed} from '../../util/decorators.js';
|
|
12
12
|
import {DisposableStack, disposeSymbol} from '../../util/disposable.js';
|
|
@@ -40,7 +40,7 @@ export class Request extends EventEmitter<{
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
#responseContentPromise: Promise<Uint8Array<ArrayBufferLike>> | null = null;
|
|
43
|
-
#
|
|
43
|
+
#requestContentPromise: Promise<Uint8Array<ArrayBuffer>> | null = null;
|
|
44
44
|
#error?: string;
|
|
45
45
|
#redirect?: Request;
|
|
46
46
|
#response?: Bidi.Network.ResponseData;
|
|
@@ -119,6 +119,8 @@ export class Request extends EventEmitter<{
|
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
121
|
this.#error = event.errorText;
|
|
122
|
+
this.#event.request.headers = event.request.headers;
|
|
123
|
+
this.#event.request.timings = event.request.timings;
|
|
122
124
|
this.emit('error', this.#error);
|
|
123
125
|
this.dispose();
|
|
124
126
|
});
|
|
@@ -131,6 +133,7 @@ export class Request extends EventEmitter<{
|
|
|
131
133
|
return;
|
|
132
134
|
}
|
|
133
135
|
this.#response = event.response;
|
|
136
|
+
this.#event.request.headers = event.request.headers;
|
|
134
137
|
this.#event.request.timings = event.request.timings;
|
|
135
138
|
this.emit('response', this.#response);
|
|
136
139
|
});
|
|
@@ -143,6 +146,7 @@ export class Request extends EventEmitter<{
|
|
|
143
146
|
return;
|
|
144
147
|
}
|
|
145
148
|
this.#response = event.response;
|
|
149
|
+
this.#event.request.headers = event.request.headers;
|
|
146
150
|
this.#event.request.timings = event.request.timings;
|
|
147
151
|
this.emit('success', this.#response);
|
|
148
152
|
// In case this is a redirect.
|
|
@@ -259,27 +263,31 @@ export class Request extends EventEmitter<{
|
|
|
259
263
|
});
|
|
260
264
|
}
|
|
261
265
|
|
|
262
|
-
async
|
|
266
|
+
async getRequestContent(): Promise<Uint8Array | undefined> {
|
|
263
267
|
if (!this.hasPostData) {
|
|
264
268
|
return undefined;
|
|
265
269
|
}
|
|
266
|
-
if (!this.#
|
|
267
|
-
this.#
|
|
270
|
+
if (!this.#requestContentPromise) {
|
|
271
|
+
this.#requestContentPromise = (async () => {
|
|
268
272
|
const data = await this.#session.send('network.getData', {
|
|
269
273
|
dataType: Bidi.Network.DataType.Request,
|
|
270
274
|
request: this.id,
|
|
271
275
|
});
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
// TODO: support base64 response.
|
|
277
|
-
throw new UnsupportedOperation(
|
|
278
|
-
`Collected request body data of type ${data.result.bytes.type} is not supported`,
|
|
276
|
+
return stringToTypedArray(
|
|
277
|
+
data.result.bytes.value,
|
|
278
|
+
data.result.bytes.type === 'base64',
|
|
279
279
|
);
|
|
280
280
|
})();
|
|
281
281
|
}
|
|
282
|
-
return await this.#
|
|
282
|
+
return await this.#requestContentPromise;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
async fetchPostData(): Promise<string | undefined> {
|
|
286
|
+
const content = await this.getRequestContent();
|
|
287
|
+
if (content === undefined) {
|
|
288
|
+
return undefined;
|
|
289
|
+
}
|
|
290
|
+
return new TextDecoder().decode(content);
|
|
283
291
|
}
|
|
284
292
|
|
|
285
293
|
async getResponseContent(): Promise<Uint8Array> {
|
|
@@ -135,7 +135,8 @@ export interface SerializedAXNode {
|
|
|
135
135
|
* Get an ElementHandle for this AXNode if available.
|
|
136
136
|
*
|
|
137
137
|
* If the underlying DOM element has been disposed, the method might return an
|
|
138
|
-
* error.
|
|
138
|
+
* error. If the frame has navigated to a new document since the snapshot,
|
|
139
|
+
* the method returns `null`.
|
|
139
140
|
*/
|
|
140
141
|
elementHandle(): Promise<ElementHandle | null>;
|
|
141
142
|
}
|
|
@@ -387,6 +388,7 @@ class AXNode {
|
|
|
387
388
|
#ignored: boolean;
|
|
388
389
|
#cachedHasFocusableChild?: boolean;
|
|
389
390
|
#realm: Realm;
|
|
391
|
+
#loaderId: string;
|
|
390
392
|
|
|
391
393
|
constructor(realm: Realm, payload: Protocol.Accessibility.AXNode) {
|
|
392
394
|
this.payload = payload;
|
|
@@ -397,6 +399,7 @@ class AXNode {
|
|
|
397
399
|
? this.payload.description.value
|
|
398
400
|
: undefined;
|
|
399
401
|
this.#realm = realm;
|
|
402
|
+
this.#loaderId = (realm.environment as CdpFrame)._loaderId;
|
|
400
403
|
for (const property of this.payload.properties || []) {
|
|
401
404
|
if (property.name === 'editable') {
|
|
402
405
|
this.#richlyEditable = property.value.value === 'richtext';
|
|
@@ -620,6 +623,13 @@ class AXNode {
|
|
|
620
623
|
if (!this.payload.backendDOMNodeId) {
|
|
621
624
|
return null;
|
|
622
625
|
}
|
|
626
|
+
// After a navigation, the backend node ID can belong to a different
|
|
627
|
+
// node in the new document, for example in a new renderer process.
|
|
628
|
+
if (
|
|
629
|
+
(this.#realm.environment as CdpFrame)._loaderId !== this.#loaderId
|
|
630
|
+
) {
|
|
631
|
+
return null;
|
|
632
|
+
}
|
|
623
633
|
using handle = await this.#realm.adoptBackendNode(
|
|
624
634
|
this.payload.backendDOMNodeId,
|
|
625
635
|
);
|
|
@@ -642,7 +652,7 @@ class AXNode {
|
|
|
642
652
|
backendNodeId: this.payload.backendDOMNodeId,
|
|
643
653
|
// LoaderId is an experimental mechanism to establish unique IDs across
|
|
644
654
|
// navigations.
|
|
645
|
-
loaderId:
|
|
655
|
+
loaderId: this.#loaderId,
|
|
646
656
|
};
|
|
647
657
|
|
|
648
658
|
type UserStringProperty =
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
type LaunchPWAOptions,
|
|
30
30
|
type GetPWAStateOptions,
|
|
31
31
|
type PWAState,
|
|
32
|
+
type NetworkRestrictions,
|
|
32
33
|
} from '../api/Browser.js';
|
|
33
34
|
import {BrowserContextEvent} from '../api/BrowserContext.js';
|
|
34
35
|
import {CDPSessionEvent} from '../api/CDPSession.js';
|
|
@@ -106,16 +107,6 @@ export class CdpBrowser extends BrowserBase {
|
|
|
106
107
|
logger,
|
|
107
108
|
);
|
|
108
109
|
|
|
109
|
-
if (allowlist) {
|
|
110
|
-
const version = await browser.#getVersion();
|
|
111
|
-
const majorVersion = parseInt(
|
|
112
|
-
version.product.match(/\d+/)?.[0] ?? '0',
|
|
113
|
-
10,
|
|
114
|
-
);
|
|
115
|
-
if (majorVersion < 149) {
|
|
116
|
-
throw new Error('The allowlist option require Chrome 149 or greater.');
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
110
|
if (acceptInsecureCerts) {
|
|
120
111
|
await connection.send('Security.setIgnoreCertificateErrors', {
|
|
121
112
|
ignore: true,
|
|
@@ -246,6 +237,21 @@ export class CdpBrowser extends BrowserBase {
|
|
|
246
237
|
return this.#targetManager;
|
|
247
238
|
}
|
|
248
239
|
|
|
240
|
+
override async restrictNetwork(
|
|
241
|
+
conditions?: NetworkRestrictions | null,
|
|
242
|
+
): Promise<void> {
|
|
243
|
+
await this.#targetManager.setNetworkConditions(conditions);
|
|
244
|
+
// Only update the state once the target manager has accepted the new
|
|
245
|
+
// conditions so that failures (e.g. invalid URL patterns) do not leave
|
|
246
|
+
// the browser and connection out of sync with the target manager.
|
|
247
|
+
this.#hasNetworkRestrictions = Boolean(
|
|
248
|
+
(conditions?.blocklist && conditions.blocklist.length > 0) ||
|
|
249
|
+
(conditions?.allowlist && conditions.allowlist.length > 0),
|
|
250
|
+
);
|
|
251
|
+
this.#connection.rejectEmulateNetworkConditionsCalls =
|
|
252
|
+
this.#hasNetworkRestrictions;
|
|
253
|
+
}
|
|
254
|
+
|
|
249
255
|
#setIsPageTargetCallback(isPageTargetCallback?: IsPageTargetCallback): void {
|
|
250
256
|
this.#isPageTargetCallback =
|
|
251
257
|
isPageTargetCallback ||
|
|
@@ -502,26 +508,43 @@ export class CdpBrowser extends BrowserBase {
|
|
|
502
508
|
path: string,
|
|
503
509
|
options?: ExtensionInstallOptions,
|
|
504
510
|
): Promise<string> {
|
|
511
|
+
const existingTargetIds = new Set(
|
|
512
|
+
this._targetManager().getDiscoveredTargetInfos().keys(),
|
|
513
|
+
);
|
|
505
514
|
const {id} = await this.#connection.send('Extensions.loadUnpacked', {
|
|
506
515
|
path,
|
|
507
516
|
enableInIncognito: options?.enabledInIncognito ?? false,
|
|
508
517
|
});
|
|
518
|
+
await this.#destroyExtensionServiceWorkerTargets(id, existingTargetIds);
|
|
509
519
|
this.#extensions.delete(id);
|
|
510
520
|
return id;
|
|
511
521
|
}
|
|
512
522
|
|
|
513
523
|
override async uninstallExtension(id: string): Promise<void> {
|
|
514
524
|
await this.#connection.send('Extensions.uninstall', {id});
|
|
525
|
+
await this.#destroyExtensionServiceWorkerTargets(id);
|
|
526
|
+
this.#extensions.delete(id);
|
|
527
|
+
}
|
|
515
528
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
529
|
+
async #destroyExtensionServiceWorkerTargets(
|
|
530
|
+
id: string,
|
|
531
|
+
existingTargetIds?: ReadonlySet<string>,
|
|
532
|
+
): Promise<void> {
|
|
533
|
+
// Currently sending Extensions.loadUnpacked (when re-installing an
|
|
534
|
+
// existing extension) or Extensions.uninstall does not trigger the
|
|
535
|
+
// Target.targetDestroyed event for replaced/uninstalled service workers.
|
|
536
|
+
// This causes flakiness in extension tests and leaves stale targets in
|
|
537
|
+
// browser.targets().
|
|
519
538
|
// TODO(nroscino): Remove this once the event is correctly emitted.
|
|
520
539
|
const targetDestroyedPromises = [];
|
|
521
540
|
for (const [targetId, targetInfo] of this._targetManager()
|
|
522
541
|
.getDiscoveredTargetInfos()
|
|
523
542
|
.entries()) {
|
|
524
|
-
if (
|
|
543
|
+
if (
|
|
544
|
+
(!existingTargetIds || existingTargetIds.has(targetId)) &&
|
|
545
|
+
targetInfo.url.includes(id) &&
|
|
546
|
+
targetInfo.type === 'service_worker'
|
|
547
|
+
) {
|
|
525
548
|
this._targetManager().addToIgnoreTarget(targetId);
|
|
526
549
|
targetDestroyedPromises.push(
|
|
527
550
|
new Promise(resolve => {
|
|
@@ -536,8 +559,6 @@ export class CdpBrowser extends BrowserBase {
|
|
|
536
559
|
}
|
|
537
560
|
}
|
|
538
561
|
await Promise.all(targetDestroyedPromises);
|
|
539
|
-
|
|
540
|
-
this.#extensions.delete(id);
|
|
541
562
|
}
|
|
542
563
|
|
|
543
564
|
override async installPWA(options: InstallPWAOptions): Promise<string> {
|
|
@@ -546,19 +546,22 @@ export class EmulationManager implements ClientProvider {
|
|
|
546
546
|
if (!state.active) {
|
|
547
547
|
return;
|
|
548
548
|
}
|
|
549
|
-
|
|
550
|
-
'Emulation.
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
);
|
|
549
|
+
if (!state.geoLocation) {
|
|
550
|
+
await client.send('Emulation.clearGeolocationOverride');
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
await client.send('Emulation.setGeolocationOverride', {
|
|
554
|
+
longitude: state.geoLocation.longitude,
|
|
555
|
+
latitude: state.geoLocation.latitude,
|
|
556
|
+
accuracy: state.geoLocation.accuracy,
|
|
557
|
+
});
|
|
559
558
|
}
|
|
560
559
|
|
|
561
|
-
async setGeolocation(options: GeolocationOptions): Promise<void> {
|
|
560
|
+
async setGeolocation(options: GeolocationOptions | null): Promise<void> {
|
|
561
|
+
if (options === null) {
|
|
562
|
+
await this.#geoLocationState.setState({active: true});
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
562
565
|
const {longitude, latitude, accuracy = 0} = options;
|
|
563
566
|
if (longitude < -180 || longitude > 180) {
|
|
564
567
|
throw new Error(
|
|
@@ -199,7 +199,13 @@ export class CdpFrame extends Frame {
|
|
|
199
199
|
if (error) {
|
|
200
200
|
throw error;
|
|
201
201
|
}
|
|
202
|
-
|
|
202
|
+
const result = await Deferred.race<
|
|
203
|
+
Error | HTTPResponse | null | undefined
|
|
204
|
+
>([watcher.terminationPromise(), watcher.navigationResponse()]);
|
|
205
|
+
if (result instanceof Error) {
|
|
206
|
+
throw result;
|
|
207
|
+
}
|
|
208
|
+
return result ?? null;
|
|
203
209
|
} finally {
|
|
204
210
|
watcher.dispose();
|
|
205
211
|
}
|