chrome-devtools-frontend 1.0.1555430 → 1.0.1558690
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/front_end/core/common/Object.ts +5 -1
- package/front_end/core/host/ResourceLoader.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/sdk/DOMModel.ts +7 -0
- package/front_end/core/sdk/NetworkManager.ts +0 -7
- package/front_end/core/sdk/SourceMap.ts +16 -2
- package/front_end/core/sdk/SourceMapManager.ts +1 -1
- package/front_end/core/sdk/SourceMapScopesInfo.ts +11 -4
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +3 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +119 -8
- package/front_end/entrypoints/formatter_worker/Substitute.ts +1 -1
- package/front_end/entrypoints/main/GlobalAiButton.ts +5 -1
- package/front_end/generated/Deprecation.ts +0 -7
- package/front_end/generated/InspectorBackendCommands.ts +4 -4
- package/front_end/generated/protocol.ts +9 -1
- package/front_end/models/ai_assistance/AiConversation.ts +71 -10
- package/front_end/models/ai_assistance/ArtifactsManager.ts +67 -0
- package/front_end/models/ai_assistance/ConversationHandler.ts +3 -2
- package/front_end/models/ai_assistance/agents/AiAgent.ts +17 -27
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +151 -3
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +0 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +3 -3
- package/front_end/models/annotations/AnnotationRepository.ts +2 -2
- package/front_end/models/bindings/CompilerScriptMapping.ts +7 -6
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +4 -4
- package/front_end/models/greendev/Prototypes.ts +56 -0
- package/front_end/models/greendev/README.md +5 -0
- package/front_end/models/greendev/greendev.ts +5 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +2 -2
- package/front_end/models/stack_trace/StackTraceImpl.ts +5 -3
- package/front_end/models/stack_trace/StackTraceModel.ts +53 -40
- package/front_end/models/trace/EventsSerializer.ts +8 -2
- package/front_end/models/trace/extras/TraceTree.ts +4 -2
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -2
- package/front_end/models/trace/insights/LCPDiscovery.ts +0 -2
- package/front_end/models/trace/types/TraceEvents.ts +0 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +96 -91
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +16 -0
- package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +109 -7
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -2
- package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +7 -8
- package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +15 -8
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +9 -9
- package/front_end/panels/ai_assistance/components/artifactsViewer.css +6 -1
- package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +5 -6
- package/front_end/panels/application/AppManifestView.ts +360 -391
- package/front_end/panels/application/ApplicationPanelSidebar.ts +24 -57
- package/front_end/panels/application/CookieItemsView.ts +1 -0
- package/front_end/panels/application/OpenedWindowDetailsView.ts +2 -0
- package/front_end/panels/application/ServiceWorkersView.ts +2 -0
- package/front_end/panels/application/SharedStorageTreeElement.ts +3 -0
- package/front_end/panels/application/StorageView.ts +1 -0
- package/front_end/panels/application/appManifestView.css +49 -1
- package/front_end/panels/application/components/ProtocolHandlersView.ts +2 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +4 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +30 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/elements/ElementsTreeOutlineRenderer.ts +7 -1
- package/front_end/panels/elements/components/AdornerManager.ts +8 -0
- package/front_end/panels/emulation/DeviceModeToolbar.ts +3 -1
- package/front_end/panels/issues/AffectedResourcesView.ts +0 -1
- package/front_end/panels/lighthouse/LighthousePanel.ts +10 -0
- package/front_end/panels/lighthouse/lighthousePanel.css +46 -3
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +4 -8
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +148 -97
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryViewer.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/linearMemoryValueInterpreter.css +37 -35
- package/front_end/panels/network/NetworkLogViewColumns.ts +9 -9
- package/front_end/panels/network/RequestCookiesView.ts +125 -141
- package/front_end/panels/network/components/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/requestCookiesView.css +22 -20
- package/front_end/panels/recorder/components/RecordingView.ts +3 -3
- package/front_end/panels/recorder/components/StepView.ts +2 -1
- package/front_end/panels/settings/SettingsScreen.ts +133 -1
- package/front_end/panels/settings/keybindsSettingsTab.css +4 -0
- package/front_end/panels/settings/settings-meta.ts +24 -0
- package/front_end/panels/settings/settingsScreen.css +4 -0
- package/front_end/panels/sources/CallStackSidebarPane.ts +7 -3
- package/front_end/panels/sources/DebuggerPausedMessage.ts +125 -90
- package/front_end/panels/sources/SourcesPanel.ts +10 -7
- package/front_end/panels/sources/UISourceCodeFrame.ts +3 -17
- package/front_end/panels/sources/debuggerPausedMessage.css +8 -0
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -1
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +2 -0
- package/front_end/third_party/acorn/estree-legacy.d.ts +4 -0
- 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 +12 -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.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/CDPSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +14 -2
- 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.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +3 -1
- 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 +6 -0
- 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/HTTPRequest.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +3 -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 +10 -14
- 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/BrowsingContext.d.ts +1 -0
- 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 +14 -0
- 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/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +3 -1
- 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 +9 -2
- 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/common/BrowserConnector.js +21 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.d.ts.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/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/revisions.js.map +1 -1
- 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 +26 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +86 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +12 -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.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/CDPSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +14 -2
- 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.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +3 -1
- 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 +6 -0
- 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/HTTPRequest.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +3 -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 +11 -15
- 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/BrowsingContext.d.ts +1 -0
- 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 +14 -0
- 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/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +3 -1
- 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 +9 -2
- 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/common/BrowserConnector.js +21 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts.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/revisions.js.map +1 -1
- 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 +26 -0
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +18 -0
- package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +1 -2
- package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/api/Frame.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +18 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +13 -0
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +0 -33
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +14 -28
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +19 -0
- package/front_end/third_party/puppeteer/package/src/bidi/core/Connection.ts +3 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +19 -0
- package/front_end/third_party/puppeteer/package/src/cdp/EmulationManager.ts +30 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +15 -6
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +29 -10
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +3 -3
- 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/icon_button/iconButton.css +3 -1
- package/front_end/ui/components/report_view/ReportView.docs.ts +37 -0
- package/front_end/ui/components/report_view/ReportView.ts +12 -6
- package/front_end/ui/components/report_view/report.css +16 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +135 -7
- package/front_end/ui/components/text_editor/config.ts +6 -6
- package/front_end/ui/legacy/ContextMenu.ts +11 -2
- package/front_end/ui/legacy/Floaty.ts +5 -9
- package/front_end/ui/legacy/InspectorView.ts +2 -1
- package/front_end/ui/legacy/ReportView.ts +5 -4
- package/front_end/ui/legacy/TextPrompt.ts +1 -1
- package/front_end/ui/legacy/Toolbar.ts +4 -0
- package/front_end/ui/legacy/UIUtils.ts +0 -2
- package/front_end/ui/legacy/Widget.ts +7 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +18 -3
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +3 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +6 -0
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +0 -1
- package/front_end/ui/legacy/reportView.css +0 -24
- package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ 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 {WindowId} from '../api/Browser.js';
|
|
12
13
|
import type {CDPSession} from '../api/CDPSession.js';
|
|
13
14
|
import type {DeviceRequestPrompt} from '../api/DeviceRequestPrompt.js';
|
|
14
15
|
import type {BoundingBox} from '../api/ElementHandle.js';
|
|
@@ -47,12 +48,7 @@ import {EventEmitter} from '../common/EventEmitter.js';
|
|
|
47
48
|
import {FileChooser} from '../common/FileChooser.js';
|
|
48
49
|
import type {PDFOptions} from '../common/PDFOptions.js';
|
|
49
50
|
import type {Awaitable} from '../common/types.js';
|
|
50
|
-
import {
|
|
51
|
-
evaluationString,
|
|
52
|
-
isString,
|
|
53
|
-
parsePDFOptions,
|
|
54
|
-
timeout,
|
|
55
|
-
} from '../common/util.js';
|
|
51
|
+
import {evaluationString, parsePDFOptions, timeout} from '../common/util.js';
|
|
56
52
|
import type {Viewport} from '../common/Viewport.js';
|
|
57
53
|
import {assert} from '../util/assert.js';
|
|
58
54
|
import {bubble} from '../util/decorators.js';
|
|
@@ -260,15 +256,23 @@ export class BidiPage extends Page {
|
|
|
260
256
|
return this.#frame;
|
|
261
257
|
}
|
|
262
258
|
|
|
259
|
+
override async emulateFocusedPage(enabled: boolean): Promise<void> {
|
|
260
|
+
return await this.#cdpEmulationManager.emulateFocus(enabled);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
263
|
override resize(_params: {
|
|
264
264
|
contentWidth: number;
|
|
265
265
|
contentHeight: number;
|
|
266
266
|
}): Promise<void> {
|
|
267
|
-
throw new
|
|
267
|
+
throw new UnsupportedOperation();
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
override windowId(): Promise<WindowId> {
|
|
271
|
+
throw new UnsupportedOperation();
|
|
268
272
|
}
|
|
269
273
|
|
|
270
274
|
override openDevTools(): Promise<Page> {
|
|
271
|
-
throw new
|
|
275
|
+
throw new UnsupportedOperation();
|
|
272
276
|
}
|
|
273
277
|
|
|
274
278
|
async focusedFrame(): Promise<BidiFrame> {
|
|
@@ -725,9 +729,7 @@ export class BidiPage extends Page {
|
|
|
725
729
|
|
|
726
730
|
get isNetworkInterceptionEnabled(): boolean {
|
|
727
731
|
return (
|
|
728
|
-
Boolean(this.#requestInterception) ||
|
|
729
|
-
Boolean(this.#extraHeadersInterception) ||
|
|
730
|
-
Boolean(this.#authInterception)
|
|
732
|
+
Boolean(this.#requestInterception) || Boolean(this.#authInterception)
|
|
731
733
|
);
|
|
732
734
|
}
|
|
733
735
|
|
|
@@ -743,26 +745,10 @@ export class BidiPage extends Page {
|
|
|
743
745
|
/**
|
|
744
746
|
* @internal
|
|
745
747
|
*/
|
|
746
|
-
_extraHTTPHeaders: Record<string, string> = {};
|
|
747
|
-
#extraHeadersInterception?: string;
|
|
748
748
|
override async setExtraHTTPHeaders(
|
|
749
749
|
headers: Record<string, string>,
|
|
750
750
|
): Promise<void> {
|
|
751
|
-
|
|
752
|
-
for (const [key, value] of Object.entries(headers)) {
|
|
753
|
-
assert(
|
|
754
|
-
isString(value),
|
|
755
|
-
`Expected value of header "${key}" to be String, but "${typeof value}" is found.`,
|
|
756
|
-
);
|
|
757
|
-
extraHTTPHeaders[key.toLowerCase()] = value;
|
|
758
|
-
}
|
|
759
|
-
this._extraHTTPHeaders = extraHTTPHeaders;
|
|
760
|
-
|
|
761
|
-
this.#extraHeadersInterception = await this.#toggleInterception(
|
|
762
|
-
[Bidi.Network.InterceptPhase.BeforeRequestSent],
|
|
763
|
-
this.#extraHeadersInterception,
|
|
764
|
-
Boolean(Object.keys(this._extraHTTPHeaders).length),
|
|
765
|
-
);
|
|
751
|
+
await this.#frame.browsingContext.setExtraHTTPHeaders(headers);
|
|
766
752
|
}
|
|
767
753
|
|
|
768
754
|
/**
|
|
@@ -9,6 +9,8 @@ import type * as Bidi from 'webdriver-bidi-protocol';
|
|
|
9
9
|
import type {BluetoothEmulation} from '../../api/BluetoothEmulation.js';
|
|
10
10
|
import type {DeviceRequestPrompt} from '../../api/DeviceRequestPrompt.js';
|
|
11
11
|
import {EventEmitter} from '../../common/EventEmitter.js';
|
|
12
|
+
import {isString} from '../../common/util.js';
|
|
13
|
+
import {assert} from '../../util/assert.js';
|
|
12
14
|
import {inertIfDisposed, throwIfDisposed} from '../../util/decorators.js';
|
|
13
15
|
import {DisposableStack, disposeSymbol} from '../../util/disposable.js';
|
|
14
16
|
import {BidiBluetoothEmulation} from '../BluetoothEmulation.js';
|
|
@@ -785,4 +787,21 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
785
787
|
signal,
|
|
786
788
|
);
|
|
787
789
|
}
|
|
790
|
+
|
|
791
|
+
async setExtraHTTPHeaders(headers: Record<string, string>): Promise<void> {
|
|
792
|
+
await this.#session.send('network.setExtraHeaders', {
|
|
793
|
+
headers: Object.entries(headers).map(([key, value]) => {
|
|
794
|
+
assert(
|
|
795
|
+
isString(value),
|
|
796
|
+
`Expected value of header "${key}" to be String, but "${typeof value}" is found.`,
|
|
797
|
+
);
|
|
798
|
+
|
|
799
|
+
return {
|
|
800
|
+
name: key.toLowerCase(),
|
|
801
|
+
value: {type: 'string', value: value},
|
|
802
|
+
};
|
|
803
|
+
}),
|
|
804
|
+
contexts: [this.id],
|
|
805
|
+
});
|
|
806
|
+
}
|
|
788
807
|
}
|
|
@@ -21,8 +21,9 @@ export type BidiEvents = {
|
|
|
21
21
|
/**
|
|
22
22
|
* @internal
|
|
23
23
|
*/
|
|
24
|
-
export interface Connection<
|
|
25
|
-
extends
|
|
24
|
+
export interface Connection<
|
|
25
|
+
Events extends BidiEvents = BidiEvents,
|
|
26
|
+
> extends EventEmitter<Events> {
|
|
26
27
|
send<T extends keyof Commands>(
|
|
27
28
|
method: T,
|
|
28
29
|
params: Commands[T]['params'],
|
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
type TargetFilterCallback,
|
|
19
19
|
type ScreenInfo,
|
|
20
20
|
type AddScreenParams,
|
|
21
|
+
type WindowBounds,
|
|
22
|
+
type WindowId,
|
|
21
23
|
} from '../api/Browser.js';
|
|
22
24
|
import {BrowserContextEvent} from '../api/BrowserContext.js';
|
|
23
25
|
import {CDPSessionEvent} from '../api/CDPSession.js';
|
|
@@ -453,6 +455,23 @@ export class CdpBrowser extends BrowserBase {
|
|
|
453
455
|
return await this.#connection.send('Emulation.removeScreen', {screenId});
|
|
454
456
|
}
|
|
455
457
|
|
|
458
|
+
override async getWindowBounds(windowId: WindowId): Promise<WindowBounds> {
|
|
459
|
+
const {bounds} = await this.#connection.send('Browser.getWindowBounds', {
|
|
460
|
+
windowId: Number(windowId),
|
|
461
|
+
});
|
|
462
|
+
return bounds;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
override async setWindowBounds(
|
|
466
|
+
windowId: WindowId,
|
|
467
|
+
windowBounds: WindowBounds,
|
|
468
|
+
): Promise<void> {
|
|
469
|
+
await this.#connection.send('Browser.setWindowBounds', {
|
|
470
|
+
windowId: Number(windowId),
|
|
471
|
+
bounds: windowBounds,
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
|
|
456
475
|
override targets(): CdpTarget[] {
|
|
457
476
|
return Array.from(
|
|
458
477
|
this.#targetManager.getAvailableTargets().values(),
|
|
@@ -66,6 +66,11 @@ interface JavascriptEnabledState {
|
|
|
66
66
|
active: boolean;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
interface FocusState {
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
active: boolean;
|
|
72
|
+
}
|
|
73
|
+
|
|
69
74
|
/**
|
|
70
75
|
* @internal
|
|
71
76
|
*/
|
|
@@ -193,6 +198,14 @@ export class EmulationManager implements ClientProvider {
|
|
|
193
198
|
this,
|
|
194
199
|
this.#setJavaScriptEnabled,
|
|
195
200
|
);
|
|
201
|
+
#focusState = new EmulatedState<FocusState>(
|
|
202
|
+
{
|
|
203
|
+
enabled: true,
|
|
204
|
+
active: false,
|
|
205
|
+
},
|
|
206
|
+
this,
|
|
207
|
+
this.#emulateFocus,
|
|
208
|
+
);
|
|
196
209
|
|
|
197
210
|
#secondaryClients = new Set<CDPSession>();
|
|
198
211
|
|
|
@@ -578,4 +591,21 @@ export class EmulationManager implements ClientProvider {
|
|
|
578
591
|
javaScriptEnabled: enabled,
|
|
579
592
|
});
|
|
580
593
|
}
|
|
594
|
+
|
|
595
|
+
@invokeAtMostOnceForArguments
|
|
596
|
+
async #emulateFocus(client: CDPSession, state: FocusState): Promise<void> {
|
|
597
|
+
if (!state.active) {
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
await client.send('Emulation.setFocusEmulationEnabled', {
|
|
601
|
+
enabled: state.enabled,
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
async emulateFocus(enabled: boolean): Promise<void> {
|
|
606
|
+
await this.#focusState.setState({
|
|
607
|
+
active: true,
|
|
608
|
+
enabled,
|
|
609
|
+
});
|
|
610
|
+
}
|
|
581
611
|
}
|
|
@@ -8,7 +8,7 @@ import type {Protocol} from 'devtools-protocol';
|
|
|
8
8
|
|
|
9
9
|
import {firstValueFrom, from, raceWith} from '../../third_party/rxjs/rxjs.js';
|
|
10
10
|
import type {BluetoothEmulation} from '../api/BluetoothEmulation.js';
|
|
11
|
-
import type {Browser} from '../api/Browser.js';
|
|
11
|
+
import type {Browser, WindowId} from '../api/Browser.js';
|
|
12
12
|
import type {BrowserContext} from '../api/BrowserContext.js';
|
|
13
13
|
import {CDPSessionEvent, type CDPSession} from '../api/CDPSession.js';
|
|
14
14
|
import type {DeviceRequestPrompt} from '../api/DeviceRequestPrompt.js';
|
|
@@ -375,17 +375,22 @@ export class CdpPage extends Page {
|
|
|
375
375
|
contentWidth: number;
|
|
376
376
|
contentHeight: number;
|
|
377
377
|
}): Promise<void> {
|
|
378
|
-
const
|
|
379
|
-
'Browser.getWindowForTarget',
|
|
380
|
-
);
|
|
381
|
-
|
|
378
|
+
const windowId = await this.windowId();
|
|
382
379
|
await this.#primaryTargetClient.send('Browser.setContentsSize', {
|
|
383
|
-
windowId,
|
|
380
|
+
windowId: Number(windowId),
|
|
384
381
|
width: params.contentWidth,
|
|
385
382
|
height: params.contentHeight,
|
|
386
383
|
});
|
|
387
384
|
}
|
|
388
385
|
|
|
386
|
+
override async windowId(): Promise<WindowId> {
|
|
387
|
+
const {windowId} = await this.#primaryTargetClient.send(
|
|
388
|
+
'Browser.getWindowForTarget',
|
|
389
|
+
);
|
|
390
|
+
|
|
391
|
+
return windowId.toString();
|
|
392
|
+
}
|
|
393
|
+
|
|
389
394
|
async #onFileChooser(
|
|
390
395
|
event: Protocol.Page.FileChooserOpenedEvent,
|
|
391
396
|
): Promise<void> {
|
|
@@ -580,6 +585,10 @@ export class CdpPage extends Page {
|
|
|
580
585
|
);
|
|
581
586
|
}
|
|
582
587
|
|
|
588
|
+
override async emulateFocusedPage(enabled: boolean): Promise<void> {
|
|
589
|
+
return await this.#emulationManager.emulateFocus(enabled);
|
|
590
|
+
}
|
|
591
|
+
|
|
583
592
|
override setDefaultNavigationTimeout(timeout: number): void {
|
|
584
593
|
this._timeoutSettings.setDefaultNavigationTimeout(timeout);
|
|
585
594
|
}
|
|
@@ -57,12 +57,21 @@ export async function _connectToBrowser(
|
|
|
57
57
|
async function getConnectionTransport(
|
|
58
58
|
options: ConnectOptions,
|
|
59
59
|
): Promise<{connectionTransport: ConnectionTransport; endpointUrl: string}> {
|
|
60
|
-
const {
|
|
60
|
+
const {
|
|
61
|
+
browserWSEndpoint,
|
|
62
|
+
browserURL,
|
|
63
|
+
channel,
|
|
64
|
+
transport,
|
|
65
|
+
headers = {},
|
|
66
|
+
} = options;
|
|
61
67
|
|
|
62
68
|
assert(
|
|
63
|
-
Number(!!browserWSEndpoint) +
|
|
69
|
+
Number(!!browserWSEndpoint) +
|
|
70
|
+
Number(!!browserURL) +
|
|
71
|
+
Number(!!transport) +
|
|
72
|
+
Number(!!channel) ===
|
|
64
73
|
1,
|
|
65
|
-
'Exactly one of browserWSEndpoint, browserURL or
|
|
74
|
+
'Exactly one of browserWSEndpoint, browserURL, transport or channel must be passed to puppeteer.connect',
|
|
66
75
|
);
|
|
67
76
|
|
|
68
77
|
if (transport) {
|
|
@@ -91,9 +100,8 @@ async function getConnectionTransport(
|
|
|
91
100
|
if (!platform) {
|
|
92
101
|
throw new Error('Could not detect required browser platform');
|
|
93
102
|
}
|
|
94
|
-
const {convertPuppeteerChannelToBrowsersChannel} =
|
|
95
|
-
'../node/LaunchOptions.js'
|
|
96
|
-
);
|
|
103
|
+
const {convertPuppeteerChannelToBrowsersChannel} =
|
|
104
|
+
await import('../node/LaunchOptions.js');
|
|
97
105
|
const {join} = await import('node:path');
|
|
98
106
|
const userDataDir = resolveDefaultUserDataDir(
|
|
99
107
|
Browser.CHROME,
|
|
@@ -102,15 +110,26 @@ async function getConnectionTransport(
|
|
|
102
110
|
);
|
|
103
111
|
const portPath = join(userDataDir, 'DevToolsActivePort');
|
|
104
112
|
try {
|
|
105
|
-
const
|
|
113
|
+
const fileContent = await environment.value.fs.promises.readFile(
|
|
106
114
|
portPath,
|
|
107
115
|
'ascii',
|
|
108
116
|
);
|
|
109
|
-
const
|
|
117
|
+
const [rawPort, rawPath] = fileContent
|
|
118
|
+
.split('\n')
|
|
119
|
+
.map(line => {
|
|
120
|
+
return line.trim();
|
|
121
|
+
})
|
|
122
|
+
.filter(line => {
|
|
123
|
+
return !!line;
|
|
124
|
+
});
|
|
125
|
+
if (!rawPort || !rawPath) {
|
|
126
|
+
throw new Error(`Invalid DevToolsActivePort '${fileContent}' found`);
|
|
127
|
+
}
|
|
128
|
+
const port = parseInt(rawPort, 10);
|
|
110
129
|
if (isNaN(port) || port <= 0 || port > 65535) {
|
|
111
|
-
throw new Error(`Invalid port '${
|
|
130
|
+
throw new Error(`Invalid port '${rawPort}' found`);
|
|
112
131
|
}
|
|
113
|
-
const browserWSEndpoint = `ws://localhost:${port}`;
|
|
132
|
+
const browserWSEndpoint = `ws://localhost:${port}${rawPath}`;
|
|
114
133
|
const WebSocketClass = await getWebSocketTransportClass();
|
|
115
134
|
const connectionTransport = await WebSocketClass.create(
|
|
116
135
|
browserWSEndpoint,
|
|
@@ -56,9 +56,9 @@ export type EventsWithWildcard<Events extends Record<EventType, unknown>> =
|
|
|
56
56
|
*
|
|
57
57
|
* @public
|
|
58
58
|
*/
|
|
59
|
-
export class EventEmitter<
|
|
60
|
-
|
|
61
|
-
{
|
|
59
|
+
export class EventEmitter<
|
|
60
|
+
Events extends Record<EventType, unknown>,
|
|
61
|
+
> implements CommonEventEmitter<EventsWithWildcard<Events>> {
|
|
62
62
|
#emitter: Emitter<EventsWithWildcard<Events>> | EventEmitter<Events>;
|
|
63
63
|
#handlers = new Map<keyof Events | '*', Array<Handler<any>>>();
|
|
64
64
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export const PUPPETEER_REVISIONS = Object.freeze({
|
|
11
|
-
chrome: '143.0.7499.
|
|
12
|
-
'chrome-headless-shell': '143.0.7499.
|
|
13
|
-
firefox: '
|
|
11
|
+
chrome: '143.0.7499.42',
|
|
12
|
+
'chrome-headless-shell': '143.0.7499.42',
|
|
13
|
+
firefox: 'stable_146.0',
|
|
14
14
|
});
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
:host {
|
|
8
8
|
white-space: normal;
|
|
9
9
|
display: inline-block;
|
|
10
|
+
margin-right: var(--sys-size-1);
|
|
11
|
+
margin-left: var(--sys-size-1);
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
.icon-button {
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
.icon-button:focus-visible {
|
|
36
|
-
|
|
38
|
+
outline: var(--sys-size-2) solid var(--sys-color-state-focus-ring);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
.compact .icon-button-title {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright 2020 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import './report_view.js';
|
|
6
|
+
|
|
7
|
+
import * as Lit from '../../lit/lit.js';
|
|
8
|
+
|
|
9
|
+
import type {ReportData} from './ReportView.js';
|
|
10
|
+
|
|
11
|
+
const {html} = Lit;
|
|
12
|
+
|
|
13
|
+
const exampleRenderHelper = (key: string, value: string) => html`
|
|
14
|
+
<devtools-report-key>${key}</devtools-report-key>
|
|
15
|
+
<devtools-report-value>${value}</devtools-report-value>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
export function render(container: HTMLElement) {
|
|
19
|
+
// clang-format off
|
|
20
|
+
Lit.render(
|
|
21
|
+
html`
|
|
22
|
+
<devtools-report .data=${{reportTitle: 'Optional Title'} as ReportData}>
|
|
23
|
+
<devtools-report-section-header>Section 1</devtools-report-section-header>
|
|
24
|
+
<devtools-report-key>Basic plain text field</devtools-report-key>
|
|
25
|
+
<devtools-report-value>And this is the value</devtools-report-value>
|
|
26
|
+
<devtools-report-key>A field with a code value</devtools-report-key>
|
|
27
|
+
<devtools-report-value class="source-code">SomeCodeValue</devtools-report-value>
|
|
28
|
+
<devtools-report-divider></devtools-report-divider>
|
|
29
|
+
<devtools-report-section-header>Section 2</devtools-report-section-header>
|
|
30
|
+
${exampleRenderHelper('Using a small helper', 'to render report rows')}
|
|
31
|
+
${exampleRenderHelper('This wide column defines the column width', 'for all rows')}
|
|
32
|
+
<devtools-report-divider></devtools-report-divider>
|
|
33
|
+
</devtools-report>
|
|
34
|
+
`,
|
|
35
|
+
container);
|
|
36
|
+
// clang-format on
|
|
37
|
+
}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-lit-render-outside-of-view, @devtools/enforce-custom-element-definitions-location */
|
|
5
5
|
|
|
6
|
+
import * as Platform from '../../../core/platform/platform.js';
|
|
7
|
+
import * as Components from '../../legacy/components/utils/utils.js';
|
|
6
8
|
import {html, nothing, render} from '../../lit/lit.js';
|
|
7
9
|
|
|
8
10
|
import reportStyles from './report.css.js';
|
|
@@ -29,20 +31,20 @@ import reportValueStyles from './reportValue.css.js';
|
|
|
29
31
|
* <devtools-report-divider></devtools-report-divider>
|
|
30
32
|
* </devtools-report>
|
|
31
33
|
* ```
|
|
34
|
+
* The component is intended to replace UI.ReportView in an idiomatic way.
|
|
32
35
|
*/
|
|
33
36
|
export interface ReportData {
|
|
34
37
|
reportTitle: string;
|
|
38
|
+
reportUrl?: Platform.DevToolsPath.UrlString;
|
|
35
39
|
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated Use UI.ReportView.ReportView instead.
|
|
39
|
-
*/
|
|
40
40
|
export class Report extends HTMLElement {
|
|
41
41
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
42
42
|
#reportTitle = '';
|
|
43
|
+
#reportUrl = Platform.DevToolsPath.EmptyUrlString;
|
|
43
44
|
|
|
44
|
-
set data({reportTitle}: ReportData) {
|
|
45
|
+
set data({reportTitle, reportUrl}: ReportData) {
|
|
45
46
|
this.#reportTitle = reportTitle;
|
|
47
|
+
this.#reportUrl = reportUrl ?? Platform.DevToolsPath.EmptyUrlString;
|
|
46
48
|
this.#render();
|
|
47
49
|
}
|
|
48
50
|
|
|
@@ -55,7 +57,11 @@ export class Report extends HTMLElement {
|
|
|
55
57
|
// clang-format off
|
|
56
58
|
render(html`
|
|
57
59
|
<style>${reportStyles}</style>
|
|
58
|
-
${this.#reportTitle ? html`<div class="report-title"
|
|
60
|
+
${this.#reportTitle ? html`<div class="report-title">
|
|
61
|
+
${this.#reportTitle}
|
|
62
|
+
${this.#reportUrl ? Components.Linkifier.Linkifier.linkifyURL(this.#reportUrl, {
|
|
63
|
+
tabStop: true, jslogContext: 'source-location', className: 'report-url'}) : nothing}
|
|
64
|
+
</div>` : nothing}
|
|
59
65
|
<div class="content">
|
|
60
66
|
<slot></slot>
|
|
61
67
|
</div>
|
|
@@ -26,3 +26,19 @@
|
|
|
26
26
|
color: var(--sys-color-on-surface);
|
|
27
27
|
background-color: var(--sys-color-cdt-base-container);
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
.report-url {
|
|
31
|
+
background: none;
|
|
32
|
+
border-radius: 2px;
|
|
33
|
+
border: none;
|
|
34
|
+
color: var(--text-link);
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
display: block;
|
|
37
|
+
font: var(--sys-typescale-body4-regular);
|
|
38
|
+
height: unset;
|
|
39
|
+
margin: 0;
|
|
40
|
+
outline-offset: 2px;
|
|
41
|
+
outline: none;
|
|
42
|
+
padding: 0 !important; /* stylelint-disable-line declaration-no-important */
|
|
43
|
+
text-decoration: underline;
|
|
44
|
+
}
|
|
@@ -155,7 +155,7 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
155
155
|
.checked=${this.checked}
|
|
156
156
|
?disabled=${this.#setting.disabled()}
|
|
157
157
|
@change=${this.#checkboxChanged}
|
|
158
|
-
jslog=${VisualLogging.toggle().track({
|
|
158
|
+
jslog=${VisualLogging.toggle().track({change: true}).context(this.#setting.name)}
|
|
159
159
|
aria-label=${this.#setting.title()}
|
|
160
160
|
/>
|
|
161
161
|
${this.#textOverride || this.#setting.title()}${reason}
|