chrome-devtools-frontend 1.0.1736236 → 1.0.1739869
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/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +1 -1
- package/.agents/skills/version-control/SKILL.md +63 -11
- package/.stylelintrc.json +3 -1
- package/docs/devtools-protocol.md +3 -1
- package/eslint.config.mjs +127 -6
- package/front_end/application_tokens.css +0 -30
- package/front_end/core/host/AidaClient.ts +14 -36
- package/front_end/core/host/AidaGcaTranslation.ts +8 -5
- package/front_end/core/root/Runtime.ts +0 -5
- package/front_end/core/sdk/SourceMap.ts +30 -3
- package/front_end/core/sdk/SourceMapRangeMappings.ts +57 -0
- package/front_end/design_system_tokens.css +1 -0
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +5 -9
- package/front_end/entrypoints/main/GlobalAiButton.ts +2 -9
- package/front_end/entrypoints/main/MainImpl.ts +0 -4
- package/front_end/generated/SupportedCSSProperties.ts +24 -23
- package/front_end/models/ai-utils/AiUtils.ts +1 -5
- package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -18
- package/front_end/models/ai_assistance/contexts/FileContext.ts +1 -2
- package/front_end/models/ai_assistance/tools/ListSources.ts +3 -1
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +0 -6
- package/front_end/models/javascript_metadata/NativeFunctions.ts +9 -5
- package/front_end/models/trace/EventsSerializer.ts +0 -8
- package/front_end/models/trace/extras/TraceFilter.ts +16 -8
- package/front_end/models/trace/extras/TraceTree.ts +104 -67
- package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +0 -5
- package/front_end/models/trace/handlers/RendererHandler.ts +7 -6
- package/front_end/models/trace/handlers/SamplesHandler.ts +1 -1
- package/front_end/models/trace/helpers/Extensions.ts +1 -3
- package/front_end/models/trace/helpers/SamplesIntegrator.ts +155 -87
- package/front_end/models/trace/helpers/Trace.ts +15 -12
- package/front_end/models/trace/helpers/TreeHelpers.ts +38 -10
- package/front_end/models/trace/insights/SlowCSSSelector.ts +3 -3
- package/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +19 -4
- package/front_end/models/workspace/UISourceCode.ts +30 -8
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -7
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +15 -34
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -16
- package/front_end/panels/ai_assistance/components/chatView.css +0 -212
- package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/animation/animationTimeline.css +5 -3
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +66 -3
- package/front_end/panels/application/PrivateVerificationTokensView.ts +114 -26
- package/front_end/panels/application/ResourcesPanel.ts +1 -0
- package/front_end/panels/application/backgroundServiceView.css +2 -2
- package/front_end/panels/application/components/backForwardCacheView.css +1 -1
- package/front_end/panels/application/components/permissionsPolicySection.css +0 -4
- package/front_end/panels/application/frameDetailsReportView.css +0 -7
- package/front_end/panels/application/indexedDBViews.css +3 -3
- package/front_end/panels/application/privateVerificationTokensView.css +6 -0
- package/front_end/panels/application/resourcesPanel.css +0 -48
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +1 -1
- package/front_end/panels/application/serviceWorkersView.css +2 -2
- package/front_end/panels/comments/CommentsPane.ts +1 -1
- package/front_end/panels/comments/commentsPane.css +1 -1
- package/front_end/panels/common/common.ts +0 -1
- package/front_end/panels/console/ConsoleView.ts +11 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +5 -1
- package/front_end/panels/console/consolePinPane.css +1 -1
- package/front_end/panels/console/consoleView.css +6 -5
- package/front_end/panels/elements/DOMTreeWidget.ts +47 -5
- package/front_end/panels/elements/StylePropertiesSection.ts +4 -9
- package/front_end/panels/elements/StylePropertyTreeElement.ts +52 -34
- package/front_end/panels/elements/classesPaneWidget.css +3 -7
- package/front_end/panels/elements/components/CSSQuery.ts +6 -5
- package/front_end/panels/elements/layoutPane.css +0 -1
- package/front_end/panels/elements/metricsSidebarPane.css +2 -2
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +0 -6
- package/front_end/panels/elements/stylesSidebarPane.css +0 -1
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +1 -0
- package/front_end/panels/emulation/deviceModeView.css +0 -1
- package/front_end/panels/explain/components/consoleInsight.css +1 -6
- package/front_end/panels/issues/AffectedBlockedByResponseView.ts +88 -46
- package/front_end/panels/issues/AffectedHeavyAdView.ts +72 -43
- package/front_end/panels/issues/AffectedResourcesView.ts +81 -13
- package/front_end/panels/issues/GenericIssueDetailsView.ts +112 -32
- package/front_end/panels/issues/issues.ts +2 -0
- package/front_end/panels/issues/issuesTree.css +9 -2
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +34 -17
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +39 -17
- package/front_end/panels/layer_viewer/Layers3DView.ts +34 -13
- package/front_end/panels/layer_viewer/layerDetailsView.css +2 -2
- package/front_end/panels/layer_viewer/layers3DView.css +0 -4
- package/front_end/panels/lighthouse/lighthousePanel.css +0 -9
- package/front_end/panels/linear_memory_inspector/components/linearMemoryValueInterpreter.css +2 -2
- package/front_end/panels/media/playerListView.css +0 -18
- package/front_end/panels/media/playerPropertiesView.css +1 -1
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +2 -2
- package/front_end/panels/network/NetworkLogView.ts +9 -2
- package/front_end/panels/network/NetworkWaterfallColumn.ts +22 -10
- package/front_end/panels/network/RequestPreviewView.ts +182 -63
- package/front_end/panels/network/RequestTimingView.ts +16 -2
- package/front_end/panels/network/SignedExchangeInfoView.ts +242 -158
- package/front_end/panels/network/networkConfigView.css +3 -3
- package/front_end/panels/network/networkLogView.css +4 -16
- package/front_end/panels/network/networkPanel.css +0 -7
- package/front_end/panels/network/networkTimingTable.css +12 -27
- package/front_end/panels/network/signedExchangeInfoView.css +12 -8
- package/front_end/panels/performance_monitor/performanceMonitor.css +2 -2
- package/front_end/panels/profiler/IsolateSelector.ts +31 -10
- package/front_end/panels/profiler/profilesPanel.css +0 -19
- package/front_end/panels/protocol_monitor/JSONEditor.css +1 -1
- package/front_end/panels/recorder/ControlButton.ts +1 -1
- package/front_end/panels/recorder/RecordingView.ts +22 -1
- package/front_end/panels/recorder/StepView.ts +26 -1
- package/front_end/panels/recorder/TimelineSection.ts +22 -6
- package/front_end/panels/recorder/controlButton.css +2 -9
- package/front_end/panels/recorder/recorderPanel.css +0 -1
- package/front_end/panels/recorder/recordingView.css +32 -32
- package/front_end/panels/recorder/replaySection.css +2 -0
- package/front_end/panels/recorder/stepView.css +18 -14
- package/front_end/panels/recorder/timelineSection.css +60 -84
- package/front_end/panels/screencast/screencastView.css +2 -2
- package/front_end/panels/search/searchView.css +1 -1
- package/front_end/panels/security/SecurityPanel.ts +474 -418
- package/front_end/panels/security/SecurityPanelSidebar.ts +68 -48
- package/front_end/panels/security/lockIcon.css +52 -50
- package/front_end/panels/security/mainView.css +149 -145
- package/front_end/panels/security/originView.css +117 -115
- package/front_end/panels/sensors/LocationsSettingsTab.ts +2 -50
- package/front_end/panels/sensors/SensorsView.ts +6 -21
- package/front_end/panels/sensors/locationsSettingsTab.css +1 -21
- package/front_end/panels/settings/AISettingsTab.ts +1 -2
- package/front_end/panels/settings/SettingsScreen.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +31 -6
- package/front_end/panels/sources/NavigatorView.ts +105 -31
- package/front_end/panels/sources/breakpointsView.css +5 -3
- package/front_end/panels/sources/scopeChainSidebarPane.css +1 -1
- package/front_end/panels/sources/sourcesView.css +2 -1
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +18 -5
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -0
- package/front_end/panels/timeline/TimelineController.ts +30 -26
- package/front_end/panels/timeline/TimelineDetailsView.ts +10 -9
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +4 -16
- package/front_end/panels/timeline/TimelineLayersView.ts +108 -46
- package/front_end/panels/timeline/TimelineMiniMap.ts +132 -54
- package/front_end/panels/timeline/TimelinePanel.ts +4 -2
- package/front_end/panels/timeline/TimelineTreeView.ts +25 -9
- package/front_end/panels/timeline/components/DetailsView.ts +7 -14
- package/front_end/panels/timeline/components/NetworkTrackWidget.ts +5 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
- package/front_end/panels/timeline/components/interactionBreakdown.css +1 -0
- package/front_end/panels/timeline/components/networkRequestDetails.css +2 -1
- package/front_end/panels/timeline/components/networkTrackWidget.css +1 -1
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -0
- package/front_end/panels/timeline/docs/profile_calls.md +7 -9
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +0 -7
- package/front_end/panels/timeline/timelineDetailsView.css +2 -2
- package/front_end/panels/web_audio/webAudio.css +1 -2
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
- package/front_end/panels/webauthn/webauthnPane.css +1 -1
- package/front_end/panels/whats_new/ReleaseNoteText.ts +6 -6
- package/front_end/panels/whats_new/resources/WNDT.md +6 -6
- package/front_end/third_party/axe-core/README.chromium +2 -3
- 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 +328 -11
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +907 -588
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +119 -1
- 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.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts +120 -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.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.d.ts +16 -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 +5 -1
- 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/HTTPResponse.d.ts +26 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +23 -3
- 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 +21 -14
- 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 +5 -5
- 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 +4 -4
- 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/Browser.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js +158 -67
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js +28 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.d.ts +4 -0
- 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 +19 -11
- 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/HTTPResponse.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +17 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.js +62 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.d.ts +29 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.js +60 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts +9 -1
- 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 +24 -9
- 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/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js +16 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.d.ts +6 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.js +37 -20
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js +10 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Navigation.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Navigation.js +18 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Navigation.js.map +1 -1
- 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 +24 -5
- 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/Binding.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js +6 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExtensionTransport.js +30 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.d.ts +5 -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 +12 -2
- 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/HTTPResponse.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +40 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.d.ts +23 -1
- 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 +37 -0
- 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 +2 -0
- 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 +74 -16
- 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 +34 -23
- 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/ResponseBodyStream.d.ts +10 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.js +94 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts +2 -2
- 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 +29 -1
- 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/cdp.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/utils.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/utils.js +6 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/utils.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConsoleMessage.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts +4 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js.map +1 -1
- 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 +34 -15
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts +3 -0
- 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 +11 -7
- 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/ChromeLauncher.js +10 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.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/util/decorators.js.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 +328 -11
- package/front_end/third_party/puppeteer/package/package.json +10 -8
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +118 -0
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +119 -0
- package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +25 -2
- package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +28 -0
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +65 -38
- package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +27 -7
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +43 -7
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +5 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +38 -8
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +27 -12
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +19 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Input.ts +72 -5
- package/front_end/third_party/puppeteer/package/src/bidi/NetworkEvents.ts +82 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +37 -13
- package/front_end/third_party/puppeteer/package/src/bidi/Realm.ts +26 -14
- package/front_end/third_party/puppeteer/package/src/bidi/core/Browser.ts +43 -22
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +13 -5
- package/front_end/third_party/puppeteer/package/src/bidi/core/Navigation.ts +21 -1
- package/front_end/third_party/puppeteer/package/src/bidi/core/Request.ts +27 -5
- package/front_end/third_party/puppeteer/package/src/cdp/Binding.ts +6 -4
- package/front_end/third_party/puppeteer/package/src/cdp/ExtensionTransport.ts +31 -6
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +5 -0
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +18 -1
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +48 -0
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkEventManager.ts +58 -5
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +94 -14
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +50 -28
- package/front_end/third_party/puppeteer/package/src/cdp/ResponseBodyStream.ts +106 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +38 -3
- package/front_end/third_party/puppeteer/package/src/cdp/cdp.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/cdp/utils.ts +6 -5
- package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +5 -0
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +17 -8
- package/front_end/third_party/puppeteer/package/src/common/util.ts +32 -15
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +21 -13
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +10 -10
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/decorators.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +2 -0
- package/front_end/ui/comments/CommentAnchorResolver.ts +45 -4
- package/front_end/ui/comments/CommentOverlayManager.ts +45 -12
- package/front_end/ui/components/buttons/FloatingButton.ts +2 -6
- package/front_end/ui/components/buttons/button.css +2 -2
- package/front_end/ui/components/buttons/floatingButton.css +0 -44
- package/front_end/ui/components/diff_view/diffView.css +0 -2
- package/front_end/ui/components/icon_button/iconButton.css +1 -1
- package/front_end/ui/components/markdown_view/markdownView.css +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +29 -0
- package/front_end/ui/components/tree_outline/treeOutline.css +1 -1
- package/front_end/ui/legacy/ContextMenu.ts +7 -5
- package/front_end/ui/legacy/InspectorDrawerView.ts +1 -0
- package/front_end/ui/legacy/InspectorView.ts +5 -1
- package/front_end/ui/legacy/PopoverHelper.ts +1 -0
- package/front_end/ui/legacy/RootView.ts +9 -3
- package/front_end/ui/legacy/SplitWidget.ts +1 -0
- package/front_end/ui/legacy/Treeoutline.ts +9 -0
- package/front_end/ui/legacy/UIUtils.ts +1 -1
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +130 -137
- package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +1 -0
- package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +3 -1
- package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +7 -6
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +34 -20
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +43 -14
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +2 -2
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -10
- package/front_end/ui/legacy/components/source_frame/imageView.css +2 -2
- package/front_end/ui/legacy/filter.css +7 -3
- package/front_end/ui/legacy/infobar.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +3 -55
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +3 -3
- package/front_end/ui/legacy/listWidget.css +3 -8
- package/front_end/ui/legacy/softDropDownButton.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +2 -9
- package/front_end/ui/legacy/treeoutline.css +3 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +134 -0
- package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
- package/inspector_overlay/tool_highlight.css +0 -7
- package/inspector_overlay/tool_highlight.ts +0 -1
- package/package.json +1 -1
- package/front_end/Images/geminiInDevTools.png +0 -0
- package/front_end/Images/geminiInDevTools_2x.png +0 -0
- package/front_end/generated/InspectorBackendCommands.ts +0 -1690
- package/front_end/generated/protocol-mapping.d.ts +0 -5986
- package/front_end/generated/protocol-proxy-api.d.ts +0 -5452
- package/front_end/generated/protocol.ts +0 -23364
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +0 -193
- package/front_end/panels/common/geminiRebrandPromoDialog.css +0 -47
|
@@ -20,6 +20,8 @@ import {
|
|
|
20
20
|
raceWith,
|
|
21
21
|
switchMap,
|
|
22
22
|
} from '../../third_party/rxjs/rxjs.js';
|
|
23
|
+
import {BrowserEvent} from '../api/Browser.js';
|
|
24
|
+
import {BrowserContextEvent} from '../api/BrowserContext.js';
|
|
23
25
|
import type {CDPSession} from '../api/CDPSession.js';
|
|
24
26
|
import type {DeviceRequestPrompt} from '../api/DeviceRequestPrompt.js';
|
|
25
27
|
import {
|
|
@@ -48,6 +50,7 @@ import {BidiElementHandle} from './ElementHandle.js';
|
|
|
48
50
|
import {ExposableFunction} from './ExposedFunction.js';
|
|
49
51
|
import {BidiHTTPRequest, requests} from './HTTPRequest.js';
|
|
50
52
|
import type {BidiHTTPResponse} from './HTTPResponse.js';
|
|
53
|
+
import {emitRequestFailed, emitRequestFinished} from './NetworkEvents.js';
|
|
51
54
|
import type {BidiPage} from './Page.js';
|
|
52
55
|
import type {BidiRealm} from './Realm.js';
|
|
53
56
|
import {BidiFrameRealm} from './Realm.js';
|
|
@@ -139,11 +142,11 @@ export class BidiFrame extends Frame {
|
|
|
139
142
|
this.logger,
|
|
140
143
|
);
|
|
141
144
|
request.once('success', () => {
|
|
142
|
-
this.page()
|
|
145
|
+
emitRequestFinished(this.page(), httpRequest);
|
|
143
146
|
});
|
|
144
147
|
|
|
145
148
|
request.once('error', () => {
|
|
146
|
-
this.page()
|
|
149
|
+
emitRequestFailed(this.page(), httpRequest);
|
|
147
150
|
});
|
|
148
151
|
void httpRequest.finalizeInterceptions();
|
|
149
152
|
});
|
|
@@ -174,17 +177,26 @@ export class BidiFrame extends Frame {
|
|
|
174
177
|
return;
|
|
175
178
|
}
|
|
176
179
|
if (isConsoleLogEntry(entry)) {
|
|
177
|
-
|
|
180
|
+
// Chromium sets `source.context` of dedicated worker logs to the frame
|
|
181
|
+
// that created the worker, so they pass the context check above. Since
|
|
182
|
+
// BidiWorkerRealm emits them with the correct worker and realm we can
|
|
183
|
+
// skip them here.
|
|
184
|
+
if (this.#isWorkerRealm(entry.source.realm)) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const page = this.page();
|
|
188
|
+
if (
|
|
189
|
+
!page.listenerCount(PageEvent.Console) &&
|
|
190
|
+
!page.browserContext().listenerCount(BrowserContextEvent.Console) &&
|
|
191
|
+
!page.browser().listenerCount(BrowserEvent.Console)
|
|
192
|
+
) {
|
|
178
193
|
return;
|
|
179
194
|
}
|
|
180
195
|
const args = entry.args.map(arg => {
|
|
181
196
|
return this.mainRealm().createHandle(arg);
|
|
182
197
|
});
|
|
183
198
|
|
|
184
|
-
|
|
185
|
-
PageEvent.Console,
|
|
186
|
-
getConsoleMessage(entry, args, this),
|
|
187
|
-
);
|
|
199
|
+
page.emitConsoleMessage(getConsoleMessage(entry, args, this));
|
|
188
200
|
} else if (isJavaScriptLogEntry(entry)) {
|
|
189
201
|
const error = new Error(entry.text ?? '');
|
|
190
202
|
|
|
@@ -224,6 +236,14 @@ export class BidiFrame extends Frame {
|
|
|
224
236
|
});
|
|
225
237
|
}
|
|
226
238
|
|
|
239
|
+
#isWorkerRealm(realmId: string): boolean {
|
|
240
|
+
return this.page()
|
|
241
|
+
.workers()
|
|
242
|
+
.some(worker => {
|
|
243
|
+
return worker.mainRealm().realm.id === realmId;
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
|
|
227
247
|
#createFrameTarget(browsingContext: BrowsingContext) {
|
|
228
248
|
const frame = BidiFrame.from(this, browsingContext, this.#logger);
|
|
229
249
|
this.#frames.set(browsingContext, frame);
|
|
@@ -384,7 +404,17 @@ export class BidiFrame extends Frame {
|
|
|
384
404
|
if (navigation === null) {
|
|
385
405
|
return of(null);
|
|
386
406
|
}
|
|
387
|
-
|
|
407
|
+
// Wait for the commit before the lifecycle events. Lifecycle
|
|
408
|
+
// events of the previous document (e.g. the error page of a
|
|
409
|
+
// failed navigation) can come after this navigation starts.
|
|
410
|
+
return fromEmitterEvent(
|
|
411
|
+
this.browsingContext,
|
|
412
|
+
'navigationCommitted',
|
|
413
|
+
).pipe(
|
|
414
|
+
first(),
|
|
415
|
+
switchMap(() => {
|
|
416
|
+
return this.#waitForLoad$(options);
|
|
417
|
+
}),
|
|
388
418
|
delayWhen(() => {
|
|
389
419
|
if (frames.length === 0) {
|
|
390
420
|
return of(undefined);
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
handleError,
|
|
20
20
|
InterceptResolutionAction,
|
|
21
21
|
} from '../api/HTTPRequest.js';
|
|
22
|
-
import {
|
|
22
|
+
import type {WebWorker} from '../api/WebWorker.js';
|
|
23
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';
|
|
@@ -27,6 +27,12 @@ import {stringToBase64} from '../util/encoding.js';
|
|
|
27
27
|
import type {Request} from './core/Request.js';
|
|
28
28
|
import type {BidiFrame} from './Frame.js';
|
|
29
29
|
import {BidiHTTPResponse} from './HTTPResponse.js';
|
|
30
|
+
import {
|
|
31
|
+
emitRequest,
|
|
32
|
+
emitRequestFailed,
|
|
33
|
+
emitRequestFinished,
|
|
34
|
+
} from './NetworkEvents.js';
|
|
35
|
+
import type {BidiPage} from './Page.js';
|
|
30
36
|
|
|
31
37
|
export const requests = new WeakMap<Request, BidiHTTPRequest>();
|
|
32
38
|
|
|
@@ -94,15 +100,11 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
94
100
|
this.#redirectChain.push(this);
|
|
95
101
|
|
|
96
102
|
request.once('success', () => {
|
|
97
|
-
this.#frame
|
|
98
|
-
.page()
|
|
99
|
-
.trustedEmitter.emit(PageEvent.RequestFinished, httpRequest);
|
|
103
|
+
emitRequestFinished(this.#frame.page(), httpRequest);
|
|
100
104
|
});
|
|
101
105
|
|
|
102
106
|
request.once('error', () => {
|
|
103
|
-
this.#frame
|
|
104
|
-
.page()
|
|
105
|
-
.trustedEmitter.emit(PageEvent.RequestFailed, httpRequest);
|
|
107
|
+
emitRequestFailed(this.#frame.page(), httpRequest);
|
|
106
108
|
});
|
|
107
109
|
void httpRequest.finalizeInterceptions();
|
|
108
110
|
});
|
|
@@ -128,7 +130,7 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
128
130
|
});
|
|
129
131
|
this.#request.on('authenticate', this.#handleAuthentication);
|
|
130
132
|
|
|
131
|
-
this.#frame.page()
|
|
133
|
+
emitRequest(this.#frame.page(), this);
|
|
132
134
|
}
|
|
133
135
|
|
|
134
136
|
protected canBeIntercepted(): boolean {
|
|
@@ -136,7 +138,7 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
136
138
|
}
|
|
137
139
|
|
|
138
140
|
override interceptResolutionState(): InterceptResolutionState {
|
|
139
|
-
if (!this.#request.isBlocked) {
|
|
141
|
+
if (!this.#request.isBlocked && !this.interception.handled) {
|
|
140
142
|
return {action: InterceptResolutionAction.Disabled};
|
|
141
143
|
}
|
|
142
144
|
return super.interceptResolutionState();
|
|
@@ -220,6 +222,14 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
220
222
|
return this.#redirectChain.slice();
|
|
221
223
|
}
|
|
222
224
|
|
|
225
|
+
override worker(): WebWorker | null {
|
|
226
|
+
throw new UnsupportedOperation('Not available in WebDriver BiDi');
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
override page(): BidiPage {
|
|
230
|
+
return this.#frame.page();
|
|
231
|
+
}
|
|
232
|
+
|
|
223
233
|
override frame(): BidiFrame {
|
|
224
234
|
return this.#frame;
|
|
225
235
|
}
|
|
@@ -252,7 +262,7 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
252
262
|
this.interception.handled = true;
|
|
253
263
|
return await this.#request.failRequest().catch(error => {
|
|
254
264
|
this.interception.handled = false;
|
|
255
|
-
|
|
265
|
+
return handleError(error, this.#logger);
|
|
256
266
|
});
|
|
257
267
|
}
|
|
258
268
|
|
|
@@ -272,12 +282,17 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
272
282
|
parsedBody = HTTPRequest.getResponse(response.body);
|
|
273
283
|
}
|
|
274
284
|
|
|
275
|
-
|
|
285
|
+
let headers: Bidi.Network.Header[] = getBidiHeaders(response.headers);
|
|
276
286
|
const hasContentLength = headers.some(header => {
|
|
277
287
|
return header.name === 'content-length';
|
|
278
288
|
});
|
|
279
289
|
|
|
280
290
|
if (response.contentType) {
|
|
291
|
+
// Like the CDP implementation, `contentType` replaces a `content-type`
|
|
292
|
+
// passed in `headers` instead of sending both.
|
|
293
|
+
headers = headers.filter(header => {
|
|
294
|
+
return header.name !== 'content-type';
|
|
295
|
+
});
|
|
281
296
|
headers.push({
|
|
282
297
|
name: 'content-type',
|
|
283
298
|
value: {
|
|
@@ -312,7 +327,7 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
312
327
|
})
|
|
313
328
|
.catch(error => {
|
|
314
329
|
this.interception.handled = false;
|
|
315
|
-
|
|
330
|
+
return handleError(error, this.#logger);
|
|
316
331
|
});
|
|
317
332
|
}
|
|
318
333
|
|
|
@@ -8,13 +8,13 @@ import type * as Bidi from 'webdriver-bidi-protocol';
|
|
|
8
8
|
|
|
9
9
|
import type {Frame} from '../api/Frame.js';
|
|
10
10
|
import {HTTPResponse, type RemoteAddress} from '../api/HTTPResponse.js';
|
|
11
|
-
import {PageEvent} from '../api/Page.js';
|
|
12
11
|
import {UnsupportedOperation} from '../common/Errors.js';
|
|
13
12
|
import {SecurityDetails} from '../common/SecurityDetails.js';
|
|
14
13
|
import {invokeAtMostOnceForArguments} from '../util/decorators.js';
|
|
15
14
|
import {normalizeHeaderValue} from '../util/httpUtils.js';
|
|
16
15
|
|
|
17
16
|
import type {BidiHTTPRequest} from './HTTPRequest.js';
|
|
17
|
+
import {emitRequestServedFromCache, emitResponse} from './NetworkEvents.js';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @internal
|
|
@@ -67,12 +67,16 @@ export class BidiHTTPResponse extends HTTPResponse {
|
|
|
67
67
|
#initialize() {
|
|
68
68
|
if (this.#data.fromCache) {
|
|
69
69
|
this.#request._fromMemoryCache = true;
|
|
70
|
-
this.#request
|
|
71
|
-
.frame()
|
|
72
|
-
?.page()
|
|
73
|
-
.trustedEmitter.emit(PageEvent.RequestServedFromCache, this.#request);
|
|
74
70
|
}
|
|
75
|
-
|
|
71
|
+
// Requests from dedicated workers have no frame and are not reported.
|
|
72
|
+
const page = this.#request.frame()?.page();
|
|
73
|
+
if (!page) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (this.#data.fromCache) {
|
|
77
|
+
emitRequestServedFromCache(page, this.#request);
|
|
78
|
+
}
|
|
79
|
+
emitResponse(page, this);
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
@invokeAtMostOnceForArguments
|
|
@@ -147,6 +151,11 @@ export class BidiHTTPResponse extends HTTPResponse {
|
|
|
147
151
|
};
|
|
148
152
|
}
|
|
149
153
|
|
|
154
|
+
override encodedDataLength(): number {
|
|
155
|
+
// Chromium reports -1 when the size is unknown, e.g. for data: URLs.
|
|
156
|
+
return Math.max(this.#data.bytesReceived, 0);
|
|
157
|
+
}
|
|
158
|
+
|
|
150
159
|
override frame(): Frame | null {
|
|
151
160
|
return this.#request.frame();
|
|
152
161
|
}
|
|
@@ -165,4 +174,8 @@ export class BidiHTTPResponse extends HTTPResponse {
|
|
|
165
174
|
async content(): Promise<Uint8Array> {
|
|
166
175
|
return await this.#request.getResponseContent();
|
|
167
176
|
}
|
|
177
|
+
|
|
178
|
+
override stream(): never {
|
|
179
|
+
throw new UnsupportedOperation();
|
|
180
|
+
}
|
|
168
181
|
}
|
|
@@ -51,19 +51,30 @@ enum ActionType {
|
|
|
51
51
|
Scroll = 'scroll',
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
type SingleCharKey<K extends string> = K extends `${infer _}${infer Rest}`
|
|
55
|
+
? Rest extends ''
|
|
56
|
+
? K
|
|
57
|
+
: never
|
|
58
|
+
: never;
|
|
59
|
+
|
|
60
|
+
const isSingleCharKey = (key: KeyInput): key is SingleCharKey<KeyInput> => {
|
|
61
|
+
// Measures the number of code points rather than UTF-16 code units.
|
|
62
|
+
return [...key].length === 1;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const getBidiKeyValue = (key: KeyInput): string => {
|
|
55
66
|
switch (key) {
|
|
56
67
|
case '\r':
|
|
57
68
|
case '\n':
|
|
58
69
|
key = 'Enter';
|
|
59
70
|
break;
|
|
60
71
|
}
|
|
61
|
-
|
|
62
|
-
if ([...key].length === 1) {
|
|
72
|
+
if (isSingleCharKey(key)) {
|
|
63
73
|
return key;
|
|
64
74
|
}
|
|
65
75
|
switch (key) {
|
|
66
76
|
case 'Cancel':
|
|
77
|
+
case 'Abort':
|
|
67
78
|
return '\uE001';
|
|
68
79
|
case 'Help':
|
|
69
80
|
return '\uE002';
|
|
@@ -74,6 +85,8 @@ const getBidiKeyValue = (key: KeyInput) => {
|
|
|
74
85
|
case 'Clear':
|
|
75
86
|
return '\uE005';
|
|
76
87
|
case 'Enter':
|
|
88
|
+
return '\uE006';
|
|
89
|
+
case 'NumpadEnter':
|
|
77
90
|
return '\uE007';
|
|
78
91
|
case 'Shift':
|
|
79
92
|
case 'ShiftLeft':
|
|
@@ -269,9 +282,63 @@ const getBidiKeyValue = (key: KeyInput) => {
|
|
|
269
282
|
return ']';
|
|
270
283
|
case 'Quote':
|
|
271
284
|
return "'";
|
|
272
|
-
|
|
273
|
-
|
|
285
|
+
case 'Space':
|
|
286
|
+
return ' ';
|
|
287
|
+
// Keys not supported by WebDriver BiDi:
|
|
288
|
+
case 'Power':
|
|
289
|
+
case 'Eject':
|
|
290
|
+
case 'CapsLock':
|
|
291
|
+
case 'Convert':
|
|
292
|
+
case 'NonConvert':
|
|
293
|
+
case 'Select':
|
|
294
|
+
case 'Open':
|
|
295
|
+
case 'PrintScreen':
|
|
296
|
+
case 'ContextMenu':
|
|
297
|
+
case 'F13':
|
|
298
|
+
case 'F14':
|
|
299
|
+
case 'F15':
|
|
300
|
+
case 'F16':
|
|
301
|
+
case 'F17':
|
|
302
|
+
case 'F18':
|
|
303
|
+
case 'F19':
|
|
304
|
+
case 'F20':
|
|
305
|
+
case 'F21':
|
|
306
|
+
case 'F22':
|
|
307
|
+
case 'F23':
|
|
308
|
+
case 'F24':
|
|
309
|
+
case 'NumLock':
|
|
310
|
+
case 'ScrollLock':
|
|
311
|
+
case 'AudioVolumeMute':
|
|
312
|
+
case 'AudioVolumeDown':
|
|
313
|
+
case 'AudioVolumeUp':
|
|
314
|
+
case 'MediaTrackNext':
|
|
315
|
+
case 'MediaTrackPrevious':
|
|
316
|
+
case 'MediaStop':
|
|
317
|
+
case 'MediaPlayPause':
|
|
318
|
+
case 'AltGraph':
|
|
319
|
+
case 'Props':
|
|
320
|
+
case 'Accept':
|
|
321
|
+
case 'ModeChange':
|
|
322
|
+
case 'Print':
|
|
323
|
+
case 'Execute':
|
|
324
|
+
case 'Attn':
|
|
325
|
+
case 'CrSel':
|
|
326
|
+
case 'ExSel':
|
|
327
|
+
case 'EraseEof':
|
|
328
|
+
case 'Play':
|
|
329
|
+
case 'ZoomOut':
|
|
330
|
+
case 'SoftLeft':
|
|
331
|
+
case 'SoftRight':
|
|
332
|
+
case 'Camera':
|
|
333
|
+
case 'Call':
|
|
334
|
+
case 'EndCall':
|
|
335
|
+
case 'VolumeDown':
|
|
336
|
+
case 'VolumeUp':
|
|
337
|
+
throw new UnsupportedOperation(
|
|
338
|
+
`Key "${key}" is not supported by WebDriver BiDi.`,
|
|
339
|
+
);
|
|
274
340
|
}
|
|
341
|
+
throw new Error(`Unknown key: "${key satisfies never}"`);
|
|
275
342
|
};
|
|
276
343
|
|
|
277
344
|
/**
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google Inc.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {BrowserEvent} from '../api/Browser.js';
|
|
8
|
+
import {BrowserContextEvent} from '../api/BrowserContext.js';
|
|
9
|
+
import {PageEvent} from '../api/Page.js';
|
|
10
|
+
|
|
11
|
+
import type {BidiHTTPRequest} from './HTTPRequest.js';
|
|
12
|
+
import type {BidiHTTPResponse} from './HTTPResponse.js';
|
|
13
|
+
import type {BidiPage} from './Page.js';
|
|
14
|
+
|
|
15
|
+
// Network events are emitted on the page first, then on its browser context
|
|
16
|
+
// and finally on the browser.
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export function emitRequest(page: BidiPage, request: BidiHTTPRequest): void {
|
|
22
|
+
page.trustedEmitter.emit(PageEvent.Request, request);
|
|
23
|
+
page
|
|
24
|
+
.browserContext()
|
|
25
|
+
.trustedEmitter.emit(BrowserContextEvent.Request, request);
|
|
26
|
+
page.browser().trustedEmitter.emit(BrowserEvent.Request, request);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export function emitRequestServedFromCache(
|
|
33
|
+
page: BidiPage,
|
|
34
|
+
request: BidiHTTPRequest,
|
|
35
|
+
): void {
|
|
36
|
+
page.trustedEmitter.emit(PageEvent.RequestServedFromCache, request);
|
|
37
|
+
page
|
|
38
|
+
.browserContext()
|
|
39
|
+
.trustedEmitter.emit(BrowserContextEvent.RequestServedFromCache, request);
|
|
40
|
+
page
|
|
41
|
+
.browser()
|
|
42
|
+
.trustedEmitter.emit(BrowserEvent.RequestServedFromCache, request);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export function emitResponse(page: BidiPage, response: BidiHTTPResponse): void {
|
|
49
|
+
page.trustedEmitter.emit(PageEvent.Response, response);
|
|
50
|
+
page
|
|
51
|
+
.browserContext()
|
|
52
|
+
.trustedEmitter.emit(BrowserContextEvent.Response, response);
|
|
53
|
+
page.browser().trustedEmitter.emit(BrowserEvent.Response, response);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export function emitRequestFinished(
|
|
60
|
+
page: BidiPage,
|
|
61
|
+
request: BidiHTTPRequest,
|
|
62
|
+
): void {
|
|
63
|
+
page.trustedEmitter.emit(PageEvent.RequestFinished, request);
|
|
64
|
+
page
|
|
65
|
+
.browserContext()
|
|
66
|
+
.trustedEmitter.emit(BrowserContextEvent.RequestFinished, request);
|
|
67
|
+
page.browser().trustedEmitter.emit(BrowserEvent.RequestFinished, request);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
export function emitRequestFailed(
|
|
74
|
+
page: BidiPage,
|
|
75
|
+
request: BidiHTTPRequest,
|
|
76
|
+
): void {
|
|
77
|
+
page.trustedEmitter.emit(PageEvent.RequestFailed, request);
|
|
78
|
+
page
|
|
79
|
+
.browserContext()
|
|
80
|
+
.trustedEmitter.emit(BrowserContextEvent.RequestFailed, request);
|
|
81
|
+
page.browser().trustedEmitter.emit(BrowserEvent.RequestFailed, request);
|
|
82
|
+
}
|
|
@@ -9,7 +9,8 @@ import * as Bidi from 'webdriver-bidi-protocol';
|
|
|
9
9
|
|
|
10
10
|
import {firstValueFrom, from, raceWith} from '../../third_party/rxjs/rxjs.js';
|
|
11
11
|
import type {BluetoothEmulation} from '../api/BluetoothEmulation.js';
|
|
12
|
-
import type
|
|
12
|
+
import {BrowserEvent, type WindowId} from '../api/Browser.js';
|
|
13
|
+
import {BrowserContextEvent} from '../api/BrowserContext.js';
|
|
13
14
|
import type {CDPSession} from '../api/CDPSession.js';
|
|
14
15
|
import type {DeviceRequestPrompt} from '../api/DeviceRequestPrompt.js';
|
|
15
16
|
import type {BoundingBox} from '../api/ElementHandle.js';
|
|
@@ -43,6 +44,7 @@ import type {
|
|
|
43
44
|
} from '../cdp/NetworkManager.js';
|
|
44
45
|
import {Tracing} from '../cdp/Tracing.js';
|
|
45
46
|
import type {WebMCP} from '../cdp/WebMCP.js';
|
|
47
|
+
import type {ConsoleMessage} from '../common/ConsoleMessage.js';
|
|
46
48
|
import type {
|
|
47
49
|
CookiePartitionKey,
|
|
48
50
|
Cookie,
|
|
@@ -230,6 +232,21 @@ export class BidiPage extends Page {
|
|
|
230
232
|
return this.#browserContext;
|
|
231
233
|
}
|
|
232
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Emits the message on the page, then on the browser context and the
|
|
237
|
+
* browser, matching the CDP order.
|
|
238
|
+
*
|
|
239
|
+
* @internal
|
|
240
|
+
*/
|
|
241
|
+
emitConsoleMessage(message: ConsoleMessage): void {
|
|
242
|
+
this.trustedEmitter.emit(PageEvent.Console, message);
|
|
243
|
+
this.#browserContext.trustedEmitter.emit(
|
|
244
|
+
BrowserContextEvent.Console,
|
|
245
|
+
message,
|
|
246
|
+
);
|
|
247
|
+
this.browser().trustedEmitter.emit(BrowserEvent.Console, message);
|
|
248
|
+
}
|
|
249
|
+
|
|
233
250
|
override mainFrame(): BidiFrame {
|
|
234
251
|
return this.#frame;
|
|
235
252
|
}
|
|
@@ -376,7 +393,7 @@ export class BidiPage extends Page {
|
|
|
376
393
|
coordinates: {
|
|
377
394
|
latitude: options.latitude,
|
|
378
395
|
longitude: options.longitude,
|
|
379
|
-
accuracy
|
|
396
|
+
accuracy,
|
|
380
397
|
},
|
|
381
398
|
});
|
|
382
399
|
}
|
|
@@ -512,6 +529,7 @@ export class BidiPage extends Page {
|
|
|
512
529
|
pageRanges: ranges,
|
|
513
530
|
scale,
|
|
514
531
|
preferCSSPageSize,
|
|
532
|
+
waitForFonts,
|
|
515
533
|
} = parsePDFOptions(options, 'cm');
|
|
516
534
|
const pageRanges = ranges
|
|
517
535
|
? ranges.split(',').map(range => {
|
|
@@ -519,15 +537,17 @@ export class BidiPage extends Page {
|
|
|
519
537
|
})
|
|
520
538
|
: [];
|
|
521
539
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
.
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
540
|
+
if (waitForFonts) {
|
|
541
|
+
await firstValueFrom(
|
|
542
|
+
from(
|
|
543
|
+
this.mainFrame()
|
|
544
|
+
.isolatedRealm()
|
|
545
|
+
.evaluate(() => {
|
|
546
|
+
return document.fonts.ready;
|
|
547
|
+
}),
|
|
548
|
+
).pipe(raceWith(timeout(ms))),
|
|
549
|
+
);
|
|
550
|
+
}
|
|
531
551
|
|
|
532
552
|
const data = await firstValueFrom(
|
|
533
553
|
from(
|
|
@@ -667,7 +687,7 @@ export class BidiPage extends Page {
|
|
|
667
687
|
return false;
|
|
668
688
|
}
|
|
669
689
|
|
|
670
|
-
override async setCacheEnabled(enabled
|
|
690
|
+
override async setCacheEnabled(enabled = true): Promise<void> {
|
|
671
691
|
if (!this.#browserContext.browser().cdpSupported) {
|
|
672
692
|
await this.#frame.browsingContext.setCacheBehavior(
|
|
673
693
|
enabled ? 'default' : 'bypass',
|
|
@@ -1095,7 +1115,11 @@ function testUrlMatchCookieHostname(
|
|
|
1095
1115
|
// addresses which is fine as it is for representation and does not
|
|
1096
1116
|
// mean that cookies actually apply that way in the browser.
|
|
1097
1117
|
// https://datatracker.ietf.org/doc/html/rfc6265#section-5.1.3
|
|
1098
|
-
|
|
1118
|
+
// A leading dot marks a domain cookie, which also applies to the domain
|
|
1119
|
+
// itself, so `.example.com` matches both `example.com` and `a.example.com`.
|
|
1120
|
+
return (
|
|
1121
|
+
cookieDomain.startsWith('.') && `.${urlHostname}`.endsWith(cookieDomain)
|
|
1122
|
+
);
|
|
1099
1123
|
}
|
|
1100
1124
|
|
|
1101
1125
|
/**
|
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import * as Bidi from 'webdriver-bidi-protocol';
|
|
7
7
|
|
|
8
|
+
import {BrowserEvent} from '../api/Browser.js';
|
|
9
|
+
import {BrowserContextEvent} from '../api/BrowserContext.js';
|
|
8
10
|
import type {Extension} from '../api/Extension.js';
|
|
9
11
|
import type {JSHandle} from '../api/JSHandle.js';
|
|
12
|
+
import {PageEvent} from '../api/Page.js';
|
|
10
13
|
import {Realm} from '../api/Realm.js';
|
|
11
14
|
import {WebWorkerEvent} from '../api/WebWorker.js';
|
|
12
15
|
import {ARIAQueryHandler} from '../common/AriaQueryHandler.js';
|
|
@@ -440,23 +443,32 @@ export class BidiWorkerRealm extends BidiRealm {
|
|
|
440
443
|
override initialize(): void {
|
|
441
444
|
super.initialize();
|
|
442
445
|
this.realm.on('log', entry => {
|
|
446
|
+
if (!isConsoleLogEntry(entry)) {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
const page = this.#worker.frame.page();
|
|
450
|
+
const context = page.browserContext();
|
|
443
451
|
if (
|
|
444
|
-
|
|
445
|
-
|
|
452
|
+
!this.#worker.listenerCount(WebWorkerEvent.Console) &&
|
|
453
|
+
!page.listenerCount(PageEvent.Console) &&
|
|
454
|
+
!context.listenerCount(BrowserContextEvent.Console) &&
|
|
455
|
+
!context.browser().listenerCount(BrowserEvent.Console)
|
|
446
456
|
) {
|
|
447
|
-
|
|
448
|
-
return this.createHandle(arg);
|
|
449
|
-
});
|
|
450
|
-
|
|
451
|
-
const message = getConsoleMessage(
|
|
452
|
-
entry,
|
|
453
|
-
args,
|
|
454
|
-
undefined,
|
|
455
|
-
this.realm.id,
|
|
456
|
-
this.#worker,
|
|
457
|
-
);
|
|
458
|
-
this.#worker.emit(WebWorkerEvent.Console, message);
|
|
457
|
+
return;
|
|
459
458
|
}
|
|
459
|
+
const args = entry.args.map(arg => {
|
|
460
|
+
return this.createHandle(arg);
|
|
461
|
+
});
|
|
462
|
+
|
|
463
|
+
const message = getConsoleMessage(
|
|
464
|
+
entry,
|
|
465
|
+
args,
|
|
466
|
+
undefined,
|
|
467
|
+
this.realm.id,
|
|
468
|
+
this.#worker,
|
|
469
|
+
);
|
|
470
|
+
this.#worker.emit(WebWorkerEvent.Console, message);
|
|
471
|
+
page.emitConsoleMessage(message);
|
|
460
472
|
});
|
|
461
473
|
}
|
|
462
474
|
|