chrome-devtools-frontend 1.0.1587905 → 1.0.1589336
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/docs/ui_engineering.md +2 -2
- package/front_end/core/common/AppProvider.ts +1 -2
- package/front_end/core/common/Color.ts +19 -20
- package/front_end/core/common/ParsedURL.ts +3 -3
- package/front_end/core/common/Progress.ts +5 -5
- package/front_end/core/common/Settings.ts +2 -2
- package/front_end/core/dom_extension/DOMExtension.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostStub.ts +1 -11
- package/front_end/core/host/UserMetrics.ts +1 -1
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +2 -2
- package/front_end/core/sdk/CSSMatchedStyles.ts +1 -1
- package/front_end/core/sdk/CSSProperty.ts +38 -0
- package/front_end/core/sdk/CSSRule.ts +4 -9
- package/front_end/core/sdk/ChildTargetManager.ts +1 -1
- package/front_end/core/sdk/CookieModel.ts +0 -1
- package/front_end/core/sdk/DOMModel.ts +42 -6
- package/front_end/core/sdk/EmulationModel.ts +3 -3
- package/front_end/core/sdk/NetworkRequest.ts +1 -1
- package/front_end/core/sdk/PageResourceLoader.ts +11 -6
- package/front_end/core/sdk/PerformanceMetricsModel.ts +2 -2
- package/front_end/core/sdk/PreloadingModel.ts +15 -6
- package/front_end/core/sdk/ResourceTreeModel.ts +2 -6
- package/front_end/core/sdk/SourceMap.ts +2 -3
- package/front_end/core/sdk/SourceMapManager.ts +1 -2
- package/front_end/entrypoint_template.html +1 -1
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +6 -16
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +4 -2
- package/front_end/entrypoints/main/main-meta.ts +0 -3
- package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +0 -2
- package/front_end/generated/InspectorBackendCommands.ts +6 -4
- package/front_end/generated/SupportedCSSProperties.js +46 -0
- package/front_end/generated/protocol-mapping.d.ts +4 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/generated/protocol.ts +50 -0
- package/front_end/models/ai_assistance/AiConversation.ts +20 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +7 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +28 -26
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +3 -5
- package/front_end/models/computed_style/ComputedStyleModel.ts +2 -1
- package/front_end/models/emulation/DeviceModeModel.ts +0 -3
- package/front_end/models/emulation/EmulatedDevices.ts +0 -2
- package/front_end/models/extensions/ExtensionAPI.ts +2 -2
- package/front_end/models/har/Importer.ts +0 -1
- package/front_end/models/har/Log.ts +2 -11
- package/front_end/models/javascript_metadata/NativeFunctions.js +5 -21
- package/front_end/models/logs/NetworkLog.ts +0 -2
- package/front_end/models/network_time_calculator/NetworkTimeCalculator.ts +4 -1
- package/front_end/models/text_utils/TextUtils.ts +0 -9
- package/front_end/models/trace/LanternComputationData.ts +1 -6
- package/front_end/models/trace/helpers/Trace.ts +1 -4
- package/front_end/models/trace/lantern/types/Lantern.ts +6 -6
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +7 -6
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +15 -26
- package/front_end/panels/application/BackgroundServiceView.ts +0 -2
- package/front_end/panels/application/DeviceBoundSessionsModel.ts +0 -1
- package/front_end/panels/application/IndexedDBViews.ts +19 -23
- package/front_end/panels/application/OriginTrialTreeView.ts +3 -3
- package/front_end/panels/application/components/BackForwardCacheView.ts +1 -1
- package/front_end/panels/application/preloading/PreloadingView.ts +18 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.css +12 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +3 -3
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +3 -4
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +76 -19
- package/front_end/panels/common/aiCodeGenerationTeaser.css +11 -0
- package/front_end/panels/console/ConsoleSidebar.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +4 -0
- package/front_end/panels/console/ConsoleViewMessage.ts +3 -3
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +1 -1
- package/front_end/panels/elements/ComputedStyleWidget.ts +32 -32
- package/front_end/panels/elements/ElementsPanel.ts +12 -4
- package/front_end/panels/elements/ElementsTreeElement.ts +9 -1
- package/front_end/panels/elements/ImagePreviewPopover.ts +0 -2
- package/front_end/panels/elements/MarkerDecorator.ts +0 -2
- package/front_end/panels/elements/PropertiesWidget.ts +62 -61
- package/front_end/panels/elements/StylePropertiesSection.ts +32 -3
- package/front_end/panels/elements/StylePropertyTreeElement.ts +15 -20
- package/front_end/panels/elements/StylesSidebarPane.ts +25 -90
- package/front_end/panels/elements/elementsPanel.css +6 -2
- package/front_end/panels/emulation/emulation-meta.ts +0 -2
- package/front_end/panels/event_listeners/EventListenersUtils.ts +0 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +0 -5
- package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +1 -3
- package/front_end/panels/media/EventDisplayTable.ts +0 -2
- package/front_end/panels/media/PlayerMessagesView.ts +4 -6
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +18 -6
- package/front_end/panels/network/EventSourceMessagesView.ts +0 -2
- package/front_end/panels/network/NetworkLogViewColumns.ts +0 -2
- package/front_end/panels/network/NetworkManageCustomHeadersView.ts +3 -1
- package/front_end/panels/network/NetworkWaterfallColumn.ts +1 -2
- package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
- package/front_end/panels/network/RequestHeadersView.ts +113 -128
- package/front_end/panels/network/RequestInitiatorView.ts +74 -69
- package/front_end/panels/network/RequestPayloadView.ts +6 -3
- package/front_end/panels/network/ResourceChunkView.ts +0 -2
- package/front_end/panels/network/components/ResponseHeaderSection.ts +3 -1
- package/front_end/panels/network/network-meta.ts +0 -2
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -9
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +0 -2
- package/front_end/panels/profiler/LiveHeapProfileView.ts +0 -12
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +14 -1
- package/front_end/panels/profiler/ProfileView.ts +0 -35
- package/front_end/panels/profiler/profiler-meta.ts +0 -1
- package/front_end/panels/recorder/components/StepView.ts +0 -1
- package/front_end/panels/screencast/ScreencastView.ts +2 -2
- package/front_end/panels/search/SearchResultsPane.ts +3 -2
- package/front_end/panels/security/SecurityPanel.ts +0 -1
- package/front_end/panels/sensors/LocationsSettingsTab.ts +27 -9
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +1 -2
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +2 -2
- package/front_end/panels/settings/emulation/utils/UserAgentMetadata.ts +1 -1
- package/front_end/panels/settings/settings-meta.ts +0 -3
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +6 -0
- package/front_end/panels/sources/CSSPlugin.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -5
- package/front_end/panels/sources/sources-meta.ts +0 -9
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +1 -1
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +5 -2
- package/front_end/panels/timeline/TimelinePanel.ts +0 -7
- package/front_end/panels/timeline/TimelineTreeView.ts +8 -10
- package/front_end/panels/timeline/TimelineUIUtils.ts +11 -3
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -1
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +0 -1
- package/front_end/panels/timeline/utils/Treemap.ts +0 -4
- package/front_end/panels/whats_new/whats_new-meta.ts +0 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/highlighting/HighlightManager.ts +1 -2
- package/front_end/ui/components/highlighting/MarkupHighlight.ts +1 -12
- package/front_end/ui/components/icon_button/IconButton.ts +2 -2
- package/front_end/ui/components/issue_counter/IssueCounter.ts +6 -6
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +4 -0
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +11 -6
- package/front_end/ui/legacy/ContextMenu.ts +1 -17
- package/front_end/ui/legacy/EmptyWidget.ts +4 -4
- package/front_end/ui/legacy/Fragment.ts +2 -4
- package/front_end/ui/legacy/SoftContextMenu.ts +1 -15
- package/front_end/ui/legacy/TabbedPane.ts +2 -2
- package/front_end/ui/legacy/Treeoutline.ts +16 -9
- package/front_end/ui/legacy/UIUtils.ts +1 -4
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +6 -3
- package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +32 -28
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +31 -6
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +0 -2
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +0 -1
- package/front_end/ui/legacy/components/quick_open/quick_open-meta.ts +0 -2
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +3 -2
- package/front_end/ui/legacy/components/utils/ImagePreview.ts +3 -3
- package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
- package/package.json +1 -1
package/docs/ui_engineering.md
CHANGED
|
@@ -1370,9 +1370,9 @@ export const DEFAULT_VIEW = (input, _output, target) => {
|
|
|
1370
1370
|
<devtools-tree .template=${html`
|
|
1371
1371
|
<ul role="tree">
|
|
1372
1372
|
<li role="treeitem">Node 1</li>
|
|
1373
|
-
<li role="treeitem">
|
|
1373
|
+
<li role="treeitem" open>
|
|
1374
1374
|
Node 2
|
|
1375
|
-
<ul role="group"
|
|
1375
|
+
<ul role="group">
|
|
1376
1376
|
<li role="treeitem">Child 1</li>
|
|
1377
1377
|
</ul>
|
|
1378
1378
|
</li>
|
|
@@ -17,8 +17,7 @@ export function registerAppProvider(registration: AppProviderRegistration): void
|
|
|
17
17
|
}
|
|
18
18
|
export function getRegisteredAppProviders(): AppProviderRegistration[] {
|
|
19
19
|
return registeredAppProvider
|
|
20
|
-
.filter(
|
|
21
|
-
provider => Root.Runtime.Runtime.isDescriptorEnabled({experiment: undefined, condition: provider.condition}))
|
|
20
|
+
.filter(provider => Root.Runtime.Runtime.isDescriptorEnabled({condition: provider.condition}))
|
|
22
21
|
.sort((firstProvider, secondProvider) => {
|
|
23
22
|
const order1 = firstProvider.order || 0;
|
|
24
23
|
const order2 = secondProvider.order || 0;
|
|
@@ -792,7 +792,7 @@ export class Lab implements Color {
|
|
|
792
792
|
return params;
|
|
793
793
|
}
|
|
794
794
|
|
|
795
|
-
constructor(l: number, a: number, b: number, alpha: number|null, authoredText?: string
|
|
795
|
+
constructor(l: number, a: number, b: number, alpha: number|null, authoredText?: string) {
|
|
796
796
|
this.#rawParams = [l, a, b];
|
|
797
797
|
this.l = clamp(l, {min: 0, max: 100});
|
|
798
798
|
if (equals(this.l, 0, WIDE_RANGE_EPSILON) || equals(this.l, 100, WIDE_RANGE_EPSILON)) {
|
|
@@ -931,7 +931,7 @@ export class LCH implements Color {
|
|
|
931
931
|
return params;
|
|
932
932
|
}
|
|
933
933
|
|
|
934
|
-
constructor(l: number, c: number, h: number, alpha: number|null, authoredText?: string
|
|
934
|
+
constructor(l: number, c: number, h: number, alpha: number|null, authoredText?: string) {
|
|
935
935
|
this.#rawParams = [l, c, h];
|
|
936
936
|
this.l = clamp(l, {min: 0, max: 100});
|
|
937
937
|
c = equals(this.l, 0, WIDE_RANGE_EPSILON) || equals(this.l, 100, WIDE_RANGE_EPSILON) ? 0 : c;
|
|
@@ -1073,7 +1073,7 @@ export class Oklab implements Color {
|
|
|
1073
1073
|
return params;
|
|
1074
1074
|
}
|
|
1075
1075
|
|
|
1076
|
-
constructor(l: number, a: number, b: number, alpha: number|null, authoredText?: string
|
|
1076
|
+
constructor(l: number, a: number, b: number, alpha: number|null, authoredText?: string) {
|
|
1077
1077
|
this.#rawParams = [l, a, b];
|
|
1078
1078
|
this.l = clamp(l, {min: 0, max: 1});
|
|
1079
1079
|
if (equals(this.l, 0) || equals(this.l, 1)) {
|
|
@@ -1212,7 +1212,7 @@ export class Oklch implements Color {
|
|
|
1212
1212
|
return params;
|
|
1213
1213
|
}
|
|
1214
1214
|
|
|
1215
|
-
constructor(l: number, c: number, h: number, alpha: number|null, authoredText?: string
|
|
1215
|
+
constructor(l: number, c: number, h: number, alpha: number|null, authoredText?: string) {
|
|
1216
1216
|
this.#rawParams = [l, c, h];
|
|
1217
1217
|
this.l = clamp(l, {min: 0, max: 1});
|
|
1218
1218
|
c = equals(this.l, 0) || equals(this.l, 1) ? 0 : c;
|
|
@@ -1379,8 +1379,7 @@ export class ColorFunction implements Color {
|
|
|
1379
1379
|
return params;
|
|
1380
1380
|
}
|
|
1381
1381
|
|
|
1382
|
-
constructor(
|
|
1383
|
-
colorSpace: ColorSpace, p0: number, p1: number, p2: number, alpha: number|null, authoredText?: string|undefined) {
|
|
1382
|
+
constructor(colorSpace: ColorSpace, p0: number, p1: number, p2: number, alpha: number|null, authoredText?: string) {
|
|
1384
1383
|
this.#rawParams = [p0, p1, p2];
|
|
1385
1384
|
this.colorSpace = colorSpace;
|
|
1386
1385
|
this.#authoredText = authoredText;
|
|
@@ -1534,7 +1533,7 @@ export class HSL implements Color {
|
|
|
1534
1533
|
readonly l: number;
|
|
1535
1534
|
readonly alpha: number|null;
|
|
1536
1535
|
readonly #rawParams: Color3D;
|
|
1537
|
-
#authoredText
|
|
1536
|
+
#authoredText?: string;
|
|
1538
1537
|
readonly channels: [ColorChannel, ColorChannel, ColorChannel, ColorChannel] =
|
|
1539
1538
|
[ColorChannel.H, ColorChannel.S, ColorChannel.L, ColorChannel.ALPHA];
|
|
1540
1539
|
|
|
@@ -1588,7 +1587,7 @@ export class HSL implements Color {
|
|
|
1588
1587
|
return ColorConverter.srgbToXyzd50(rgb[0], rgb[1], rgb[2]);
|
|
1589
1588
|
}
|
|
1590
1589
|
|
|
1591
|
-
constructor(h: number, s: number, l: number, alpha
|
|
1590
|
+
constructor(h: number, s: number, l: number, alpha?: number|null, authoredText?: string) {
|
|
1592
1591
|
this.#rawParams = [h, s, l];
|
|
1593
1592
|
this.l = clamp(l, {min: 0, max: 1});
|
|
1594
1593
|
s = equals(this.l, 0) || equals(this.l, 1) ? 0 : s;
|
|
@@ -1603,7 +1602,7 @@ export class HSL implements Color {
|
|
|
1603
1602
|
const hsl = color.as(Format.HSL);
|
|
1604
1603
|
return equals(this.h, hsl.h) && equals(this.s, hsl.s) && equals(this.l, hsl.l) && equals(this.alpha, hsl.alpha);
|
|
1605
1604
|
}
|
|
1606
|
-
asString(format?: Format
|
|
1605
|
+
asString(format?: Format): string {
|
|
1607
1606
|
if (format) {
|
|
1608
1607
|
return this.as(format).asString();
|
|
1609
1608
|
}
|
|
@@ -1688,7 +1687,7 @@ export class HWB implements Color {
|
|
|
1688
1687
|
readonly b: number;
|
|
1689
1688
|
readonly alpha: number|null;
|
|
1690
1689
|
readonly #rawParams: Color3D;
|
|
1691
|
-
#authoredText
|
|
1690
|
+
#authoredText?: string;
|
|
1692
1691
|
readonly channels: [ColorChannel, ColorChannel, ColorChannel, ColorChannel] =
|
|
1693
1692
|
[ColorChannel.H, ColorChannel.W, ColorChannel.B, ColorChannel.ALPHA];
|
|
1694
1693
|
|
|
@@ -1760,7 +1759,7 @@ export class HWB implements Color {
|
|
|
1760
1759
|
const hwb = color.as(Format.HWB);
|
|
1761
1760
|
return equals(this.h, hwb.h) && equals(this.w, hwb.w) && equals(this.b, hwb.b) && equals(this.alpha, hwb.alpha);
|
|
1762
1761
|
}
|
|
1763
|
-
asString(format?: Format
|
|
1762
|
+
asString(format?: Format): string {
|
|
1764
1763
|
if (format) {
|
|
1765
1764
|
return this.as(format).asString();
|
|
1766
1765
|
}
|
|
@@ -1886,7 +1885,7 @@ abstract class ShortFormatColorBase implements Color {
|
|
|
1886
1885
|
isGamutClipped(): boolean {
|
|
1887
1886
|
return this.color.isGamutClipped();
|
|
1888
1887
|
}
|
|
1889
|
-
asString(format?: Format
|
|
1888
|
+
asString(format?: Format): string {
|
|
1890
1889
|
if (format) {
|
|
1891
1890
|
return this.as(format).asString();
|
|
1892
1891
|
}
|
|
@@ -1909,7 +1908,7 @@ export class ShortHex extends ShortFormatColorBase {
|
|
|
1909
1908
|
return new ShortHex(this.color.setAlpha(alpha));
|
|
1910
1909
|
}
|
|
1911
1910
|
|
|
1912
|
-
override asString(format?: Format
|
|
1911
|
+
override asString(format?: Format): string {
|
|
1913
1912
|
return format && format !== this.format() ? super.as(format).asString() : super.asString();
|
|
1914
1913
|
}
|
|
1915
1914
|
|
|
@@ -1949,7 +1948,7 @@ export class Nickname extends ShortFormatColorBase {
|
|
|
1949
1948
|
return this.nickname;
|
|
1950
1949
|
}
|
|
1951
1950
|
|
|
1952
|
-
override getAsRawString(format?: Format
|
|
1951
|
+
override getAsRawString(format?: Format): string {
|
|
1953
1952
|
return this.color.getAsRawString(format);
|
|
1954
1953
|
}
|
|
1955
1954
|
}
|
|
@@ -2065,7 +2064,7 @@ export class Legacy implements Color {
|
|
|
2065
2064
|
return isShort ? new ShortHex(color) : color;
|
|
2066
2065
|
}
|
|
2067
2066
|
|
|
2068
|
-
static fromRGBAFunction(r: string, g: string, b: string, alpha: string
|
|
2067
|
+
static fromRGBAFunction(r: string, g: string, b: string, alpha: string, text: string): Legacy|null {
|
|
2069
2068
|
const rgba = [
|
|
2070
2069
|
parseRgbNumeric(r),
|
|
2071
2070
|
parseRgbNumeric(g),
|
|
@@ -2183,15 +2182,15 @@ export class Legacy implements Color {
|
|
|
2183
2182
|
r: number,
|
|
2184
2183
|
g: number,
|
|
2185
2184
|
b: number,
|
|
2186
|
-
a
|
|
2185
|
+
a?: number,
|
|
2187
2186
|
} {
|
|
2188
2187
|
const rgba = this.canonicalRGBA();
|
|
2189
2188
|
const result: {
|
|
2190
2189
|
r: number,
|
|
2191
2190
|
g: number,
|
|
2192
2191
|
b: number,
|
|
2193
|
-
a
|
|
2194
|
-
} = {r: rgba[0], g: rgba[1], b: rgba[2]
|
|
2192
|
+
a?: number,
|
|
2193
|
+
} = {r: rgba[0], g: rgba[1], b: rgba[2]};
|
|
2195
2194
|
if (rgba[3] !== 1) {
|
|
2196
2195
|
result.a = rgba[3];
|
|
2197
2196
|
}
|
|
@@ -2453,7 +2452,7 @@ export const IsolationModeHighlight = {
|
|
|
2453
2452
|
type Space = number|{
|
|
2454
2453
|
min: number,
|
|
2455
2454
|
max: number,
|
|
2456
|
-
count
|
|
2455
|
+
count?: number,
|
|
2457
2456
|
};
|
|
2458
2457
|
|
|
2459
2458
|
export class Generator {
|
|
@@ -2463,7 +2462,7 @@ export class Generator {
|
|
|
2463
2462
|
readonly #alphaSpace: Space;
|
|
2464
2463
|
readonly #colors = new Map<string, string>();
|
|
2465
2464
|
constructor(hueSpace?: Space, satSpace?: Space, lightnessSpace?: Space, alphaSpace?: Space) {
|
|
2466
|
-
this.#hueSpace = hueSpace || {min: 0, max: 360
|
|
2465
|
+
this.#hueSpace = hueSpace || {min: 0, max: 360};
|
|
2467
2466
|
this.#satSpace = satSpace || 67;
|
|
2468
2467
|
this.#lightnessSpace = lightnessSpace || 80;
|
|
2469
2468
|
this.#alphaSpace = alphaSpace || 1;
|
|
@@ -392,8 +392,8 @@ export class ParsedURL {
|
|
|
392
392
|
|
|
393
393
|
static splitLineAndColumn(string: string): {
|
|
394
394
|
url: Platform.DevToolsPath.UrlString,
|
|
395
|
-
lineNumber
|
|
396
|
-
columnNumber
|
|
395
|
+
lineNumber?: number,
|
|
396
|
+
columnNumber?: number,
|
|
397
397
|
} {
|
|
398
398
|
// Only look for line and column numbers in the path to avoid matching port numbers.
|
|
399
399
|
const beforePathMatch = string.match(ParsedURL.urlRegex());
|
|
@@ -504,7 +504,7 @@ export class ParsedURL {
|
|
|
504
504
|
return this.scheme === 'data';
|
|
505
505
|
}
|
|
506
506
|
|
|
507
|
-
extractDataUrlMimeType(): {type
|
|
507
|
+
extractDataUrlMimeType(): {type?: string, subtype?: string|undefined} {
|
|
508
508
|
const regexp = /^data:((?<type>\w+)\/(?<subtype>\w+))?(;base64)?,/;
|
|
509
509
|
const match = this.url.match(regexp);
|
|
510
510
|
return {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export interface Progress {
|
|
6
6
|
totalWork: number;
|
|
7
7
|
worked: number;
|
|
8
|
-
title
|
|
8
|
+
title?: string;
|
|
9
9
|
canceled: boolean;
|
|
10
10
|
done: boolean;
|
|
11
11
|
}
|
|
@@ -13,7 +13,7 @@ export interface Progress {
|
|
|
13
13
|
export class Progress implements Progress {
|
|
14
14
|
totalWork = 0;
|
|
15
15
|
worked = 0;
|
|
16
|
-
title
|
|
16
|
+
title?: string;
|
|
17
17
|
canceled = false;
|
|
18
18
|
done = false;
|
|
19
19
|
}
|
|
@@ -112,9 +112,9 @@ export class SubProgress implements Progress {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
export class ProgressProxy implements Progress {
|
|
115
|
-
readonly #delegate
|
|
116
|
-
readonly #doneCallback
|
|
117
|
-
readonly #updateCallback
|
|
115
|
+
readonly #delegate?: Progress|null;
|
|
116
|
+
readonly #doneCallback?: (() => void);
|
|
117
|
+
readonly #updateCallback?: (() => void);
|
|
118
118
|
|
|
119
119
|
constructor(delegate?: Progress|null, doneCallback?: (() => void), updateCallback?: (() => void)) {
|
|
120
120
|
this.#delegate = delegate;
|
|
@@ -401,7 +401,7 @@ export class Setting<V> {
|
|
|
401
401
|
return '' as Platform.UIString.LocalizedString;
|
|
402
402
|
}
|
|
403
403
|
|
|
404
|
-
setTitleFunction(titleFunction
|
|
404
|
+
setTitleFunction(titleFunction?: (() => Platform.UIString.LocalizedString)): void {
|
|
405
405
|
if (titleFunction) {
|
|
406
406
|
this.#titleFunction = titleFunction;
|
|
407
407
|
}
|
|
@@ -625,7 +625,7 @@ export class Setting<V> {
|
|
|
625
625
|
|
|
626
626
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
627
627
|
export class RegExpSetting extends Setting<any> {
|
|
628
|
-
#regexFlags
|
|
628
|
+
#regexFlags?: string;
|
|
629
629
|
#regex?: RegExp|null;
|
|
630
630
|
|
|
631
631
|
constructor(
|
|
@@ -52,7 +52,7 @@ Node.prototype.traverseNextTextNode = function(stayWithin?: Node): Node|null {
|
|
|
52
52
|
return node;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
Element.prototype.positionAt = function(x
|
|
55
|
+
Element.prototype.positionAt = function(x?: number, y?: number, relativeTo?: Element): void {
|
|
56
56
|
let shift: AnchorBox|{
|
|
57
57
|
x: number,
|
|
58
58
|
y: number,
|
|
@@ -353,7 +353,7 @@ export interface InspectorFrontendHostAPI {
|
|
|
353
353
|
/**
|
|
354
354
|
* If you need to alert to the user after copying use {@link UIUtils.copyTextToClipboard}.
|
|
355
355
|
*/
|
|
356
|
-
copyText(text
|
|
356
|
+
copyText(text?: string|null): void;
|
|
357
357
|
|
|
358
358
|
inspectedURLChanged(url: Platform.DevToolsPath.UrlString): void;
|
|
359
359
|
|
|
@@ -153,7 +153,7 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
|
|
|
153
153
|
document.title = i18nString(UIStrings.devtoolsS, {PH1: url.replace(/^https?:\/\//, '')});
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
copyText(text
|
|
156
|
+
copyText(text?: string|null): void {
|
|
157
157
|
if (text === undefined || text === null) {
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
@@ -333,21 +333,11 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
|
|
|
333
333
|
resourceLoaderStreamWrite(streamId, text);
|
|
334
334
|
callback({
|
|
335
335
|
statusCode: 200,
|
|
336
|
-
headers: undefined,
|
|
337
|
-
messageOverride: undefined,
|
|
338
|
-
netError: undefined,
|
|
339
|
-
netErrorName: undefined,
|
|
340
|
-
urlValid: undefined,
|
|
341
336
|
});
|
|
342
337
|
})
|
|
343
338
|
.catch(function() {
|
|
344
339
|
callback({
|
|
345
340
|
statusCode: 404,
|
|
346
|
-
headers: undefined,
|
|
347
|
-
messageOverride: undefined,
|
|
348
|
-
netError: undefined,
|
|
349
|
-
netErrorName: undefined,
|
|
350
|
-
urlValid: undefined,
|
|
351
341
|
});
|
|
352
342
|
});
|
|
353
343
|
}
|
|
@@ -101,7 +101,7 @@ export class UserMetrics {
|
|
|
101
101
|
EnumeratedHistogram.IssuesPanelOpenedFrom, issueOpener, IssueOpener.MAX_VALUE);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
issuesPanelIssueExpanded(issueExpandedCategory
|
|
104
|
+
issuesPanelIssueExpanded(issueExpandedCategory?: string): void {
|
|
105
105
|
if (issueExpandedCategory === undefined) {
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
@@ -20,7 +20,7 @@ interface CallbackWithDebugInfo {
|
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
21
|
resolve: (response: {result: CommandResult<any>}|{error: CDPError}) => void;
|
|
22
22
|
method: string;
|
|
23
|
-
sessionId
|
|
23
|
+
sessionId?: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
type Callback = (error: MessageError|null, arg1: Object|null) => void;
|
|
@@ -56,7 +56,7 @@ export class DevToolsCDPConnection implements CDPConnection {
|
|
|
56
56
|
this.#observers.delete(observer);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
send<T extends Command>(method: T, params: CommandParams<T>, sessionId
|
|
59
|
+
send<T extends Command>(method: T, params: CommandParams<T>, sessionId?: string):
|
|
60
60
|
Promise<{result: CommandResult<T>}|{error: CDPError}> {
|
|
61
61
|
const messageId = ++this.#lastMessageId;
|
|
62
62
|
const messageObject: Partial<CDPCommandRequest<T>> = {
|
|
@@ -225,7 +225,7 @@ export interface CSSType {
|
|
|
225
225
|
export class CSSRegisteredProperty {
|
|
226
226
|
#registration: Protocol.CSS.CSSPropertyRegistration|CSSPropertyRule;
|
|
227
227
|
#cssModel: CSSModel;
|
|
228
|
-
#style
|
|
228
|
+
#style?: CSSStyleDeclaration;
|
|
229
229
|
constructor(cssModel: CSSModel, registration: CSSPropertyRule|Protocol.CSS.CSSPropertyRegistration) {
|
|
230
230
|
this.#cssModel = cssModel;
|
|
231
231
|
this.#registration = registration;
|
|
@@ -378,4 +378,42 @@ export class CSSProperty extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
378
378
|
getLonghandProperties(): CSSProperty[] {
|
|
379
379
|
return this.#longhandProperties;
|
|
380
380
|
}
|
|
381
|
+
|
|
382
|
+
ignoreErrors(): boolean {
|
|
383
|
+
function hasUnknownVendorPrefix(string: string): boolean {
|
|
384
|
+
return !string.startsWith('-webkit-') && /^[-_][\w\d]+-\w/.test(string);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
const name = this.name.toLowerCase();
|
|
388
|
+
|
|
389
|
+
// IE hack.
|
|
390
|
+
if (name.charAt(0) === '_') {
|
|
391
|
+
return true;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// IE has a different format for this.
|
|
395
|
+
if (name === 'filter') {
|
|
396
|
+
return true;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// Common IE-specific property prefix.
|
|
400
|
+
if (name.startsWith('scrollbar-')) {
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
if (hasUnknownVendorPrefix(name)) {
|
|
404
|
+
return true;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const value = this.value.toLowerCase();
|
|
408
|
+
|
|
409
|
+
// IE hack.
|
|
410
|
+
if (value.endsWith('\\9')) {
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
if (hasUnknownVendorPrefix(value)) {
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
381
419
|
}
|
|
@@ -31,8 +31,8 @@ export class CSSRule {
|
|
|
31
31
|
constructor(cssModel: CSSModel, payload: {
|
|
32
32
|
style: Protocol.CSS.CSSStyle,
|
|
33
33
|
origin: Protocol.CSS.StyleSheetOrigin,
|
|
34
|
-
originTreeScopeNodeId: Protocol.DOM.BackendNodeId|undefined,
|
|
35
34
|
header: CSSStyleSheetHeader|null,
|
|
35
|
+
originTreeScopeNodeId?: Protocol.DOM.BackendNodeId,
|
|
36
36
|
}) {
|
|
37
37
|
this.header = payload.header;
|
|
38
38
|
this.cssModelInternal = cssModel;
|
|
@@ -137,10 +137,10 @@ export class CSSStyleRule extends CSSRule {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
static createDummyRule(cssModel: CSSModel, selectorText: string): CSSStyleRule {
|
|
140
|
-
const dummyPayload = {
|
|
140
|
+
const dummyPayload: Protocol.CSS.CSSRule = {
|
|
141
141
|
selectorList: {
|
|
142
142
|
text: '',
|
|
143
|
-
selectors: [{text: selectorText
|
|
143
|
+
selectors: [{text: selectorText}],
|
|
144
144
|
},
|
|
145
145
|
style: {
|
|
146
146
|
styleSheetId: '0' as Protocol.DOM.StyleSheetId,
|
|
@@ -150,7 +150,7 @@ export class CSSStyleRule extends CSSRule {
|
|
|
150
150
|
},
|
|
151
151
|
origin: Protocol.CSS.StyleSheetOrigin.Inspector,
|
|
152
152
|
};
|
|
153
|
-
return new CSSStyleRule(cssModel,
|
|
153
|
+
return new CSSStyleRule(cssModel, dummyPayload);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
private reinitializeSelectors(selectorList: Protocol.CSS.SelectorList): void {
|
|
@@ -236,7 +236,6 @@ export class CSSPropertyRule extends CSSRule {
|
|
|
236
236
|
origin: payload.origin,
|
|
237
237
|
style: payload.style,
|
|
238
238
|
header: styleSheetHeaderForRule(cssModel, payload),
|
|
239
|
-
originTreeScopeNodeId: undefined,
|
|
240
239
|
});
|
|
241
240
|
this.#name = new CSSValue(payload.propertyName);
|
|
242
241
|
}
|
|
@@ -277,7 +276,6 @@ export class CSSAtRule extends CSSRule {
|
|
|
277
276
|
origin: payload.origin,
|
|
278
277
|
style: payload.style,
|
|
279
278
|
header: styleSheetHeaderForRule(cssModel, payload),
|
|
280
|
-
originTreeScopeNodeId: undefined
|
|
281
279
|
});
|
|
282
280
|
this.#name = payload.name ? new CSSValue(payload.name) : null;
|
|
283
281
|
this.#type = payload.type;
|
|
@@ -323,7 +321,6 @@ export class CSSKeyframeRule extends CSSRule {
|
|
|
323
321
|
origin: payload.origin,
|
|
324
322
|
style: payload.style,
|
|
325
323
|
header: styleSheetHeaderForRule(cssModel, payload),
|
|
326
|
-
originTreeScopeNodeId: undefined
|
|
327
324
|
});
|
|
328
325
|
this.reinitializeKey(payload.keyText);
|
|
329
326
|
this.#parentRuleName = parentRuleName;
|
|
@@ -379,7 +376,6 @@ export class CSSPositionTryRule extends CSSRule {
|
|
|
379
376
|
origin: payload.origin,
|
|
380
377
|
style: payload.style,
|
|
381
378
|
header: styleSheetHeaderForRule(cssModel, payload),
|
|
382
|
-
originTreeScopeNodeId: undefined
|
|
383
379
|
});
|
|
384
380
|
this.#name = new CSSValue(payload.name);
|
|
385
381
|
this.#active = payload.active;
|
|
@@ -413,7 +409,6 @@ export class CSSFunctionRule extends CSSRule {
|
|
|
413
409
|
origin: payload.origin,
|
|
414
410
|
style: {cssProperties: [], shorthandEntries: []},
|
|
415
411
|
header: styleSheetHeaderForRule(cssModel, payload),
|
|
416
|
-
originTreeScopeNodeId: undefined
|
|
417
412
|
});
|
|
418
413
|
this.#name = new CSSValue(payload.name);
|
|
419
414
|
this.#parameters = payload.parameters.map(({name}) => name);
|
|
@@ -82,7 +82,7 @@ export class ChildTargetManager extends SDKModel<EventTypes> implements Protocol
|
|
|
82
82
|
|
|
83
83
|
override dispose(): void {
|
|
84
84
|
for (const sessionId of this.#childTargetsBySessionId.keys()) {
|
|
85
|
-
this.detachedFromTarget({sessionId
|
|
85
|
+
this.detachedFromTarget({sessionId});
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -144,7 +144,6 @@ export class CookieModel extends SDKModel<EventTypes> {
|
|
|
144
144
|
this.#cookieToBlockedReasons.clear();
|
|
145
145
|
await Promise.all(cookies.map(cookie => networkAgent.invoke_deleteCookies({
|
|
146
146
|
name: cookie.name(),
|
|
147
|
-
url: undefined,
|
|
148
147
|
domain: cookie.domain(),
|
|
149
148
|
path: cookie.path(),
|
|
150
149
|
partitionKey: cookie.partitionKey(),
|
|
@@ -111,6 +111,7 @@ export const ARIA_ATTRIBUTES = new Set<string>([
|
|
|
111
111
|
export enum DOMNodeEvents {
|
|
112
112
|
TOP_LAYER_INDEX_CHANGED = 'TopLayerIndexChanged',
|
|
113
113
|
SCROLLABLE_FLAG_UPDATED = 'ScrollableFlagUpdated',
|
|
114
|
+
AD_RELATED_STATE_UPDATED = 'AdRelatedStateUpdated',
|
|
114
115
|
GRID_OVERLAY_STATE_CHANGED = 'GridOverlayStateChanged',
|
|
115
116
|
FLEX_CONTAINER_OVERLAY_STATE_CHANGED = 'FlexContainerOverlayStateChanged',
|
|
116
117
|
SCROLL_SNAP_OVERLAY_STATE_CHANGED = 'ScrollSnapOverlayStateChanged',
|
|
@@ -120,6 +121,7 @@ export enum DOMNodeEvents {
|
|
|
120
121
|
export interface DOMNodeEventTypes {
|
|
121
122
|
[DOMNodeEvents.TOP_LAYER_INDEX_CHANGED]: void;
|
|
122
123
|
[DOMNodeEvents.SCROLLABLE_FLAG_UPDATED]: void;
|
|
124
|
+
[DOMNodeEvents.AD_RELATED_STATE_UPDATED]: void;
|
|
123
125
|
[DOMNodeEvents.GRID_OVERLAY_STATE_CHANGED]: {enabled: boolean};
|
|
124
126
|
[DOMNodeEvents.FLEX_CONTAINER_OVERLAY_STATE_CHANGED]: {enabled: boolean};
|
|
125
127
|
[DOMNodeEvents.SCROLL_SNAP_OVERLAY_STATE_CHANGED]: {enabled: boolean};
|
|
@@ -185,6 +187,10 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
|
|
|
185
187
|
* for non-backdrop nodes.
|
|
186
188
|
*/
|
|
187
189
|
#topLayerIndex = -1;
|
|
190
|
+
/**
|
|
191
|
+
* Set if a DOMNode is ad related.
|
|
192
|
+
*/
|
|
193
|
+
#isAdRelatedInternal = false;
|
|
188
194
|
|
|
189
195
|
constructor(domModel: DOMModel) {
|
|
190
196
|
super();
|
|
@@ -285,6 +291,10 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
|
|
|
285
291
|
|
|
286
292
|
this.setPseudoElements(payload.pseudoElements);
|
|
287
293
|
|
|
294
|
+
if (payload.isAdRelated) {
|
|
295
|
+
this.#isAdRelatedInternal = true;
|
|
296
|
+
}
|
|
297
|
+
|
|
288
298
|
if (this.#nodeType === Node.ELEMENT_NODE) {
|
|
289
299
|
// HTML and BODY from internal iframes should not overwrite top-level ones.
|
|
290
300
|
if (this.ownerDocument && !this.ownerDocument.documentElement && this.#nodeName === 'HTML') {
|
|
@@ -321,7 +331,12 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
|
|
|
321
331
|
return this.#topLayerIndex;
|
|
322
332
|
}
|
|
323
333
|
|
|
324
|
-
|
|
334
|
+
isAdRelatedNode(): boolean {
|
|
335
|
+
// For iframes, we rely on `AdFrameType` to preserve legacy behavior and
|
|
336
|
+
// prevent regressions.
|
|
337
|
+
//
|
|
338
|
+
// TODO(yaoxia): Deprecate the iframe-specific logic and consolidate
|
|
339
|
+
// everything to use `#isAdRelatedInternal`.
|
|
325
340
|
if (this.isIframe() && this.#frameOwnerFrameId) {
|
|
326
341
|
const frame = FrameManager.instance().getFrame(this.#frameOwnerFrameId);
|
|
327
342
|
if (!frame) {
|
|
@@ -329,7 +344,8 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
|
|
|
329
344
|
}
|
|
330
345
|
return frame.adFrameType() !== Protocol.Page.AdFrameType.None;
|
|
331
346
|
}
|
|
332
|
-
|
|
347
|
+
|
|
348
|
+
return this.#isAdRelatedInternal;
|
|
333
349
|
}
|
|
334
350
|
|
|
335
351
|
isRootNode(): boolean {
|
|
@@ -409,6 +425,11 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
|
|
|
409
425
|
}
|
|
410
426
|
}
|
|
411
427
|
|
|
428
|
+
setIsAdRelated(isAdRelated: boolean): void {
|
|
429
|
+
this.#isAdRelatedInternal = isAdRelated;
|
|
430
|
+
this.dispatchEventToListeners(DOMNodeEvents.AD_RELATED_STATE_UPDATED);
|
|
431
|
+
}
|
|
432
|
+
|
|
412
433
|
setAffectedByStartingStyles(affectedByStartingStyles: boolean): void {
|
|
413
434
|
this.#affectedByStartingStyles = affectedByStartingStyles;
|
|
414
435
|
}
|
|
@@ -1054,17 +1075,20 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
|
|
|
1054
1075
|
}
|
|
1055
1076
|
|
|
1056
1077
|
highlight(mode?: string): void {
|
|
1057
|
-
this.#domModel.overlayModel().highlightInOverlay({node: this
|
|
1078
|
+
this.#domModel.overlayModel().highlightInOverlay({node: this}, mode);
|
|
1058
1079
|
}
|
|
1059
1080
|
|
|
1060
1081
|
highlightForTwoSeconds(): void {
|
|
1061
|
-
this.#domModel.overlayModel().highlightInOverlayForTwoSeconds({node: this
|
|
1082
|
+
this.#domModel.overlayModel().highlightInOverlayForTwoSeconds({node: this});
|
|
1062
1083
|
}
|
|
1063
1084
|
|
|
1064
1085
|
async resolveToObject(objectGroup?: string, executionContextId?: Protocol.Runtime.ExecutionContextId):
|
|
1065
1086
|
Promise<RemoteObject|null> {
|
|
1066
|
-
const {object} = await this.#agent.invoke_resolveNode(
|
|
1067
|
-
|
|
1087
|
+
const {object} = await this.#agent.invoke_resolveNode({
|
|
1088
|
+
nodeId: this.id,
|
|
1089
|
+
executionContextId,
|
|
1090
|
+
objectGroup,
|
|
1091
|
+
});
|
|
1068
1092
|
return object && this.#domModel.runtimeModelInternal.createRemoteObject(object) || null;
|
|
1069
1093
|
}
|
|
1070
1094
|
|
|
@@ -1691,6 +1715,14 @@ export class DOMModel extends SDKModel<EventTypes> {
|
|
|
1691
1715
|
node.setIsScrollable(isScrollable);
|
|
1692
1716
|
}
|
|
1693
1717
|
|
|
1718
|
+
adRelatedStateUpdated(nodeId: Protocol.DOM.NodeId, isAdRelated: boolean): void {
|
|
1719
|
+
const node = this.nodeForId(nodeId);
|
|
1720
|
+
if (!node || node.isAdRelatedNode() === isAdRelated) {
|
|
1721
|
+
return;
|
|
1722
|
+
}
|
|
1723
|
+
node.setIsAdRelated(isAdRelated);
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1694
1726
|
affectedByStartingStylesFlagUpdated(nodeId: Protocol.DOM.NodeId, affectedByStartingStyles: boolean): void {
|
|
1695
1727
|
const node = this.nodeForId(nodeId);
|
|
1696
1728
|
if (!node || node.affectedByStartingStyles() === affectedByStartingStyles) {
|
|
@@ -2054,6 +2086,10 @@ class DOMDispatcher implements ProtocolProxyApi.DOMDispatcher {
|
|
|
2054
2086
|
Protocol.DOM.AffectedByStartingStylesFlagUpdatedEvent): void {
|
|
2055
2087
|
this.#domModel.affectedByStartingStylesFlagUpdated(nodeId, affectedByStartingStyles);
|
|
2056
2088
|
}
|
|
2089
|
+
|
|
2090
|
+
adRelatedStateUpdated({nodeId, isAdRelated}: Protocol.DOM.AdRelatedStateUpdatedEvent): void {
|
|
2091
|
+
this.#domModel.adRelatedStateUpdated(nodeId, isAdRelated);
|
|
2092
|
+
}
|
|
2057
2093
|
}
|
|
2058
2094
|
|
|
2059
2095
|
let domModelUndoStackInstance: DOMModelUndoStack|null = null;
|
|
@@ -558,14 +558,14 @@ export class Location {
|
|
|
558
558
|
|
|
559
559
|
static accuracyValidator(value: string): {
|
|
560
560
|
valid: boolean,
|
|
561
|
-
errorMessage
|
|
561
|
+
errorMessage?: string,
|
|
562
562
|
} {
|
|
563
563
|
if (!value) {
|
|
564
|
-
return {valid: true
|
|
564
|
+
return {valid: true};
|
|
565
565
|
}
|
|
566
566
|
const numValue = parseFloat(value);
|
|
567
567
|
const valid = /^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(value) && numValue >= 0;
|
|
568
|
-
return {valid
|
|
568
|
+
return {valid};
|
|
569
569
|
}
|
|
570
570
|
|
|
571
571
|
toSetting(): string {
|
|
@@ -2137,7 +2137,7 @@ export interface BlockedCookieWithReason {
|
|
|
2137
2137
|
|
|
2138
2138
|
export interface IncludedCookieWithReason {
|
|
2139
2139
|
cookie: Cookie;
|
|
2140
|
-
exemptionReason
|
|
2140
|
+
exemptionReason?: Protocol.Network.CookieExemptionReason;
|
|
2141
2141
|
}
|
|
2142
2142
|
|
|
2143
2143
|
export interface ExemptedSetCookieWithReason {
|
|
@@ -278,8 +278,13 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
278
278
|
throw new Error('Invalid initiator');
|
|
279
279
|
}
|
|
280
280
|
const key = PageResourceLoader.makeKey(url, initiator);
|
|
281
|
-
const pageResource:
|
|
282
|
-
|
|
281
|
+
const pageResource: PageResource = {
|
|
282
|
+
success: null,
|
|
283
|
+
size: null,
|
|
284
|
+
duration: null,
|
|
285
|
+
url,
|
|
286
|
+
initiator,
|
|
287
|
+
};
|
|
283
288
|
this.#pageResources.set(key, pageResource);
|
|
284
289
|
this.dispatchEventToListeners(Events.UPDATE);
|
|
285
290
|
const startTime = performance.now();
|
|
@@ -340,8 +345,10 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
340
345
|
return {
|
|
341
346
|
success: false,
|
|
342
347
|
content: '',
|
|
343
|
-
errorDescription:
|
|
344
|
-
|
|
348
|
+
errorDescription: {
|
|
349
|
+
statusCode: 0,
|
|
350
|
+
message: e.message,
|
|
351
|
+
}
|
|
345
352
|
};
|
|
346
353
|
}
|
|
347
354
|
}
|
|
@@ -399,7 +406,6 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
399
406
|
netError: number|undefined,
|
|
400
407
|
netErrorName: string|undefined,
|
|
401
408
|
message: string,
|
|
402
|
-
urlValid: undefined,
|
|
403
409
|
},
|
|
404
410
|
}> {
|
|
405
411
|
const networkManager = (target.model(NetworkManager) as NetworkManager);
|
|
@@ -420,7 +426,6 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
420
426
|
message: Host.ResourceLoader.netErrorToMessage(
|
|
421
427
|
resource.netError, resource.httpStatusCode, resource.netErrorName) ||
|
|
422
428
|
'',
|
|
423
|
-
urlValid: undefined,
|
|
424
429
|
},
|
|
425
430
|
};
|
|
426
431
|
} finally {
|