chrome-devtools-frontend 1.0.1578729 → 1.0.1581449
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/prompts/creating-a-model.md +51 -0
- package/docs/cookbook/devtools_on_devtools.md +2 -2
- package/docs/feature-specs/elements-gutter-decorators.md +40 -0
- package/docs/feature-specs/elements-tree-edit-html.md +14 -0
- package/docs/feature-specs/elements-tree-node-title.md +46 -0
- package/docs/feature-specs/elements-tree-selection-and-hover.md +31 -0
- package/docs/feature-specs/images/elements-gutter-decorators-multiple.png +0 -0
- package/docs/get_the_code.md +3 -3
- package/front_end/core/host/UserMetrics.ts +3 -7
- package/front_end/core/root/Runtime.ts +0 -1
- package/front_end/core/sdk/NetworkManager.ts +0 -35
- package/front_end/core/sdk/OverlayModel.ts +10 -0
- package/front_end/devtools_compatibility.js +4 -0
- package/front_end/entrypoints/devtools_app/devtools_app.ts +1 -0
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +530 -0
- package/front_end/entrypoints/greendev_floaty/floaty.css +258 -0
- package/front_end/entrypoints/greendev_floaty/floaty.html +31 -0
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +422 -0
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +0 -38
- package/front_end/generated/ARIAProperties.js +0 -6
- package/front_end/generated/InspectorBackendCommands.ts +10 -4
- package/front_end/generated/SupportedCSSProperties.js +39 -31
- package/front_end/generated/protocol-mapping.d.ts +12 -0
- package/front_end/generated/protocol-proxy-api.d.ts +12 -0
- package/front_end/generated/protocol.ts +57 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +32 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +110 -6
- package/front_end/models/computed_style/computed_style.ts +9 -0
- package/front_end/models/issues_manager/CorsIssue.ts +11 -14
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +33 -4
- package/front_end/panels/ai_assistance/components/ChatInput.ts +52 -19
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +7 -4
- package/front_end/panels/ai_assistance/components/ChatView.ts +4 -0
- package/front_end/panels/ai_assistance/components/chatInput.css +10 -3
- package/front_end/panels/application/DeviceBoundSessionsView.ts +51 -76
- package/front_end/panels/changes/changesSidebar.css +5 -0
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +2 -2
- package/front_end/panels/common/AiCodeGenerationUpgradeDialog.ts +4 -4
- package/front_end/panels/common/ExtensionPanel.ts +4 -0
- package/front_end/panels/common/FreDialog.ts +4 -0
- package/front_end/panels/coverage/CoverageListView.ts +18 -3
- package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +89 -0
- package/front_end/panels/elements/ComputedStyleWidget.ts +12 -8
- package/front_end/panels/elements/ElementsPanel.ts +4 -3
- package/front_end/panels/elements/ElementsSidebarPane.ts +11 -8
- package/front_end/panels/elements/ElementsTreeElement.ts +92 -121
- package/front_end/panels/elements/ElementsTreeOutline.ts +26 -15
- package/front_end/panels/elements/MetricsSidebarPane.ts +2 -2
- package/front_end/panels/elements/PlatformFontsWidget.ts +7 -5
- package/front_end/panels/elements/PropertiesWidget.ts +3 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -3
- package/front_end/panels/elements/elements.ts +4 -3
- package/front_end/panels/elements/elementsTreeOutline.css +16 -5
- package/front_end/panels/greendev/GreenDevPanel.css +241 -0
- package/front_end/panels/greendev/GreenDevPanel.ts +308 -0
- package/front_end/panels/greendev/GreenDevShared.ts +13 -0
- package/front_end/panels/greendev/greendev-meta.ts +52 -0
- package/front_end/panels/greendev/greendev.ts +9 -0
- package/front_end/panels/issues/CorsIssueDetailsView.ts +4 -4
- package/front_end/panels/lighthouse/LighthouseStartView.ts +1 -1
- package/front_end/panels/lighthouse/lighthouseStartView.css +6 -0
- package/front_end/panels/network/NetworkLogView.ts +2 -5
- package/front_end/panels/security/SecurityPanel.ts +0 -4
- package/front_end/panels/security/SecurityPanelSidebar.ts +2 -42
- package/front_end/panels/security/security-meta.ts +2 -14
- package/front_end/panels/security/security.ts +0 -4
- package/front_end/panels/settings/EditFileSystemView.ts +8 -8
- package/front_end/panels/settings/SettingsScreen.ts +4 -4
- package/front_end/panels/sources/SourcesSearchScope.ts +2 -1
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +47 -26
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +121 -39
- package/front_end/panels/timeline/overlays/components/timespanBreakdownOverlay.css +106 -101
- 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/cjs/puppeteer/api/Browser.d.ts +35 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js +19 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts +16 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +21 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.d.ts +13 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.js +56 -36
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +32 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +32 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +20 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +25 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js +23 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +10 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +29 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +46 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js +13 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/JSHandle.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +7 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +43 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.d.ts +10 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.js +34 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Cookie.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Cookie.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/XPathQuerySelector.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/XPathQuerySelector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +129 -3
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +233 -65
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +35 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js +19 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts +16 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +21 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.d.ts +13 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.js +56 -36
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +30 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +32 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +20 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +25 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js +23 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +10 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts +29 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +46 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +19 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js +14 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/JSHandle.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +7 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +43 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.d.ts +10 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.js +31 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Cookie.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Cookie.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/XPathQuerySelector.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/XPathQuerySelector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +129 -3
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +46 -0
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +21 -0
- package/front_end/third_party/puppeteer/package/src/api/Frame.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +23 -0
- package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +88 -56
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +33 -8
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +61 -3
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +23 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +29 -8
- package/front_end/third_party/puppeteer/package/src/bidi/core/Browser.ts +30 -0
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +13 -2
- package/front_end/third_party/puppeteer/package/src/bidi/core/UserContext.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +85 -8
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +36 -1
- package/front_end/third_party/puppeteer/package/src/cdp/ExecutionContext.ts +5 -5
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +23 -2
- package/front_end/third_party/puppeteer/package/src/cdp/JSHandle.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +60 -8
- package/front_end/third_party/puppeteer/package/src/cdp/utils.ts +36 -3
- package/front_end/third_party/puppeteer/package/src/common/Cookie.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/injected/XPathQuerySelector.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/node/PuppeteerNode.ts +8 -6
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/text_editor/AutocompleteHistory.ts +2 -1
- package/front_end/ui/components/text_editor/TextEditorHistory.ts +1 -1
- package/front_end/ui/legacy/InplaceEditor.ts +1 -1
- package/front_end/ui/legacy/SearchableView.ts +5 -2
- package/front_end/ui/legacy/Widget.ts +15 -0
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +6 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +50 -1
- package/front_end/ui/legacy/components/data_grid/SortableDataGrid.ts +59 -9
- package/front_end/ui/legacy/components/data_grid/ViewportDataGrid.ts +2 -1
- package/front_end/ui/legacy/components/data_grid/data_grid.ts +1 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +28 -15
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +2 -2
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +3 -3
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +2 -3
- package/front_end/ui/visual_logging/Debugging.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +13 -0
- package/mcp/mcp.ts +1 -0
- package/package.json +1 -1
- package/front_end/panels/security/CookieControlsTreeElement.ts +0 -21
- package/front_end/panels/security/CookieControlsView.ts +0 -447
- package/front_end/panels/security/CookieReportTreeElement.ts +0 -21
- package/front_end/panels/security/CookieReportView.ts +0 -549
- package/front_end/panels/security/cookieControlsView.css +0 -139
- package/front_end/panels/security/cookieReportView.css +0 -90
- /package/front_end/{panels/elements → models/computed_style}/ComputedStyleModel.ts +0 -0
|
@@ -65,6 +65,18 @@ export interface ActionOptions {
|
|
|
65
65
|
* @public
|
|
66
66
|
*/
|
|
67
67
|
export type LocatorClickOptions = ClickOptions & ActionOptions;
|
|
68
|
+
/**
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
export interface LocatorFillOptions extends ActionOptions {
|
|
72
|
+
/**
|
|
73
|
+
* The number of characters to type before switching to a faster fill-out
|
|
74
|
+
* method.
|
|
75
|
+
*
|
|
76
|
+
* @defaultValue `100`
|
|
77
|
+
*/
|
|
78
|
+
typingThreshold?: number;
|
|
79
|
+
}
|
|
68
80
|
/**
|
|
69
81
|
* @public
|
|
70
82
|
*/
|
|
@@ -400,9 +412,10 @@ export abstract class Locator<T> extends EventEmitter<LocatorEvents> {
|
|
|
400
412
|
#fill<ElementType extends Element>(
|
|
401
413
|
this: Locator<ElementType>,
|
|
402
414
|
value: string,
|
|
403
|
-
options?: Readonly<
|
|
415
|
+
options?: Readonly<LocatorFillOptions>,
|
|
404
416
|
): Observable<void> {
|
|
405
417
|
const signal = options?.signal;
|
|
418
|
+
const typingThreshold = options?.typingThreshold ?? 100;
|
|
406
419
|
const cause = new Error('Locator.fill');
|
|
407
420
|
return this._wait(options).pipe(
|
|
408
421
|
this.operators.conditions(
|
|
@@ -453,68 +466,87 @@ export abstract class Locator<T> extends EventEmitter<LocatorEvents> {
|
|
|
453
466
|
)
|
|
454
467
|
.pipe(
|
|
455
468
|
mergeMap(inputType => {
|
|
469
|
+
const fillDirectly = (): Observable<void> => {
|
|
470
|
+
return from(handle.focus()).pipe(
|
|
471
|
+
mergeMap(() => {
|
|
472
|
+
return from(
|
|
473
|
+
handle.evaluate((input, newValue) => {
|
|
474
|
+
const element = input as HTMLElement;
|
|
475
|
+
const currentValue = element.isContentEditable
|
|
476
|
+
? element.innerText
|
|
477
|
+
: (element as HTMLInputElement).value;
|
|
478
|
+
if (currentValue === newValue) {
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
if (element.isContentEditable) {
|
|
482
|
+
element.innerText = newValue;
|
|
483
|
+
} else {
|
|
484
|
+
(element as HTMLInputElement).value = newValue;
|
|
485
|
+
}
|
|
486
|
+
element.dispatchEvent(
|
|
487
|
+
new Event('input', {bubbles: true}),
|
|
488
|
+
);
|
|
489
|
+
element.dispatchEvent(
|
|
490
|
+
new Event('change', {bubbles: true}),
|
|
491
|
+
);
|
|
492
|
+
}, value),
|
|
493
|
+
);
|
|
494
|
+
}),
|
|
495
|
+
);
|
|
496
|
+
};
|
|
497
|
+
|
|
456
498
|
switch (inputType) {
|
|
457
499
|
case 'select':
|
|
458
500
|
return from(handle.select(value).then(noop));
|
|
459
501
|
case 'contenteditable':
|
|
460
502
|
case 'typeable-input':
|
|
461
|
-
|
|
462
|
-
(
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
503
|
+
if (value.length < typingThreshold) {
|
|
504
|
+
return from(
|
|
505
|
+
(
|
|
506
|
+
handle as unknown as ElementHandle<HTMLInputElement>
|
|
507
|
+
).evaluate((input, newValue) => {
|
|
508
|
+
const element = input as HTMLElement;
|
|
509
|
+
const currentValue = element.isContentEditable
|
|
510
|
+
? element.innerText
|
|
511
|
+
: (input as HTMLInputElement).value;
|
|
512
|
+
|
|
513
|
+
// Clear the input if the current value does not match the filled
|
|
514
|
+
// out value.
|
|
515
|
+
if (
|
|
516
|
+
newValue.length <= currentValue.length ||
|
|
517
|
+
!newValue.startsWith(currentValue)
|
|
518
|
+
) {
|
|
519
|
+
if (element.isContentEditable) {
|
|
520
|
+
element.innerText = '';
|
|
521
|
+
} else {
|
|
522
|
+
(input as HTMLInputElement).value = '';
|
|
523
|
+
}
|
|
524
|
+
return newValue;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// If the value is partially filled out, only type the rest. Move
|
|
528
|
+
// cursor to the end of the common prefix.
|
|
529
|
+
if (element.isContentEditable) {
|
|
530
|
+
element.innerText = '';
|
|
531
|
+
element.innerText = currentValue;
|
|
477
532
|
} else {
|
|
478
|
-
input.value = '';
|
|
533
|
+
(input as HTMLInputElement).value = '';
|
|
534
|
+
(input as HTMLInputElement).value = currentValue;
|
|
479
535
|
}
|
|
480
|
-
return newValue;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
input.value = '';
|
|
493
|
-
input.value = originalValue;
|
|
494
|
-
}
|
|
495
|
-
return newValue.substring(originalValue.length);
|
|
496
|
-
}, value),
|
|
497
|
-
).pipe(
|
|
498
|
-
mergeMap(textToType => {
|
|
499
|
-
return from(handle.type(textToType));
|
|
500
|
-
}),
|
|
501
|
-
);
|
|
536
|
+
return newValue.substring(currentValue.length);
|
|
537
|
+
}, value),
|
|
538
|
+
).pipe(
|
|
539
|
+
mergeMap(textToType => {
|
|
540
|
+
if (!textToType) {
|
|
541
|
+
return of(undefined);
|
|
542
|
+
}
|
|
543
|
+
return from(handle.type(textToType));
|
|
544
|
+
}),
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
return fillDirectly();
|
|
502
548
|
case 'other-input':
|
|
503
|
-
return
|
|
504
|
-
mergeMap(() => {
|
|
505
|
-
return from(
|
|
506
|
-
handle.evaluate((input, value) => {
|
|
507
|
-
(input as HTMLInputElement).value = value;
|
|
508
|
-
input.dispatchEvent(
|
|
509
|
-
new Event('input', {bubbles: true}),
|
|
510
|
-
);
|
|
511
|
-
input.dispatchEvent(
|
|
512
|
-
new Event('change', {bubbles: true}),
|
|
513
|
-
);
|
|
514
|
-
}, value),
|
|
515
|
-
);
|
|
516
|
-
}),
|
|
517
|
-
);
|
|
549
|
+
return fillDirectly();
|
|
518
550
|
case 'unknown':
|
|
519
551
|
throw new Error(`Element cannot be filled out.`);
|
|
520
552
|
}
|
|
@@ -716,7 +748,7 @@ export abstract class Locator<T> extends EventEmitter<LocatorEvents> {
|
|
|
716
748
|
fill<ElementType extends Element>(
|
|
717
749
|
this: Locator<ElementType>,
|
|
718
750
|
value: string,
|
|
719
|
-
options?: Readonly<
|
|
751
|
+
options?: Readonly<LocatorFillOptions>,
|
|
720
752
|
): Promise<void> {
|
|
721
753
|
return firstValueFrom(this.#fill(value, options));
|
|
722
754
|
}
|
|
@@ -25,8 +25,7 @@ import type {Page} from '../api/Page.js';
|
|
|
25
25
|
import type {Target} from '../api/Target.js';
|
|
26
26
|
import type {Connection as CdpConnection} from '../cdp/Connection.js';
|
|
27
27
|
import type {SupportedWebDriverCapabilities} from '../common/ConnectOptions.js';
|
|
28
|
-
import {ProtocolError} from '../common/Errors.js';
|
|
29
|
-
import {UnsupportedOperation} from '../common/Errors.js';
|
|
28
|
+
import {ProtocolError, UnsupportedOperation} from '../common/Errors.js';
|
|
30
29
|
import {EventEmitter} from '../common/EventEmitter.js';
|
|
31
30
|
import {debugError} from '../common/util.js';
|
|
32
31
|
import type {Viewport} from '../common/Viewport.js';
|
|
@@ -306,15 +305,41 @@ export class BidiBrowser extends Browser {
|
|
|
306
305
|
throw new UnsupportedOperation();
|
|
307
306
|
}
|
|
308
307
|
|
|
309
|
-
override getWindowBounds(
|
|
310
|
-
|
|
308
|
+
override async getWindowBounds(windowId: WindowId): Promise<WindowBounds> {
|
|
309
|
+
const clientWindowInfo =
|
|
310
|
+
await this.#browserCore.getClientWindowInfo(windowId);
|
|
311
|
+
return {
|
|
312
|
+
left: clientWindowInfo.x,
|
|
313
|
+
top: clientWindowInfo.y,
|
|
314
|
+
width: clientWindowInfo.width,
|
|
315
|
+
height: clientWindowInfo.height,
|
|
316
|
+
windowState: clientWindowInfo.state,
|
|
317
|
+
};
|
|
311
318
|
}
|
|
312
319
|
|
|
313
|
-
override setWindowBounds(
|
|
314
|
-
|
|
315
|
-
|
|
320
|
+
override async setWindowBounds(
|
|
321
|
+
windowId: WindowId,
|
|
322
|
+
windowBounds: WindowBounds,
|
|
316
323
|
): Promise<void> {
|
|
317
|
-
|
|
324
|
+
let params: Bidi.Browser.SetClientWindowStateParameters | undefined;
|
|
325
|
+
const windowState = windowBounds.windowState ?? 'normal';
|
|
326
|
+
if (windowState === 'normal') {
|
|
327
|
+
params = {
|
|
328
|
+
clientWindow: windowId,
|
|
329
|
+
state: 'normal',
|
|
330
|
+
x: windowBounds.left,
|
|
331
|
+
y: windowBounds.top,
|
|
332
|
+
width: windowBounds.width,
|
|
333
|
+
height: windowBounds.height,
|
|
334
|
+
};
|
|
335
|
+
} else {
|
|
336
|
+
params = {
|
|
337
|
+
clientWindow: windowId,
|
|
338
|
+
state: windowState,
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
await this.#browserCore.setClientWindowState(params);
|
|
318
343
|
}
|
|
319
344
|
|
|
320
345
|
override targets(): Target[] {
|
|
@@ -6,13 +6,19 @@
|
|
|
6
6
|
|
|
7
7
|
import * as Bidi from 'webdriver-bidi-protocol';
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type {
|
|
10
|
+
CreatePageOptions,
|
|
11
|
+
Permission,
|
|
12
|
+
PermissionDescriptor,
|
|
13
|
+
PermissionState,
|
|
14
|
+
} from '../api/Browser.js';
|
|
10
15
|
import {WEB_PERMISSION_TO_PROTOCOL_PERMISSION} from '../api/Browser.js';
|
|
11
16
|
import type {BrowserContextEvents} from '../api/BrowserContext.js';
|
|
12
17
|
import {BrowserContext, BrowserContextEvent} from '../api/BrowserContext.js';
|
|
13
18
|
import {PageEvent, type Page} from '../api/Page.js';
|
|
14
19
|
import type {Target} from '../api/Target.js';
|
|
15
20
|
import type {Cookie, CookieData} from '../common/Cookie.js';
|
|
21
|
+
import {UnsupportedOperation} from '../common/Errors.js';
|
|
16
22
|
import {EventEmitter} from '../common/EventEmitter.js';
|
|
17
23
|
import {debugError} from '../common/util.js';
|
|
18
24
|
import type {Viewport} from '../common/Viewport.js';
|
|
@@ -199,8 +205,20 @@ export class BidiBrowserContext extends BrowserContext {
|
|
|
199
205
|
if (this.#defaultViewport) {
|
|
200
206
|
try {
|
|
201
207
|
await page.setViewport(this.#defaultViewport);
|
|
202
|
-
} catch {
|
|
203
|
-
//
|
|
208
|
+
} catch (error) {
|
|
209
|
+
// Tolerate not supporting `browsingContext.setViewport`. Only log it.
|
|
210
|
+
debugError(error);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (options?.type === 'window' && options?.windowBounds !== undefined) {
|
|
214
|
+
try {
|
|
215
|
+
await this.browser().setWindowBounds(
|
|
216
|
+
context.windowId,
|
|
217
|
+
options.windowBounds,
|
|
218
|
+
);
|
|
219
|
+
} catch (error) {
|
|
220
|
+
// Tolerate not supporting `browser.setClientWindowState`. Only log it.
|
|
221
|
+
debugError(error);
|
|
204
222
|
}
|
|
205
223
|
}
|
|
206
224
|
|
|
@@ -270,6 +288,46 @@ export class BidiBrowserContext extends BrowserContext {
|
|
|
270
288
|
);
|
|
271
289
|
}
|
|
272
290
|
|
|
291
|
+
override async setPermission(
|
|
292
|
+
origin: string | '*',
|
|
293
|
+
...permissions: Array<{
|
|
294
|
+
permission: PermissionDescriptor;
|
|
295
|
+
state: PermissionState;
|
|
296
|
+
}>
|
|
297
|
+
): Promise<void> {
|
|
298
|
+
if (origin === '*') {
|
|
299
|
+
throw new UnsupportedOperation(
|
|
300
|
+
'Origin (*) is not supported by WebDriver BiDi',
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
await Promise.all(
|
|
304
|
+
permissions.map(permission => {
|
|
305
|
+
if (permission.permission.allowWithoutSanitization) {
|
|
306
|
+
throw new UnsupportedOperation(
|
|
307
|
+
'allowWithoutSanitization is not supported by WebDriver BiDi',
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
if (permission.permission.panTiltZoom) {
|
|
311
|
+
throw new UnsupportedOperation(
|
|
312
|
+
'panTiltZoom is not supported by WebDriver BiDi',
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
if (permission.permission.userVisibleOnly) {
|
|
316
|
+
throw new UnsupportedOperation(
|
|
317
|
+
'userVisibleOnly is not supported by WebDriver BiDi',
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
return this.userContext.setPermissions(
|
|
321
|
+
origin,
|
|
322
|
+
{
|
|
323
|
+
name: permission.permission.name,
|
|
324
|
+
},
|
|
325
|
+
permission.state as Bidi.Permissions.PermissionState,
|
|
326
|
+
);
|
|
327
|
+
}),
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
|
|
273
331
|
override async clearPermissionOverrides(): Promise<void> {
|
|
274
332
|
const promises = this.#overrides.map(({permission, origin}) => {
|
|
275
333
|
return this.userContext
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
} from '../common/ConsoleMessage.js';
|
|
38
38
|
import {TargetCloseError, UnsupportedOperation} from '../common/Errors.js';
|
|
39
39
|
import type {TimeoutSettings} from '../common/TimeoutSettings.js';
|
|
40
|
-
import type {Awaitable} from '../common/types.js';
|
|
40
|
+
import type {Awaitable, HandleFor} from '../common/types.js';
|
|
41
41
|
import {
|
|
42
42
|
debugError,
|
|
43
43
|
fromAbortSignal,
|
|
@@ -52,7 +52,7 @@ import type {Navigation} from './core/Navigation.js';
|
|
|
52
52
|
import type {Request} from './core/Request.js';
|
|
53
53
|
import {BidiDeserializer} from './Deserializer.js';
|
|
54
54
|
import {BidiDialog} from './Dialog.js';
|
|
55
|
-
import
|
|
55
|
+
import {BidiElementHandle} from './ElementHandle.js';
|
|
56
56
|
import {ExposableFunction} from './ExposedFunction.js';
|
|
57
57
|
import {BidiHTTPRequest, requests} from './HTTPRequest.js';
|
|
58
58
|
import type {BidiHTTPResponse} from './HTTPResponse.js';
|
|
@@ -606,6 +606,27 @@ export class BidiFrame extends Frame {
|
|
|
606
606
|
);
|
|
607
607
|
}
|
|
608
608
|
|
|
609
|
+
@throwIfDetached
|
|
610
|
+
override async frameElement(): Promise<HandleFor<HTMLIFrameElement> | null> {
|
|
611
|
+
const parentFrame = this.parentFrame();
|
|
612
|
+
if (!parentFrame) {
|
|
613
|
+
return null;
|
|
614
|
+
}
|
|
615
|
+
const [node] = await parentFrame.browsingContext.locateNodes({
|
|
616
|
+
type: 'context',
|
|
617
|
+
value: {
|
|
618
|
+
context: this._id,
|
|
619
|
+
},
|
|
620
|
+
});
|
|
621
|
+
if (!node) {
|
|
622
|
+
return null;
|
|
623
|
+
}
|
|
624
|
+
return BidiElementHandle.from(
|
|
625
|
+
node,
|
|
626
|
+
parentFrame.mainRealm(),
|
|
627
|
+
) as HandleFor<HTMLIFrameElement>;
|
|
628
|
+
}
|
|
629
|
+
|
|
609
630
|
@throwIfDetached
|
|
610
631
|
async locateNodes(
|
|
611
632
|
element: BidiElementHandle,
|
|
@@ -18,6 +18,7 @@ import type {HTTPResponse} from '../api/HTTPResponse.js';
|
|
|
18
18
|
import type {
|
|
19
19
|
Credentials,
|
|
20
20
|
GeolocationOptions,
|
|
21
|
+
HeapSnapshotOptions,
|
|
21
22
|
MediaFeature,
|
|
22
23
|
PageEvents,
|
|
23
24
|
ReloadOptions,
|
|
@@ -227,8 +228,8 @@ export class BidiPage extends Page {
|
|
|
227
228
|
throw new UnsupportedOperation();
|
|
228
229
|
}
|
|
229
230
|
|
|
230
|
-
override windowId(): Promise<WindowId> {
|
|
231
|
-
|
|
231
|
+
override async windowId(): Promise<WindowId> {
|
|
232
|
+
return this.#frame.browsingContext.windowId;
|
|
232
233
|
}
|
|
233
234
|
|
|
234
235
|
override openDevTools(): Promise<Page> {
|
|
@@ -952,6 +953,12 @@ export class BidiPage extends Page {
|
|
|
952
953
|
throw new UnsupportedOperation();
|
|
953
954
|
}
|
|
954
955
|
|
|
956
|
+
override async captureHeapSnapshot(
|
|
957
|
+
_options: HeapSnapshotOptions,
|
|
958
|
+
): Promise<void> {
|
|
959
|
+
throw new UnsupportedOperation();
|
|
960
|
+
}
|
|
961
|
+
|
|
955
962
|
override async goBack(
|
|
956
963
|
options: WaitForOptions = {},
|
|
957
964
|
): Promise<HTTPResponse | null> {
|
|
@@ -1153,17 +1160,31 @@ export function cdpSpecificCookiePropertiesFromPuppeteerToBidi(
|
|
|
1153
1160
|
function convertCookiesSameSiteBiDiToCdp(
|
|
1154
1161
|
sameSite: Bidi.Network.SameSite | undefined,
|
|
1155
1162
|
): CookieSameSite {
|
|
1156
|
-
|
|
1163
|
+
switch (sameSite) {
|
|
1164
|
+
case 'strict':
|
|
1165
|
+
return 'Strict';
|
|
1166
|
+
case 'lax':
|
|
1167
|
+
return 'Lax';
|
|
1168
|
+
case 'none':
|
|
1169
|
+
return 'None';
|
|
1170
|
+
default:
|
|
1171
|
+
return 'Default';
|
|
1172
|
+
}
|
|
1157
1173
|
}
|
|
1158
1174
|
|
|
1159
1175
|
export function convertCookiesSameSiteCdpToBiDi(
|
|
1160
1176
|
sameSite: CookieSameSite | undefined,
|
|
1161
1177
|
): Bidi.Network.SameSite {
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1178
|
+
switch (sameSite) {
|
|
1179
|
+
case 'Strict':
|
|
1180
|
+
return Bidi.Network.SameSite.Strict;
|
|
1181
|
+
case 'Lax':
|
|
1182
|
+
return Bidi.Network.SameSite.Lax;
|
|
1183
|
+
case 'None':
|
|
1184
|
+
return Bidi.Network.SameSite.None;
|
|
1185
|
+
default:
|
|
1186
|
+
return Bidi.Network.SameSite.Default;
|
|
1187
|
+
}
|
|
1167
1188
|
}
|
|
1168
1189
|
|
|
1169
1190
|
export function convertCookiesExpiryCdpToBiDi(
|
|
@@ -286,6 +286,36 @@ export class Browser extends EventEmitter<{
|
|
|
286
286
|
await this.session.send('webExtension.uninstall', {extension: id});
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
+
@throwIfDisposed<Browser>(browser => {
|
|
290
|
+
// SAFETY: By definition of `disposed`, `#reason` is defined.
|
|
291
|
+
return browser.#reason!;
|
|
292
|
+
})
|
|
293
|
+
async setClientWindowState(
|
|
294
|
+
params: Bidi.Browser.SetClientWindowStateParameters,
|
|
295
|
+
): Promise<void> {
|
|
296
|
+
await this.session.send('browser.setClientWindowState', params);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
@throwIfDisposed<Browser>(browser => {
|
|
300
|
+
// SAFETY: By definition of `disposed`, `#reason` is defined.
|
|
301
|
+
return browser.#reason!;
|
|
302
|
+
})
|
|
303
|
+
async getClientWindowInfo(
|
|
304
|
+
windowId: string,
|
|
305
|
+
): Promise<Bidi.Browser.ClientWindowInfo> {
|
|
306
|
+
const {
|
|
307
|
+
result: {clientWindows},
|
|
308
|
+
} = await this.session.send('browser.getClientWindows', {});
|
|
309
|
+
|
|
310
|
+
const window = clientWindows.find(window => {
|
|
311
|
+
return window.clientWindow === windowId;
|
|
312
|
+
});
|
|
313
|
+
if (!window) {
|
|
314
|
+
throw new Error('Window not found');
|
|
315
|
+
}
|
|
316
|
+
return window;
|
|
317
|
+
}
|
|
318
|
+
|
|
289
319
|
override [disposeSymbol](): void {
|
|
290
320
|
this.#reason ??=
|
|
291
321
|
'Browser was disconnected, probably because the session ended.';
|
|
@@ -140,6 +140,7 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
140
140
|
id: string,
|
|
141
141
|
url: string,
|
|
142
142
|
originalOpener: string | null,
|
|
143
|
+
clientWindow: string,
|
|
143
144
|
): BrowsingContext {
|
|
144
145
|
const browsingContext = new BrowsingContext(
|
|
145
146
|
userContext,
|
|
@@ -147,6 +148,7 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
147
148
|
id,
|
|
148
149
|
url,
|
|
149
150
|
originalOpener,
|
|
151
|
+
clientWindow,
|
|
150
152
|
);
|
|
151
153
|
browsingContext.#initialize();
|
|
152
154
|
return browsingContext;
|
|
@@ -166,6 +168,7 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
166
168
|
readonly parent: BrowsingContext | undefined;
|
|
167
169
|
readonly userContext: UserContext;
|
|
168
170
|
readonly originalOpener: string | null;
|
|
171
|
+
readonly windowId: string;
|
|
169
172
|
readonly #emulationState: {
|
|
170
173
|
javaScriptEnabled: boolean;
|
|
171
174
|
} = {javaScriptEnabled: true};
|
|
@@ -178,6 +181,7 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
178
181
|
id: string,
|
|
179
182
|
url: string,
|
|
180
183
|
originalOpener: string | null,
|
|
184
|
+
clientWindow: string,
|
|
181
185
|
) {
|
|
182
186
|
super();
|
|
183
187
|
|
|
@@ -186,6 +190,7 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
186
190
|
this.parent = parent;
|
|
187
191
|
this.userContext = userContext;
|
|
188
192
|
this.originalOpener = originalOpener;
|
|
193
|
+
this.windowId = clientWindow;
|
|
189
194
|
|
|
190
195
|
this.defaultRealm = this.#createWindowRealm();
|
|
191
196
|
this.#bluetoothEmulation = new BidiBluetoothEmulation(
|
|
@@ -226,6 +231,7 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
226
231
|
info.context,
|
|
227
232
|
info.url,
|
|
228
233
|
info.originalOpener,
|
|
234
|
+
info.clientWindow,
|
|
229
235
|
);
|
|
230
236
|
this.#children.set(info.context, browsingContext);
|
|
231
237
|
|
|
@@ -740,13 +746,18 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
740
746
|
})
|
|
741
747
|
async locateNodes(
|
|
742
748
|
locator: Bidi.BrowsingContext.Locator,
|
|
743
|
-
startNodes:
|
|
749
|
+
startNodes: Bidi.Script.SharedReference[] = [],
|
|
744
750
|
): Promise<Bidi.Script.NodeRemoteValue[]> {
|
|
745
751
|
// TODO: add other locateNodes options if needed.
|
|
746
752
|
const result = await this.#session.send('browsingContext.locateNodes', {
|
|
747
753
|
context: this.id,
|
|
748
754
|
locator,
|
|
749
|
-
startNodes: startNodes.length
|
|
755
|
+
startNodes: startNodes.length
|
|
756
|
+
? (startNodes as [
|
|
757
|
+
Bidi.Script.SharedReference,
|
|
758
|
+
...Bidi.Script.SharedReference[],
|
|
759
|
+
])
|
|
760
|
+
: undefined,
|
|
750
761
|
});
|
|
751
762
|
return result.result.nodes;
|
|
752
763
|
}
|