chrome-devtools-frontend 1.0.1695017 → 1.0.1696961
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/eslint.config.mjs +4 -1
- package/front_end/core/common/Base64.ts +14 -4
- package/front_end/core/common/Gzip.ts +1 -1
- package/front_end/core/common/Object.ts +0 -1
- package/front_end/core/platform/Size.ts +43 -0
- package/front_end/core/platform/api/HostRuntime.ts +14 -0
- package/front_end/core/platform/browser/HostRuntime.ts +66 -0
- package/front_end/core/platform/node/HostRuntime.ts +12 -3
- package/front_end/core/platform/platform.ts +1 -0
- package/front_end/core/sdk/AccessibilityModel.ts +2 -2
- package/front_end/core/sdk/CSSMatchedStyles.ts +2 -0
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +29 -0
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +2 -2
- package/front_end/core/sdk/ConsoleModel.ts +3 -3
- package/front_end/core/sdk/DOMModel.ts +10 -6
- package/front_end/core/sdk/DebuggerModel.ts +6 -0
- package/front_end/core/sdk/NetworkRequest.ts +19 -19
- package/front_end/core/sdk/RuntimeModel.ts +5 -0
- package/front_end/core/sdk/Script.ts +2 -2
- package/front_end/core/sdk/ServerTiming.ts +6 -6
- package/front_end/core/sdk/SourceMap.ts +112 -14
- package/front_end/core/sdk/SourceMapRangeMappings.ts +43 -0
- package/front_end/core/sdk/SourceMapScopeChainEntry.ts +15 -10
- package/front_end/core/sdk/SourceMapScopesInfo.ts +92 -10
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +1 -1
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +6 -6
- package/front_end/entrypoints/main/MainImpl.ts +1 -1
- package/front_end/generated/InspectorBackendCommands.ts +6 -3
- package/front_end/generated/protocol-mapping.d.ts +7 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/generated/protocol.ts +36 -3
- package/front_end/models/ai_assistance/AiAgent2.ts +27 -27
- package/front_end/models/ai_assistance/agents/AiAgent.ts +4 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/contexts/AccessibilityContext.ts +1 -0
- package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +5 -4
- package/front_end/models/ai_assistance/contexts/FileContext.ts +1 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +1 -0
- package/front_end/models/ai_assistance/contexts/RequestContext.ts +1 -0
- package/front_end/models/ai_assistance/contexts/StorageContext.ts +1 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +5 -5
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +5 -8
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +4 -8
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +7 -5
- package/front_end/models/ai_assistance/tools/GetStyles.ts +10 -6
- package/front_end/models/ai_assistance/tools/ListSources.ts +26 -7
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +5 -10
- package/front_end/models/ai_assistance/tools/Tool.ts +8 -1
- package/front_end/models/bindings/FileUtils.ts +18 -40
- package/front_end/models/bindings/TempFile.ts +5 -12
- package/front_end/models/comment_manager/CommentManager.ts +30 -6
- package/front_end/models/crux-manager/CrUXManager.ts +8 -5
- package/front_end/models/emulation/DeviceModeModel.ts +55 -105
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +1 -1
- package/front_end/models/issues_manager/CookieIssue.ts +1 -1
- package/front_end/models/issues_manager/DeprecationIssue.ts +2 -2
- package/front_end/models/javascript_metadata/NativeFunctions.ts +1 -5
- package/front_end/models/live-metrics/LiveMetrics.ts +1 -1
- package/front_end/models/persistence/IsolatedFileSystem.ts +16 -23
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -1
- package/front_end/models/trace/insights/INPBreakdown.ts +1 -1
- package/front_end/models/trace/insights/ImageDelivery.ts +3 -3
- package/front_end/models/trace/insights/LCPDiscovery.ts +2 -2
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +3 -3
- package/front_end/models/trace/insights/Viewport.ts +1 -1
- package/front_end/models/trace/types/Overlays.ts +2 -2
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +2 -2
- package/front_end/panels/accessibility/AccessibilitySubPane.ts +0 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +74 -18
- package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +14 -3
- package/front_end/panels/ai_assistance/components/ChatInput.ts +1 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +1 -1
- package/front_end/panels/animation/AnimationUI.ts +1 -1
- package/front_end/panels/application/AppManifestView.ts +9 -11
- package/front_end/panels/application/ApplicationPanelSidebar.ts +9 -9
- package/front_end/panels/application/BackgroundServiceView.ts +1 -1
- package/front_end/panels/application/CookieItemsView.ts +1 -1
- package/front_end/panels/application/DOMStorageItemsView.ts +1 -1
- package/front_end/panels/application/DeviceBoundSessionsView.ts +2 -2
- package/front_end/panels/application/FrameDetailsView.ts +5 -5
- package/front_end/panels/application/IndexedDBViews.ts +2 -2
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -2
- package/front_end/panels/application/ReportingApiView.ts +1 -1
- package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +1 -1
- package/front_end/panels/application/ServiceWorkersView.ts +1 -1
- package/front_end/panels/application/StorageBucketsTreeElement.ts +1 -1
- package/front_end/panels/application/WebMCPView.ts +1 -1
- package/front_end/panels/application/components/AdsView.ts +136 -7
- package/front_end/panels/application/components/BackForwardCacheStrings.ts +116 -117
- package/front_end/panels/application/components/BackForwardCacheView.ts +7 -7
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +2 -2
- package/front_end/panels/application/components/PermissionsPolicySection.ts +2 -2
- package/front_end/panels/application/components/ProtocolHandlersView.ts +1 -1
- package/front_end/panels/application/components/ReportsGrid.ts +1 -1
- package/front_end/panels/application/components/StorageMetadataView.ts +1 -1
- package/front_end/panels/application/components/TrustTokensView.ts +3 -3
- package/front_end/panels/application/components/adScriptsTable.css +22 -0
- package/front_end/panels/application/preloading/PreloadingView.ts +20 -22
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +9 -9
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +31 -33
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +23 -23
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +4 -4
- package/front_end/panels/application/preloading/components/PreloadingString.ts +161 -161
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -6
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +8 -8
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +32 -32
- package/front_end/panels/application/resourcesPanel.css +17 -17
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +1 -1
- package/front_end/panels/changes/ChangesView.ts +1 -1
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +1 -1
- package/front_end/panels/common/CPUThrottlingOption.ts +0 -1
- package/front_end/panels/common/GdpSignUpDialog.ts +3 -4
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +1 -1
- package/front_end/panels/console/ConsolePinPane.ts +0 -1
- package/front_end/panels/console/ConsoleView.ts +2 -3
- package/front_end/panels/console/ConsoleViewMessage.ts +2 -3
- package/front_end/panels/coverage/CoverageListView.ts +6 -6
- package/front_end/panels/coverage/CoverageView.ts +7 -7
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +10 -10
- package/front_end/panels/elements/ElementsPanel.ts +3 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/elements/LayoutPane.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +85 -2
- package/front_end/panels/elements/StylesSidebarPane.ts +3 -3
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +2 -1
- package/front_end/panels/emulation/DeviceModeView.ts +1 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +57 -89
- package/front_end/panels/explain/components/ConsoleInsight.ts +4 -4
- package/front_end/panels/issues/AffectedPartitioningBlobURLView.ts +3 -3
- package/front_end/panels/issues/IssuesPane.ts +1 -1
- package/front_end/panels/layer_viewer/Layers3DView.ts +4 -4
- package/front_end/panels/layers/LayerTreeModel.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +4 -4
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +10 -10
- package/front_end/panels/lighthouse/LighthouseTimespanView.ts +2 -2
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +1 -1
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +1 -1
- package/front_end/panels/media/MainView.ts +2 -2
- package/front_end/panels/mobile_throttling/CalibrationController.ts +4 -1
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +10 -0
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +3 -3
- package/front_end/panels/network/NetworkConfigView.ts +26 -16
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/network/NetworkLogView.ts +4 -5
- package/front_end/panels/network/NetworkPanel.ts +1 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +3 -3
- package/front_end/panels/network/RequestCookiesView.ts +2 -2
- package/front_end/panels/network/RequestPayloadView.ts +0 -2
- package/front_end/panels/network/RequestTimingView.ts +1 -1
- package/front_end/panels/network/ResourceChunkView.ts +1 -1
- package/front_end/panels/network/components/HeaderSectionRow.ts +2 -2
- package/front_end/panels/network/components/RequestHeaderSection.ts +1 -1
- package/front_end/panels/network/components/RequestTrustTokensView.ts +7 -7
- package/front_end/panels/network/components/ResponseHeaderSection.ts +3 -4
- package/front_end/panels/network/network-meta.ts +1 -1
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +10 -10
- package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
- package/front_end/panels/profiler/IsolateSelector.ts +4 -4
- package/front_end/panels/profiler/ModuleUIStrings.ts +1 -1
- package/front_end/panels/profiler/ProfilesPanel.ts +2 -3
- package/front_end/panels/recorder/RecorderPanel.ts +1 -1
- package/front_end/panels/search/SearchView.ts +6 -6
- package/front_end/panels/security/SecurityModel.ts +4 -4
- package/front_end/panels/security/SecurityPanel.ts +83 -54
- package/front_end/panels/security/SecurityPanelSidebar.ts +41 -5
- package/front_end/panels/security/sidebar.css +9 -10
- package/front_end/panels/sensors/SensorsView.ts +1 -1
- package/front_end/panels/settings/AISettingsTab.ts +9 -9
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
- package/front_end/panels/settings/KeybindsSettingsTab.ts +2 -2
- package/front_end/panels/settings/SettingsScreen.ts +156 -109
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/settings/components/SyncSection.ts +3 -3
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +13 -13
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +1 -1
- package/front_end/panels/sources/CSSPlugin.ts +3 -3
- package/front_end/panels/sources/DebuggerPlugin.ts +4 -4
- package/front_end/panels/sources/NavigatorView.ts +3 -3
- package/front_end/panels/sources/OutlineQuickOpen.ts +1 -1
- package/front_end/panels/sources/PersistenceActions.ts +2 -2
- package/front_end/panels/sources/SourcesNavigator.ts +5 -5
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +0 -1
- package/front_end/panels/sources/components/HeadersView.ts +1 -1
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +1 -1
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +1 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +0 -1
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +2 -2
- package/front_end/panels/timeline/components/FieldSettingsDialog.ts +4 -4
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +7 -7
- package/front_end/panels/timeline/components/MetricCard.ts +3 -3
- package/front_end/panels/timeline/components/MetricCompareStrings.ts +12 -14
- package/front_end/panels/timeline/components/OriginMap.ts +3 -3
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +4 -4
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +6 -0
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +1 -1
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +3 -1
- package/front_end/panels/timeline/timelineMiniMap.css +9 -9
- package/front_end/panels/timeline/timelineStatusDialog.css +9 -9
- package/front_end/panels/web_audio/WebAudioView.ts +1 -1
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +114 -3
- package/front_end/ui/comments/CommentOverlayManager.ts +95 -16
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +1 -1
- package/front_end/ui/components/markdown_view/codeBlock.css +3 -8
- package/front_end/ui/components/markdown_view/markdownView.css +2 -7
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +2 -2
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +4 -4
- package/front_end/ui/components/text_editor/AiCodeGenerationTeaser.ts +3 -3
- package/front_end/{models → ui}/geometry/GeometryImpl.ts +4 -40
- package/front_end/ui/legacy/GlassPane.ts +1 -1
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +2 -2
- package/front_end/ui/legacy/SoftDropDown.ts +1 -1
- package/front_end/ui/legacy/SplitWidget.ts +1 -1
- package/front_end/ui/legacy/SuggestBox.ts +1 -1
- package/front_end/ui/legacy/TabbedPane.ts +1 -1
- package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
- package/front_end/ui/legacy/Treeoutline.ts +5 -1
- package/front_end/ui/legacy/UIUtils.ts +1 -1
- package/front_end/ui/legacy/Widget.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingModel.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingUI.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/BezierUI.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/CSSAngleUtils.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/PositionAreaEditor.ts +204 -17
- package/front_end/ui/legacy/components/inline_editor/positionAreaEditor.css +6 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +7 -9
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +12 -0
- package/package.json +7 -4
- /package/front_end/{models → ui}/geometry/geometry.ts +0 -0
package/eslint.config.mjs
CHANGED
|
@@ -265,7 +265,8 @@ export default defineConfig([
|
|
|
265
265
|
'error',
|
|
266
266
|
{
|
|
267
267
|
selector: 'ExportDefaultDeclaration',
|
|
268
|
-
message:
|
|
268
|
+
message:
|
|
269
|
+
'Default exports are not allowed. Use named exports instead.',
|
|
269
270
|
},
|
|
270
271
|
],
|
|
271
272
|
/**
|
|
@@ -948,6 +949,8 @@ export default defineConfig([
|
|
|
948
949
|
'eslint.config.mjs',
|
|
949
950
|
'**/*/rollup.config.mjs',
|
|
950
951
|
'**/*.rollup.js',
|
|
952
|
+
'**/*/karma.conf.ts',
|
|
953
|
+
'**/*/karma.conf.in.js',
|
|
951
954
|
],
|
|
952
955
|
rules: {
|
|
953
956
|
// The config operate on the default export
|
|
@@ -32,14 +32,24 @@ export function decode(input: string): Uint8Array<ArrayBuffer> {
|
|
|
32
32
|
return bytes;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
export type BlobPart = ArrayBufferLike|Uint8Array|Blob|string;
|
|
36
|
+
|
|
35
37
|
/**
|
|
36
38
|
* Note: if input can be very large (larger than the max string size), callers should
|
|
37
39
|
* expect this to throw an error.
|
|
38
40
|
*/
|
|
39
41
|
export async function encode(input: BlobPart): Promise<string> {
|
|
42
|
+
const maybeFileReader = (globalThis as Record<string, unknown>)['FileReader'] as (new () => {
|
|
43
|
+
onerror: (() => void) | null,
|
|
44
|
+
onload: (() => void) | null,
|
|
45
|
+
result: string | ArrayBuffer | null,
|
|
46
|
+
readAsDataURL(blob: Blob): void,
|
|
47
|
+
}) |
|
|
48
|
+
undefined;
|
|
49
|
+
|
|
40
50
|
// Node.js environment (for foundation unit tests)
|
|
41
|
-
if (
|
|
42
|
-
const blob = new Blob([input]);
|
|
51
|
+
if (!maybeFileReader) {
|
|
52
|
+
const blob = new Blob([input as unknown as (ArrayBuffer | Blob | string)]);
|
|
43
53
|
const arrayBuffer = await blob.arrayBuffer();
|
|
44
54
|
// Use globalThis.Buffer to avoid TypeScript errors if Node types are not included.
|
|
45
55
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -48,7 +58,7 @@ export async function encode(input: BlobPart): Promise<string> {
|
|
|
48
58
|
|
|
49
59
|
// Browser environment
|
|
50
60
|
return await new Promise((resolve, reject) => {
|
|
51
|
-
const reader = new
|
|
61
|
+
const reader = new maybeFileReader();
|
|
52
62
|
reader.onerror = () => reject(new Error('failed to convert to base64: internal error'));
|
|
53
63
|
reader.onload = () => {
|
|
54
64
|
// The input was too large to encode as a string. The caller should anticipate
|
|
@@ -71,6 +81,6 @@ export async function encode(input: BlobPart): Promise<string> {
|
|
|
71
81
|
resolve(base64);
|
|
72
82
|
};
|
|
73
83
|
|
|
74
|
-
reader.readAsDataURL(new Blob([input]));
|
|
84
|
+
reader.readAsDataURL(new Blob([input as unknown as (ArrayBuffer | Blob | string)]));
|
|
75
85
|
});
|
|
76
86
|
}
|
|
@@ -19,7 +19,7 @@ export async function arrayBufferToString(ab: ArrayBufferLike): Promise<string>
|
|
|
19
19
|
if (isGzip(ab)) {
|
|
20
20
|
return await decompress(ab);
|
|
21
21
|
}
|
|
22
|
-
const str = new TextDecoder('utf-8').decode(ab);
|
|
22
|
+
const str = new TextDecoder('utf-8').decode(new Uint8Array(ab));
|
|
23
23
|
return str;
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -128,7 +128,6 @@ export function eventMixin<
|
|
|
128
128
|
Events,
|
|
129
129
|
Base extends Platform.Constructor.Constructor<EventMixinBase>,
|
|
130
130
|
>(base: Base): EventMixin<Events, Base> {
|
|
131
|
-
console.assert((base as unknown) !== HTMLElement);
|
|
132
131
|
return class EventHandling extends base implements EventTarget<Events> {
|
|
133
132
|
// Note that the weird name is due to TSC disallowing private/protected fields in
|
|
134
133
|
// anonmous exported classes. We use a `__` prefix to prevent clashes with `base`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright 2026 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
|
+
export class Size {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
constructor(width: number, height: number) {
|
|
9
|
+
this.width = width;
|
|
10
|
+
this.height = height;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
clipTo(size?: Size|null): Size {
|
|
14
|
+
if (!size) {
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
return new Size(Math.min(this.width, size.width), Math.min(this.height, size.height));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
scale(scale: number): Size {
|
|
21
|
+
return new Size(this.width * scale, this.height * scale);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
isEqual(size: Size|null): boolean {
|
|
25
|
+
return size !== null && this.width === size.width && this.height === size.height;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
widthToMax(size: number|Size): Size {
|
|
29
|
+
return new Size(Math.max(this.width, (typeof size === 'number' ? size : size.width)), this.height);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
addWidth(size: number|Size): Size {
|
|
33
|
+
return new Size(this.width + (typeof size === 'number' ? size : size.width), this.height);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
heightToMax(size: number|Size): Size {
|
|
37
|
+
return new Size(this.width, Math.max(this.height, (typeof size === 'number' ? size : size.height)));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
addHeight(size: number|Size): Size {
|
|
41
|
+
return new Size(this.width, this.height + (typeof size === 'number' ? size : size.height));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
export interface ScreenshotOptions {
|
|
6
|
+
base64Png: string;
|
|
7
|
+
fileName: string;
|
|
8
|
+
clip?: {
|
|
9
|
+
screenRectWidth: number,
|
|
10
|
+
screenRectHeight: number,
|
|
11
|
+
visiblePageRectLeft: number,
|
|
12
|
+
visiblePageRectTop: number,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
5
16
|
/**
|
|
6
17
|
* Provides abstractions for host features that require different implementations depending
|
|
7
18
|
* on whether DevTools runs in the browser or Node.js
|
|
@@ -12,6 +23,9 @@ export interface HostRuntime {
|
|
|
12
23
|
getOnLine(): boolean;
|
|
13
24
|
getUserAgent(): string;
|
|
14
25
|
getLocalStorage(): Storage|undefined;
|
|
26
|
+
getDevicePixelRatio(): number;
|
|
27
|
+
saveScreenshot(options: ScreenshotOptions): Promise<void>;
|
|
28
|
+
revokeLastScreenshotUrl(): void;
|
|
15
29
|
}
|
|
16
30
|
|
|
17
31
|
/**
|
|
@@ -69,6 +69,67 @@ class WebWorker implements Api.HostRuntime.Worker {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
let lastScreenshotBlobUrl: string|null = null;
|
|
73
|
+
|
|
74
|
+
function revokeLastScreenshotUrl(): void {
|
|
75
|
+
if (lastScreenshotBlobUrl) {
|
|
76
|
+
URL.revokeObjectURL(lastScreenshotBlobUrl);
|
|
77
|
+
lastScreenshotBlobUrl = null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function saveScreenshot(options: Api.HostRuntime.ScreenshotOptions): Promise<void> {
|
|
82
|
+
const pageImage = new Image();
|
|
83
|
+
await new Promise<void>((resolve, reject) => {
|
|
84
|
+
pageImage.onload = () => resolve();
|
|
85
|
+
pageImage.onerror = () => reject(new Error('Failed to load image for screenshot'));
|
|
86
|
+
pageImage.src = 'data:image/png;base64,' + options.base64Png;
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
let canvas: OffscreenCanvas;
|
|
90
|
+
if (options.clip) {
|
|
91
|
+
const scale = pageImage.naturalWidth / options.clip.screenRectWidth;
|
|
92
|
+
const screenRectWidth = options.clip.screenRectWidth * scale;
|
|
93
|
+
const screenRectHeight = options.clip.screenRectHeight * scale;
|
|
94
|
+
const contentLeft = options.clip.visiblePageRectLeft * scale;
|
|
95
|
+
const contentTop = options.clip.visiblePageRectTop * scale;
|
|
96
|
+
|
|
97
|
+
canvas = new OffscreenCanvas(
|
|
98
|
+
Math.floor(screenRectWidth),
|
|
99
|
+
// Cap the height to not hit the GPU limit.
|
|
100
|
+
// https://crbug.com/1260828
|
|
101
|
+
Math.min(1 << 14, Math.floor(screenRectHeight)),
|
|
102
|
+
);
|
|
103
|
+
const ctx = canvas.getContext('2d', {willReadFrequently: true});
|
|
104
|
+
if (!ctx) {
|
|
105
|
+
throw new Error('Could not get 2d context from canvas.');
|
|
106
|
+
}
|
|
107
|
+
ctx.imageSmoothingEnabled = false;
|
|
108
|
+
ctx.drawImage(pageImage, Math.floor(contentLeft), Math.floor(contentTop));
|
|
109
|
+
} else {
|
|
110
|
+
canvas = new OffscreenCanvas(
|
|
111
|
+
pageImage.naturalWidth,
|
|
112
|
+
Math.min(1 << 14, Math.floor(pageImage.naturalHeight)),
|
|
113
|
+
);
|
|
114
|
+
const ctx = canvas.getContext('2d', {willReadFrequently: true});
|
|
115
|
+
if (!ctx) {
|
|
116
|
+
throw new Error('Could not get 2d context for base64 screenshot.');
|
|
117
|
+
}
|
|
118
|
+
ctx.imageSmoothingEnabled = false;
|
|
119
|
+
ctx.drawImage(pageImage, 0, 0);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
revokeLastScreenshotUrl();
|
|
123
|
+
/* eslint-disable-next-line @devtools/no-imperative-dom-api */
|
|
124
|
+
const link = document.createElement('a');
|
|
125
|
+
link.download = options.fileName + '.png';
|
|
126
|
+
const blob = await canvas.convertToBlob({type: 'image/png'});
|
|
127
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
128
|
+
lastScreenshotBlobUrl = blobUrl;
|
|
129
|
+
link.href = blobUrl;
|
|
130
|
+
link.click();
|
|
131
|
+
}
|
|
132
|
+
|
|
72
133
|
export const HOST_RUNTIME: Api.HostRuntime.HostRuntime = {
|
|
73
134
|
createWorker(url: string): Api.HostRuntime.Worker {
|
|
74
135
|
return new WebWorker(url);
|
|
@@ -84,4 +145,9 @@ export const HOST_RUNTIME: Api.HostRuntime.HostRuntime = {
|
|
|
84
145
|
undefined {
|
|
85
146
|
return 'localStorage' in globalThis ? globalThis.localStorage : undefined;
|
|
86
147
|
},
|
|
148
|
+
getDevicePixelRatio(): number {
|
|
149
|
+
return window.devicePixelRatio;
|
|
150
|
+
},
|
|
151
|
+
saveScreenshot,
|
|
152
|
+
revokeLastScreenshotUrl,
|
|
87
153
|
};
|
|
@@ -19,14 +19,16 @@ class NodeWorkerScope implements Api.HostRuntime.WorkerScope {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
class NodeWorker implements Api.HostRuntime.Worker {
|
|
22
|
+
readonly #worker: WorkerThreads.Worker;
|
|
22
23
|
readonly #workerPromise: Promise<WorkerThreads.Worker>;
|
|
23
24
|
#disposed = false;
|
|
24
25
|
#rejectWorkerPromise?: (error: Error) => void;
|
|
25
26
|
|
|
26
27
|
constructor(url: string) {
|
|
27
|
-
|
|
28
|
+
const worker = new WorkerThreads.Worker(new URL(url));
|
|
29
|
+
this.#worker = worker;
|
|
30
|
+
this.#workerPromise = new Promise<WorkerThreads.Worker>((resolve, reject) => {
|
|
28
31
|
this.#rejectWorkerPromise = reject;
|
|
29
|
-
const worker = new WorkerThreads.Worker(new URL(url));
|
|
30
32
|
worker.once('message', (message: unknown) => {
|
|
31
33
|
if (message === 'workerReady') {
|
|
32
34
|
resolve(worker);
|
|
@@ -34,6 +36,8 @@ class NodeWorker implements Api.HostRuntime.Worker {
|
|
|
34
36
|
});
|
|
35
37
|
worker.on('error', reject);
|
|
36
38
|
});
|
|
39
|
+
// Prevent unhandled promise rejections if the worker is terminated early.
|
|
40
|
+
this.#workerPromise.catch(() => {});
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
postMessage(message: unknown, transfer?: Api.HostRuntime.WorkerTransferable[]): void {
|
|
@@ -46,7 +50,7 @@ class NodeWorker implements Api.HostRuntime.Worker {
|
|
|
46
50
|
|
|
47
51
|
dispose(): void {
|
|
48
52
|
this.#disposed = true;
|
|
49
|
-
void this.#
|
|
53
|
+
void this.#worker.terminate();
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
terminate(immediately?: boolean): void {
|
|
@@ -92,4 +96,9 @@ export const HOST_RUNTIME: Api.HostRuntime.HostRuntime = {
|
|
|
92
96
|
undefined {
|
|
93
97
|
return undefined;
|
|
94
98
|
},
|
|
99
|
+
getDevicePixelRatio(): number {
|
|
100
|
+
return 1;
|
|
101
|
+
},
|
|
102
|
+
async saveScreenshot(_options: Api.HostRuntime.ScreenshotOptions): Promise<void>{},
|
|
103
|
+
revokeLastScreenshotUrl(): void{},
|
|
95
104
|
};
|
|
@@ -19,6 +19,7 @@ import * as TypeScriptUtilities from './TypescriptUtilities.js';
|
|
|
19
19
|
import * as UIString from './UIString.js';
|
|
20
20
|
import * as UserVisibleError from './UserVisibleError.js';
|
|
21
21
|
|
|
22
|
+
export {Size} from './Size.js';
|
|
22
23
|
/* `assertNotNullOrUndefined` also need to be exposed, as TypeScript does
|
|
23
24
|
* not allow `asserts` functions to be used with qualified access (e.g.
|
|
24
25
|
* `Platform.TypeScriptUtilities.assertNotNullOrUndefined` causes a compile
|
|
@@ -352,7 +352,7 @@ export class AccessibilityModel extends SDKModel<EventTypes> implements Protocol
|
|
|
352
352
|
Promise<AccessibilityNode[]> {
|
|
353
353
|
const parent = this.#axIdToAXNode.get(nodeId);
|
|
354
354
|
if (!parent) {
|
|
355
|
-
|
|
355
|
+
return [];
|
|
356
356
|
}
|
|
357
357
|
if (!parent.hasUnloadedChildren()) {
|
|
358
358
|
return parent.children();
|
|
@@ -370,7 +370,7 @@ export class AccessibilityModel extends SDKModel<EventTypes> implements Protocol
|
|
|
370
370
|
this.#pendingChildRequests.delete(nodeId);
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
return
|
|
373
|
+
return this.#axIdToAXNode.get(nodeId)?.children() ?? [];
|
|
374
374
|
}
|
|
375
375
|
|
|
376
376
|
async requestAndLoadSubTreeToNode(node: DOMNode): Promise<AccessibilityNode[]|null> {
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
localEvalCSS,
|
|
35
35
|
MathFunctionMatcher,
|
|
36
36
|
PositionAnchorMatcher,
|
|
37
|
+
PositionAreaMatcher,
|
|
37
38
|
PositionTryMatcher,
|
|
38
39
|
RelativeColorChannelMatcher,
|
|
39
40
|
ShadowMatcher,
|
|
@@ -1068,6 +1069,7 @@ export class CSSMatchedStyles {
|
|
|
1068
1069
|
new AnchorFunctionMatcher(),
|
|
1069
1070
|
new PositionAnchorMatcher(),
|
|
1070
1071
|
new FlexGridGridLanesMatcher(),
|
|
1072
|
+
new PositionAreaMatcher(),
|
|
1071
1073
|
new PositionTryMatcher(),
|
|
1072
1074
|
new LengthMatcher(),
|
|
1073
1075
|
new MathFunctionMatcher(),
|
|
@@ -1508,3 +1508,32 @@ export class EnvFunctionMatcher extends EnvFunctionMatcherBase {
|
|
|
1508
1508
|
return new EnvFunctionMatch(matching.ast.text(node), node, varName, value ?? fallbackValue ?? null, Boolean(value));
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
|
+
|
|
1512
|
+
export class PositionAreaMatch implements Match {
|
|
1513
|
+
constructor(readonly text: string, readonly node: CodeMirror.SyntaxNode) {
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
const PositionAreaMatcherBase: MatcherClass<PositionAreaMatch> = matcherBase(PositionAreaMatch);
|
|
1518
|
+
// clang-format off
|
|
1519
|
+
export class PositionAreaMatcher extends PositionAreaMatcherBase {
|
|
1520
|
+
// clang-format on
|
|
1521
|
+
override accepts(propertyName: string): boolean {
|
|
1522
|
+
return propertyName === 'position-area' || propertyName === 'inset-area';
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
override matches(node: CodeMirror.SyntaxNode, matching: BottomUpTreeMatching): PositionAreaMatch|null {
|
|
1526
|
+
if (node.name !== 'Declaration') {
|
|
1527
|
+
return null;
|
|
1528
|
+
}
|
|
1529
|
+
const valueNodes = ASTUtils.siblings(ASTUtils.declValue(node));
|
|
1530
|
+
if (valueNodes.length === 0) {
|
|
1531
|
+
return null;
|
|
1532
|
+
}
|
|
1533
|
+
const valueText = matching.getComputedTextRange(valueNodes[0], valueNodes[valueNodes.length - 1]);
|
|
1534
|
+
if (CSSMetadata.isCSSWideKeyword(valueText)) {
|
|
1535
|
+
return null;
|
|
1536
|
+
}
|
|
1537
|
+
return new PositionAreaMatch(valueText, node);
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
@@ -19,11 +19,11 @@ const UIStrings = {
|
|
|
19
19
|
/**
|
|
20
20
|
* @description Error message for when a CSS file can't be loaded.
|
|
21
21
|
*/
|
|
22
|
-
couldNotFindTheOriginalStyle: 'Could not find the original style sheet
|
|
22
|
+
couldNotFindTheOriginalStyle: 'Could not find the original style sheet',
|
|
23
23
|
/**
|
|
24
24
|
* @description Error message to display when a source CSS file could not be retrieved.
|
|
25
25
|
*/
|
|
26
|
-
couldNotRetrieveSourceStyles: 'Could not retrieve source styles
|
|
26
|
+
couldNotRetrieveSourceStyles: 'Could not retrieve source styles',
|
|
27
27
|
} as const;
|
|
28
28
|
const str_ = i18n.i18n.registerUIStrings('core/sdk/CSSStyleSheetHeader.ts', UIStrings);
|
|
29
29
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -56,16 +56,16 @@ const UIStrings = {
|
|
|
56
56
|
* @description Text shown in the console when a performance profile (with the given name) was started.
|
|
57
57
|
* @example {title} PH1
|
|
58
58
|
*/
|
|
59
|
-
profileSStarted: 'Profile \'\'{PH1}\'\' started
|
|
59
|
+
profileSStarted: 'Profile \'\'{PH1}\'\' started',
|
|
60
60
|
/**
|
|
61
61
|
* @description Text shown in the console when a performance profile (with the given name) was stopped.
|
|
62
62
|
* @example {name} PH1
|
|
63
63
|
*/
|
|
64
|
-
profileSFinished: 'Profile \'\'{PH1}\'\' finished
|
|
64
|
+
profileSFinished: 'Profile \'\'{PH1}\'\' finished',
|
|
65
65
|
/**
|
|
66
66
|
* @description Error message shown in the console after the user tries to save a JavaScript value to a temporary variable.
|
|
67
67
|
*/
|
|
68
|
-
failedToSaveToTempVariable: 'Failed to save to temp variable
|
|
68
|
+
failedToSaveToTempVariable: 'Failed to save to temp variable',
|
|
69
69
|
} as const;
|
|
70
70
|
|
|
71
71
|
const str_ = i18n.i18n.registerUIStrings('core/sdk/ConsoleModel.ts', UIStrings);
|
|
@@ -1076,17 +1076,19 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
|
|
|
1076
1076
|
});
|
|
1077
1077
|
}
|
|
1078
1078
|
|
|
1079
|
-
duplicate():
|
|
1079
|
+
async duplicate(): Promise<{error: string | null, node: DOMNode|null}> {
|
|
1080
1080
|
if (this.isInShadowTree()) {
|
|
1081
|
-
return;
|
|
1081
|
+
return {error: 'Cannot duplicate node in shadow tree', node: null};
|
|
1082
1082
|
}
|
|
1083
1083
|
|
|
1084
1084
|
const parentNode = this.parentNode ? this.parentNode : this;
|
|
1085
1085
|
if (parentNode.nodeName() === '#document') {
|
|
1086
|
-
return;
|
|
1086
|
+
return {error: 'Parent node is document', node: null};
|
|
1087
1087
|
}
|
|
1088
1088
|
|
|
1089
|
-
|
|
1089
|
+
return await new Promise(resolve => {
|
|
1090
|
+
this.copyTo(parentNode, this.nextSibling, (error, node) => resolve({error, node}));
|
|
1091
|
+
});
|
|
1090
1092
|
}
|
|
1091
1093
|
|
|
1092
1094
|
/**
|
|
@@ -2564,7 +2566,8 @@ export class DOMNodeSnapshot extends DOMNode {
|
|
|
2564
2566
|
_callback?: ((arg0: string|null, arg1: DOMNode|null) => void)|undefined): void {
|
|
2565
2567
|
}
|
|
2566
2568
|
|
|
2567
|
-
override duplicate():
|
|
2569
|
+
override duplicate(): Promise<{error: string | null, node: DOMNode|null}> {
|
|
2570
|
+
return Promise.resolve({error: null, node: null});
|
|
2568
2571
|
}
|
|
2569
2572
|
|
|
2570
2573
|
override canInspectNode(): boolean {
|
|
@@ -2616,7 +2619,8 @@ export class DOMDocumentSnapshot extends DOMDocument {
|
|
|
2616
2619
|
_callback?: ((arg0: string|null, arg1: DOMNode|null) => void)|undefined): void {
|
|
2617
2620
|
}
|
|
2618
2621
|
|
|
2619
|
-
override duplicate():
|
|
2622
|
+
override duplicate(): Promise<{error: string | null, node: DOMNode|null}> {
|
|
2623
|
+
return Promise.resolve({error: null, node: null});
|
|
2620
2624
|
}
|
|
2621
2625
|
|
|
2622
2626
|
override canInspectNode(): boolean {
|
|
@@ -1331,6 +1331,7 @@ export class CallFrame {
|
|
|
1331
1331
|
generatePreview: options.generatePreview,
|
|
1332
1332
|
throwOnSideEffect: options.throwOnSideEffect,
|
|
1333
1333
|
timeout: options.timeout,
|
|
1334
|
+
scopeNumber: options.scopeNumber,
|
|
1334
1335
|
});
|
|
1335
1336
|
const error = response.getError();
|
|
1336
1337
|
if (error) {
|
|
@@ -1407,6 +1408,11 @@ export class Scope implements ScopeChainEntry {
|
|
|
1407
1408
|
return this.#callFrame;
|
|
1408
1409
|
}
|
|
1409
1410
|
|
|
1411
|
+
/** The index of this scope in {@link CallFrame.scopeChain}, usable as an `evaluateOnCallFrame` `scopeNumber`. */
|
|
1412
|
+
ordinal(): number {
|
|
1413
|
+
return this.#ordinal;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1410
1416
|
type(): string {
|
|
1411
1417
|
return this.#type;
|
|
1412
1418
|
}
|
|
@@ -30,15 +30,15 @@ const UIStrings = {
|
|
|
30
30
|
/**
|
|
31
31
|
* @description Tooltip to explain why a cookie was blocked.
|
|
32
32
|
*/
|
|
33
|
-
secureOnly: 'This cookie was blocked because it had the "`Secure`" attribute and the connection was not secure
|
|
33
|
+
secureOnly: 'This cookie was blocked because it had the "`Secure`" attribute and the connection was not secure',
|
|
34
34
|
/**
|
|
35
35
|
* @description Tooltip to explain why a cookie was blocked.
|
|
36
36
|
*/
|
|
37
|
-
notOnPath: 'This cookie was blocked because its path was not an exact match for or a superdirectory of the request URL’s path
|
|
37
|
+
notOnPath: 'This cookie was blocked because its path was not an exact match for or a superdirectory of the request URL’s path',
|
|
38
38
|
/**
|
|
39
39
|
* @description Tooltip to explain why a cookie was blocked.
|
|
40
40
|
*/
|
|
41
|
-
domainMismatch: 'This cookie was blocked because neither did the request URL’s domain exactly match the cookie’s domain, nor was the request URL’s domain a subdomain of the cookie’s Domain attribute value
|
|
41
|
+
domainMismatch: 'This cookie was blocked because neither did the request URL’s domain exactly match the cookie’s domain, nor was the request URL’s domain a subdomain of the cookie’s Domain attribute value',
|
|
42
42
|
/**
|
|
43
43
|
* @description Tooltip to explain why a cookie was blocked.
|
|
44
44
|
*/
|
|
@@ -46,7 +46,7 @@ const UIStrings = {
|
|
|
46
46
|
/**
|
|
47
47
|
* @description Tooltip to explain why a cookie was blocked.
|
|
48
48
|
*/
|
|
49
|
-
sameSiteLax: 'This cookie was blocked because it had the "`SameSite=Lax`" attribute and the request was made from a different site and was not initiated by a top-level navigation
|
|
49
|
+
sameSiteLax: 'This cookie was blocked because it had the "`SameSite=Lax`" attribute and the request was made from a different site and was not initiated by a top-level navigation',
|
|
50
50
|
/**
|
|
51
51
|
* @description Tooltip to explain why a cookie was blocked.
|
|
52
52
|
*/
|
|
@@ -58,7 +58,7 @@ const UIStrings = {
|
|
|
58
58
|
/**
|
|
59
59
|
* @description Tooltip to explain why a cookie was blocked.
|
|
60
60
|
*/
|
|
61
|
-
userPreferences: 'This cookie was blocked due to user preferences
|
|
61
|
+
userPreferences: 'This cookie was blocked due to user preferences',
|
|
62
62
|
/**
|
|
63
63
|
* @description Tooltip to explain why a cookie was blocked.
|
|
64
64
|
*/
|
|
@@ -66,7 +66,7 @@ const UIStrings = {
|
|
|
66
66
|
/**
|
|
67
67
|
* @description Tooltip to explain why a cookie was blocked.
|
|
68
68
|
*/
|
|
69
|
-
unknownError: 'An unknown error was encountered when trying to send this cookie
|
|
69
|
+
unknownError: 'An unknown error was encountered when trying to send this cookie',
|
|
70
70
|
/**
|
|
71
71
|
* @description Tooltip to explain why a cookie was blocked due to exceeding the maximum size.
|
|
72
72
|
*/
|
|
@@ -74,7 +74,7 @@ const UIStrings = {
|
|
|
74
74
|
/**
|
|
75
75
|
* @description Tooltip to explain why an attempt to set a cookie via `Set-Cookie` HTTP header on a request's response was blocked.
|
|
76
76
|
*/
|
|
77
|
-
thisSetcookieWasBlockedDueToUser: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked due to user preferences
|
|
77
|
+
thisSetcookieWasBlockedDueToUser: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked due to user preferences',
|
|
78
78
|
/**
|
|
79
79
|
* @description Tooltip to explain why an attempt to set a cookie via `Set-Cookie` HTTP header on a request's response was blocked.
|
|
80
80
|
*/
|
|
@@ -82,28 +82,28 @@ const UIStrings = {
|
|
|
82
82
|
/**
|
|
83
83
|
* @description Tooltip to explain why an attempt to set a cookie via `Set-Cookie` HTTP header on a request's response was blocked.
|
|
84
84
|
*/
|
|
85
|
-
thisSetcookieHadInvalidSyntax: 'This "`Set-Cookie`" header had invalid syntax
|
|
85
|
+
thisSetcookieHadInvalidSyntax: 'This "`Set-Cookie`" header had invalid syntax',
|
|
86
86
|
/**
|
|
87
87
|
* @description Tooltip to explain why a cookie was blocked.
|
|
88
88
|
*/
|
|
89
|
-
thisSetcookieHadADisallowedCharacter: 'This "`Set-Cookie`" header contained a disallowed character (a forbidden ASCII control character, or the tab character if it appears in the middle of the cookie name, value, an attribute name, or an attribute value)
|
|
89
|
+
thisSetcookieHadADisallowedCharacter: 'This "`Set-Cookie`" header contained a disallowed character (a forbidden ASCII control character, or the tab character if it appears in the middle of the cookie name, value, an attribute name, or an attribute value)',
|
|
90
90
|
/**
|
|
91
91
|
* @description Tooltip to explain why a cookie was blocked.
|
|
92
92
|
*/
|
|
93
|
-
theSchemeOfThisConnectionIsNot: 'The scheme of this connection is not allowed to store cookies
|
|
93
|
+
theSchemeOfThisConnectionIsNot: 'The scheme of this connection is not allowed to store cookies',
|
|
94
94
|
/**
|
|
95
95
|
* @description Tooltip to explain why a cookie was blocked.
|
|
96
96
|
*/
|
|
97
|
-
anUnknownErrorWasEncounteredWhenTrying: 'An unknown error was encountered when trying to store this cookie
|
|
97
|
+
anUnknownErrorWasEncounteredWhenTrying: 'An unknown error was encountered when trying to store this cookie',
|
|
98
98
|
/**
|
|
99
99
|
* @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
|
|
100
100
|
*/
|
|
101
|
-
blockedReasonSecureOnly: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "`Secure`" attribute but was not received over a secure connection
|
|
101
|
+
blockedReasonSecureOnly: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "`Secure`" attribute but was not received over a secure connection',
|
|
102
102
|
/**
|
|
103
103
|
* @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
|
|
104
104
|
* @example {SameSite=Strict} PH1
|
|
105
105
|
*/
|
|
106
|
-
blockedReasonSameSiteStrictLax: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation
|
|
106
|
+
blockedReasonSameSiteStrictLax: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation',
|
|
107
107
|
/**
|
|
108
108
|
* @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
|
|
109
109
|
*/
|
|
@@ -111,19 +111,19 @@ const UIStrings = {
|
|
|
111
111
|
/**
|
|
112
112
|
* @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
|
|
113
113
|
*/
|
|
114
|
-
blockedReasonSameSiteNoneInsecure: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "`SameSite=None`" attribute but did not have the "`Secure`" attribute, which is required in order to use "`SameSite=None`"
|
|
114
|
+
blockedReasonSameSiteNoneInsecure: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "`SameSite=None`" attribute but did not have the "`Secure`" attribute, which is required in order to use "`SameSite=None`"',
|
|
115
115
|
/**
|
|
116
116
|
* @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
|
|
117
117
|
*/
|
|
118
|
-
blockedReasonOverwriteSecure: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it was not sent over a secure connection and would have overwritten a cookie with the "`Secure`" attribute
|
|
118
|
+
blockedReasonOverwriteSecure: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it was not sent over a secure connection and would have overwritten a cookie with the "`Secure`" attribute',
|
|
119
119
|
/**
|
|
120
120
|
* @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
|
|
121
121
|
*/
|
|
122
|
-
blockedReasonInvalidDomain: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because its "`Domain`" attribute was invalid with regards to the current host URL
|
|
122
|
+
blockedReasonInvalidDomain: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because its "`Domain`" attribute was invalid with regards to the current host URL',
|
|
123
123
|
/**
|
|
124
124
|
* @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
|
|
125
125
|
*/
|
|
126
|
-
blockedReasonInvalidPrefix: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it used the "`__Secure-`" or "`__Host-`" prefix in its name and broke the additional rules applied to cookies with these prefixes as defined in `https://tools.ietf.org/html/draft-west-cookie-prefixes-05
|
|
126
|
+
blockedReasonInvalidPrefix: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it used the "`__Secure-`" or "`__Host-`" prefix in its name and broke the additional rules applied to cookies with these prefixes as defined in `https://tools.ietf.org/html/draft-west-cookie-prefixes-05`',
|
|
127
127
|
/**
|
|
128
128
|
* @description Tooltip to explain why a cookie was blocked when the size of the #name plus the size of the value exceeds the max size.
|
|
129
129
|
*/
|
|
@@ -136,7 +136,7 @@ const UIStrings = {
|
|
|
136
136
|
/**
|
|
137
137
|
* @description Tooltip to explain why the cookie should have been blocked by third-party cookie phaseout but is exempted.
|
|
138
138
|
*/
|
|
139
|
-
exemptionReasonUserSetting: 'This cookie is allowed by user preference
|
|
139
|
+
exemptionReasonUserSetting: 'This cookie is allowed by user preference',
|
|
140
140
|
/**
|
|
141
141
|
* @description Tooltip to explain why the cookie should have been blocked by third-party cookie phaseout but is exempted.
|
|
142
142
|
*/
|
|
@@ -152,7 +152,7 @@ const UIStrings = {
|
|
|
152
152
|
/**
|
|
153
153
|
* @description Tooltip to explain why the cookie should have been blocked by third-party cookie phaseout but is exempted.
|
|
154
154
|
*/
|
|
155
|
-
exemptionReasonScheme: 'This cookie is allowed by the top-level URL scheme
|
|
155
|
+
exemptionReasonScheme: 'This cookie is allowed by the top-level URL scheme',
|
|
156
156
|
} as const;
|
|
157
157
|
// clang-format on
|
|
158
158
|
|
|
@@ -718,6 +718,11 @@ export interface EvaluationOptions {
|
|
|
718
718
|
replMode?: boolean;
|
|
719
719
|
allowUnsafeEvalBlockedByCSP?: boolean;
|
|
720
720
|
contextId?: number;
|
|
721
|
+
/**
|
|
722
|
+
* Index into `CallFrame.scopeChain()` denoting the scope in which the expression is evaluated.
|
|
723
|
+
* Defaults to 0, i.e. the inner-most scope. Only honored by `CallFrame.evaluate`.
|
|
724
|
+
*/
|
|
725
|
+
scopeNumber?: number;
|
|
721
726
|
}
|
|
722
727
|
|
|
723
728
|
export interface CallFunctionOptions {
|
|
@@ -50,11 +50,11 @@ const UIStrings = {
|
|
|
50
50
|
/**
|
|
51
51
|
* @description Error message for when a script can't be loaded because it was removed or deleted.
|
|
52
52
|
*/
|
|
53
|
-
scriptRemovedOrDeleted: 'Script removed or deleted
|
|
53
|
+
scriptRemovedOrDeleted: 'Script removed or deleted',
|
|
54
54
|
/**
|
|
55
55
|
* @description Error message when failing to load a script source text.
|
|
56
56
|
*/
|
|
57
|
-
unableToFetchScriptSource: 'Unable to fetch script source
|
|
57
|
+
unableToFetchScriptSource: 'Unable to fetch script source',
|
|
58
58
|
} as const;
|
|
59
59
|
const str_ = i18n.i18n.registerUIStrings('core/sdk/Script.ts', UIStrings);
|
|
60
60
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -13,32 +13,32 @@ const UIStrings = {
|
|
|
13
13
|
* @example {sql-lookup} PH1
|
|
14
14
|
*/
|
|
15
15
|
deprecatedSyntaxFoundPleaseUse:
|
|
16
|
-
'Deprecated syntax found for metric "{PH1}". Use: <name>;dur=<duration>;desc=<description
|
|
16
|
+
'Deprecated syntax found for metric "{PH1}". Use: <name>;dur=<duration>;desc=<description>.',
|
|
17
17
|
/**
|
|
18
18
|
* @description Warning message when a duplicate parameter is found in Server-Timing header.
|
|
19
19
|
* @example {https} PH1
|
|
20
20
|
*/
|
|
21
|
-
duplicateParameterSIgnored: 'Duplicate parameter "{PH1}" ignored
|
|
21
|
+
duplicateParameterSIgnored: 'Duplicate parameter "{PH1}" ignored',
|
|
22
22
|
/**
|
|
23
23
|
* @description Warning message when no value is found for a parameter in Server-Timing header.
|
|
24
24
|
* @example {https} PH1
|
|
25
25
|
*/
|
|
26
|
-
noValueFoundForParameterS: 'No value found for parameter "{PH1}"
|
|
26
|
+
noValueFoundForParameterS: 'No value found for parameter "{PH1}"',
|
|
27
27
|
/**
|
|
28
28
|
* @description Warning message when an unrecognized parameter is found in Server-Timing header.
|
|
29
29
|
* @example {https} PH1
|
|
30
30
|
*/
|
|
31
|
-
unrecognizedParameterS: 'Unrecognized parameter "{PH1}"
|
|
31
|
+
unrecognizedParameterS: 'Unrecognized parameter "{PH1}"',
|
|
32
32
|
/**
|
|
33
33
|
* @description Warning message when extraneous trailing characters are found in Server-Timing header.
|
|
34
34
|
*/
|
|
35
|
-
extraneousTrailingCharacters: 'Extraneous trailing characters
|
|
35
|
+
extraneousTrailingCharacters: 'Extraneous trailing characters',
|
|
36
36
|
/**
|
|
37
37
|
* @description Warning message when a parameter value cannot be parsed in Server-Timing header.
|
|
38
38
|
* @example {https} PH1
|
|
39
39
|
* @example {2.0} PH2
|
|
40
40
|
*/
|
|
41
|
-
unableToParseSValueS: 'Unable to parse "{PH1}" value "{PH2}"
|
|
41
|
+
unableToParseSValueS: 'Unable to parse "{PH1}" value "{PH2}"',
|
|
42
42
|
} as const;
|
|
43
43
|
const str_ = i18n.i18n.registerUIStrings('core/sdk/ServerTiming.ts', UIStrings);
|
|
44
44
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|