chrome-devtools-frontend 1.0.1699061 → 1.0.1701636
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/root/Runtime.ts +5 -0
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +16 -11
- package/front_end/core/sdk/NetworkManager.ts +7 -0
- package/front_end/core/sdk/SecurityOrigin.ts +1 -0
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +3 -0
- package/front_end/core/sdk/SourceMap.ts +12 -1
- package/front_end/core/sdk/SourceMapCache.ts +12 -0
- package/front_end/core/sdk/SourceMapManager.ts +17 -8
- package/front_end/core/sdk/SourceMapScopeChainEntry.ts +2 -19
- package/front_end/core/sdk/SourceMapScopesInfo.ts +21 -0
- package/front_end/core/sdk/StorageBucketsModel.ts +2 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +7 -3
- package/front_end/entrypoints/formatter_worker/Substitute.ts +90 -26
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -1
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +17 -4
- package/front_end/entrypoints/main/GlobalAiButton.ts +2 -6
- package/front_end/entrypoints/main/MainImpl.ts +8 -1
- package/front_end/generated/InspectorBackendCommands.ts +13 -5
- package/front_end/generated/SupportedCSSProperties.ts +14 -0
- package/front_end/generated/protocol-mapping.d.ts +48 -9
- package/front_end/generated/protocol-proxy-api.d.ts +37 -7
- package/front_end/generated/protocol.ts +135 -22
- package/front_end/models/ai_assistance/debug.ts +10 -2
- package/front_end/models/bindings/NetworkProject.ts +30 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +62 -0
- package/front_end/models/change_tracker/ChangeTracker.ts +1 -1
- package/front_end/models/comment_manager/CD4ABridge.ts +4 -4
- package/front_end/models/comment_manager/CommentManager.ts +21 -0
- package/front_end/models/extensions/ExtensionAPI.ts +4 -2
- package/front_end/models/formatter/FormatterWorkerPool.ts +2 -2
- package/front_end/models/issues_manager/CookieIssue.ts +0 -2
- package/front_end/models/javascript_metadata/NativeFunctions.ts +7 -2
- package/front_end/models/persistence/NetworkPersistenceManager.ts +29 -4
- package/front_end/models/source_map_scopes/NamesResolver.ts +65 -40
- package/front_end/models/source_map_scopes/ScopeChainModel.ts +21 -1
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +70 -1
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +5 -8
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +1 -1
- package/front_end/panels/application/AppManifestView.ts +128 -134
- package/front_end/panels/application/CrashReportContextView.ts +5 -5
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +17 -17
- package/front_end/panels/application/DeviceBoundSessionsView.ts +136 -137
- package/front_end/panels/application/IndexedDBModel.ts +3 -0
- package/front_end/panels/application/OriginTrialTreeView.ts +18 -23
- package/front_end/panels/application/ReportingApiTreeElement.ts +3 -3
- package/front_end/panels/application/ReportingApiView.ts +6 -14
- package/front_end/panels/application/application-meta.ts +7 -7
- package/front_end/panels/common/CommentThreadWidget.ts +19 -6
- package/front_end/panels/common/CommentsOverlayWidget.ts +143 -10
- package/front_end/panels/common/CommentsStatusBarPill.ts +13 -1
- package/front_end/panels/common/ExtensionServer.ts +61 -42
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
- package/front_end/panels/common/commentThreadWidget.css +18 -0
- package/front_end/panels/common/common-meta.ts +4 -1
- package/front_end/panels/console/ConsolePrompt.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/elements/ClassesPaneWidget.ts +2 -1
- package/front_end/panels/elements/DOMTreeContextMenu.ts +1 -1
- package/front_end/panels/elements/{ElementsTreeOutline.ts → DOMTreeWidget.ts} +45 -31
- package/front_end/panels/elements/ElementsPanel.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +3 -1
- package/front_end/panels/elements/ShortcutTreeElement.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -6
- package/front_end/panels/elements/TopLayerContainer.ts +1 -1
- package/front_end/panels/elements/elements.ts +4 -3
- package/front_end/panels/elements/elementsTreeOutline.css +4 -0
- package/front_end/panels/event_listeners/EventListenersView.ts +9 -4
- package/front_end/panels/issues/IssuesPane.ts +34 -22
- package/front_end/panels/network/RequestPayloadView.ts +17 -15
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +1 -1
- package/front_end/panels/profiler/HeapProfileView.ts +8 -6
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +8 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +6 -4
- package/front_end/panels/recorder/RecordingView.ts +32 -53
- package/front_end/panels/recorder/controlButton.css +6 -0
- package/front_end/panels/recorder/recordingView.css +11 -2
- package/front_end/panels/security/SecurityPanel.ts +87 -99
- package/front_end/panels/sensors/SensorsView.ts +87 -0
- package/front_end/panels/sensors/sensors-meta.ts +69 -1
- package/front_end/panels/settings/keybindsSettingsTab.css +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +136 -55
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +17 -15
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +0 -2
- package/front_end/panels/timeline/components/LiveMetricsView.ts +59 -64
- package/front_end/panels/timeline/components/liveMetricsView.css +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1580 -1524
- package/front_end/third_party/lighthouse/locales/ar-XB.json +111 -72
- package/front_end/third_party/lighthouse/locales/ar.json +113 -74
- package/front_end/third_party/lighthouse/locales/bg.json +112 -73
- package/front_end/third_party/lighthouse/locales/ca.json +112 -73
- package/front_end/third_party/lighthouse/locales/cs.json +112 -73
- package/front_end/third_party/lighthouse/locales/da.json +112 -73
- package/front_end/third_party/lighthouse/locales/de.json +112 -73
- package/front_end/third_party/lighthouse/locales/el.json +112 -73
- package/front_end/third_party/lighthouse/locales/en-GB.json +111 -72
- package/front_end/third_party/lighthouse/locales/en-US.json +102 -66
- package/front_end/third_party/lighthouse/locales/en-XA.json +111 -72
- package/front_end/third_party/lighthouse/locales/en-XL.json +102 -66
- package/front_end/third_party/lighthouse/locales/es-419.json +112 -73
- package/front_end/third_party/lighthouse/locales/es.json +112 -73
- package/front_end/third_party/lighthouse/locales/fi.json +112 -73
- package/front_end/third_party/lighthouse/locales/fil.json +112 -73
- package/front_end/third_party/lighthouse/locales/fr.json +112 -73
- package/front_end/third_party/lighthouse/locales/he.json +112 -73
- package/front_end/third_party/lighthouse/locales/hi.json +112 -73
- package/front_end/third_party/lighthouse/locales/hr.json +112 -73
- package/front_end/third_party/lighthouse/locales/hu.json +112 -73
- package/front_end/third_party/lighthouse/locales/id.json +112 -73
- package/front_end/third_party/lighthouse/locales/it.json +113 -74
- package/front_end/third_party/lighthouse/locales/ja.json +112 -73
- package/front_end/third_party/lighthouse/locales/ko.json +112 -73
- package/front_end/third_party/lighthouse/locales/lt.json +112 -73
- package/front_end/third_party/lighthouse/locales/lv.json +112 -73
- package/front_end/third_party/lighthouse/locales/nl.json +112 -73
- package/front_end/third_party/lighthouse/locales/no.json +112 -73
- package/front_end/third_party/lighthouse/locales/pl.json +112 -73
- package/front_end/third_party/lighthouse/locales/pt-PT.json +112 -73
- package/front_end/third_party/lighthouse/locales/pt.json +112 -73
- package/front_end/third_party/lighthouse/locales/ro.json +112 -73
- package/front_end/third_party/lighthouse/locales/ru.json +112 -73
- package/front_end/third_party/lighthouse/locales/sk.json +112 -73
- package/front_end/third_party/lighthouse/locales/sl.json +112 -73
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +112 -73
- package/front_end/third_party/lighthouse/locales/sr.json +112 -73
- package/front_end/third_party/lighthouse/locales/sv.json +124 -85
- package/front_end/third_party/lighthouse/locales/ta.json +112 -73
- package/front_end/third_party/lighthouse/locales/te.json +112 -73
- package/front_end/third_party/lighthouse/locales/th.json +112 -73
- package/front_end/third_party/lighthouse/locales/tr.json +113 -74
- package/front_end/third_party/lighthouse/locales/uk.json +112 -73
- package/front_end/third_party/lighthouse/locales/vi.json +112 -73
- package/front_end/third_party/lighthouse/locales/zh-HK.json +112 -73
- package/front_end/third_party/lighthouse/locales/zh-TW.json +113 -74
- package/front_end/third_party/lighthouse/locales/zh.json +113 -74
- package/front_end/third_party/lighthouse/report/bundle.d.ts +4 -4
- package/front_end/third_party/lighthouse/report/bundle.js +10 -3
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -2
- package/front_end/third_party/lit/lit.ts +3 -0
- package/front_end/third_party/lit/package.json +3 -0
- package/front_end/third_party/lit/rebuild.sh +3 -2
- package/front_end/ui/comments/CommentAnchorResolver.ts +8 -2
- package/front_end/ui/comments/CommentOverlayManager.ts +2 -1
- package/front_end/ui/legacy/InspectorView.ts +4 -3
- package/front_end/ui/legacy/TabbedPane.ts +121 -80
- package/front_end/ui/legacy/Treeoutline.ts +37 -7
- package/front_end/ui/legacy/UIUtils.ts +7 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +135 -146
- package/front_end/ui/legacy/treeoutline.css +2 -2
- package/front_end/ui/lit/lit.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +11 -0
- package/inspector_overlay/highlight_anchor.ts +197 -0
- package/inspector_overlay/tool_highlight.ts +8 -0
- package/package.json +1 -1
|
@@ -770,7 +770,7 @@ export class ObjectTreeNode extends ObjectTreeNodeBase {
|
|
|
770
770
|
readonly property: SDK.RemoteObject.RemoteObjectProperty,
|
|
771
771
|
parent: ObjectTreeNodeBase|undefined,
|
|
772
772
|
options: ObjectTreeOptions,
|
|
773
|
-
readonly nonSyntheticParent?: SDK.RemoteObject.RemoteObject,
|
|
773
|
+
readonly nonSyntheticParent?: SDK.RemoteObject.RemoteObject|undefined,
|
|
774
774
|
) {
|
|
775
775
|
super(parent, options);
|
|
776
776
|
}
|
|
@@ -1232,13 +1232,15 @@ export class ObjectPropertiesSectionWidget extends UI.Widget.Widget {
|
|
|
1232
1232
|
populateObjectTreeContextMenu(
|
|
1233
1233
|
contextMenu,
|
|
1234
1234
|
root,
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
root
|
|
1235
|
+
{
|
|
1236
|
+
expandRecursively: root.expandRecursively.bind(root, EXPANDABLE_MAX_DEPTH),
|
|
1237
|
+
collapseChildren: root.collapseRecursively.bind(root),
|
|
1238
|
+
sortPropertiesAlphabetically: root => {
|
|
1239
|
+
root.sortPropertiesAlphabetically = !root.sortPropertiesAlphabetically;
|
|
1240
|
+
},
|
|
1241
|
+
onShowAllToggled: root => {
|
|
1242
|
+
root.includeNullOrUndefinedValues = !root.includeNullOrUndefinedValues;
|
|
1243
|
+
},
|
|
1242
1244
|
},
|
|
1243
1245
|
);
|
|
1244
1246
|
};
|
|
@@ -1251,18 +1253,24 @@ export const enum ObjectPropertiesMode {
|
|
|
1251
1253
|
OWN_AND_INTERNAL_AND_INHERITED = 1, // Own, internal, and inherited properties
|
|
1252
1254
|
}
|
|
1253
1255
|
|
|
1254
|
-
export function populateObjectTreeContextMenu(
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1256
|
+
export function populateObjectTreeContextMenu(contextMenu: UI.ContextMenu.ContextMenu,
|
|
1257
|
+
objectOrProperty: ObjectTree|ObjectTreeNode, handlers: {
|
|
1258
|
+
expandRecursively: (node: ObjectTreeNodeBase) => void,
|
|
1259
|
+
collapseChildren: (node: ObjectTreeNodeBase) => void,
|
|
1260
|
+
sortPropertiesAlphabetically: (node: ObjectTreeNodeBase) => void,
|
|
1261
|
+
onShowAllToggled: (node: ObjectTreeNodeBase) => void,
|
|
1262
|
+
}): void {
|
|
1263
|
+
contextMenu.appendApplicableItems(objectOrProperty);
|
|
1264
|
+
if (objectOrProperty instanceof ObjectTreeNode && objectOrProperty.property.symbol) {
|
|
1265
|
+
contextMenu.appendApplicableItems(objectOrProperty.property.symbol);
|
|
1266
|
+
}
|
|
1267
|
+
if (objectOrProperty.object) {
|
|
1268
|
+
contextMenu.appendApplicableItems(objectOrProperty.object);
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
const object = objectOrProperty instanceof ObjectTree ? objectOrProperty.object : objectOrProperty.parent?.object;
|
|
1272
|
+
if (objectOrProperty.object && object instanceof SDK.RemoteObject.LocalJSONObject) {
|
|
1273
|
+
const {value} = objectOrProperty.object;
|
|
1266
1274
|
const propertyValue = typeof value === 'object' ?
|
|
1267
1275
|
Platform.StringUtilities.escapeUnicodeAsText(JSON.stringify(value, null, 2)) :
|
|
1268
1276
|
value;
|
|
@@ -1274,20 +1282,36 @@ export function populateObjectTreeContextMenu(
|
|
|
1274
1282
|
{jslogContext: 'copy-value'});
|
|
1275
1283
|
}
|
|
1276
1284
|
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1285
|
+
if (objectOrProperty instanceof ObjectTreeNode && !objectOrProperty.property.synthetic && objectOrProperty.path) {
|
|
1286
|
+
const copyPathHandler = Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText.bind(
|
|
1287
|
+
Host.InspectorFrontendHost.InspectorFrontendHostInstance, objectOrProperty.path);
|
|
1288
|
+
contextMenu.clipboardSection().appendItem(i18nString(UIStrings.copyPropertyPath), copyPathHandler,
|
|
1289
|
+
{jslogContext: 'copy-property-path'});
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
if (objectOrProperty instanceof ObjectTree || object instanceof SDK.RemoteObject.LocalJSONObject) {
|
|
1293
|
+
contextMenu.viewSection().appendItem(i18nString(UIStrings.expandRecursively),
|
|
1294
|
+
() => handlers.expandRecursively(objectOrProperty),
|
|
1295
|
+
{jslogContext: 'expand-recursively'});
|
|
1296
|
+
contextMenu.viewSection().appendItem(i18nString(UIStrings.collapseChildren),
|
|
1297
|
+
() => handlers.collapseChildren(objectOrProperty),
|
|
1298
|
+
{jslogContext: 'collapse-children'});
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
let root: ObjectTreeNodeBase = objectOrProperty;
|
|
1302
|
+
while (root.parent) {
|
|
1303
|
+
root = root.parent;
|
|
1304
|
+
}
|
|
1305
|
+
if (!root.isWasm) {
|
|
1282
1306
|
contextMenu.viewSection().appendCheckboxItem(i18nString(UIStrings.sortPropertiesAlphabetically),
|
|
1283
|
-
sortPropertiesAlphabetically, {
|
|
1284
|
-
checked:
|
|
1307
|
+
() => handlers.sortPropertiesAlphabetically(root), {
|
|
1308
|
+
checked: objectOrProperty.sortPropertiesAlphabetically,
|
|
1285
1309
|
jslogContext: 'sort-properties-alphabetically',
|
|
1286
1310
|
});
|
|
1287
1311
|
}
|
|
1288
1312
|
contextMenu.viewSection().appendCheckboxItem(
|
|
1289
|
-
i18nString(UIStrings.showAll), onShowAllToggled,
|
|
1290
|
-
{checked:
|
|
1313
|
+
i18nString(UIStrings.showAll), () => handlers.onShowAllToggled(root),
|
|
1314
|
+
{checked: objectOrProperty.includeNullOrUndefinedValues, jslogContext: 'show-all'});
|
|
1291
1315
|
}
|
|
1292
1316
|
|
|
1293
1317
|
interface ObjectTreeViewInput {
|
|
@@ -1333,6 +1357,19 @@ const OBJECT_TREE_DEFAULT_VIEW: ObjectTreeView = (input, output, target) => {
|
|
|
1333
1357
|
});
|
|
1334
1358
|
};
|
|
1335
1359
|
|
|
1360
|
+
async function populateChildrenIfNeeded(node: ObjectTreeNodeBase): Promise<void> {
|
|
1361
|
+
const children = await node.populateChildrenIfNeeded();
|
|
1362
|
+
if (!children.arrayRanges) {
|
|
1363
|
+
return;
|
|
1364
|
+
}
|
|
1365
|
+
if (children.arrayRanges.length === 1) {
|
|
1366
|
+
await populateChildrenIfNeeded(children.arrayRanges[0]);
|
|
1367
|
+
} else {
|
|
1368
|
+
await Promise.all(
|
|
1369
|
+
children.arrayRanges.filter(child => child.singular).map(child => populateChildrenIfNeeded(child)));
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1336
1373
|
export class ObjectTreeWidget extends UI.Widget.Widget {
|
|
1337
1374
|
#objectTree: ObjectTree|undefined = undefined;
|
|
1338
1375
|
#linkifier: Components.Linkifier.Linkifier|undefined = undefined;
|
|
@@ -1425,7 +1462,7 @@ export class ObjectTreeWidget extends UI.Widget.Widget {
|
|
|
1425
1462
|
|
|
1426
1463
|
override async performUpdate(): Promise<void> {
|
|
1427
1464
|
if (this.#objectTree?.expanded) {
|
|
1428
|
-
await
|
|
1465
|
+
await populateChildrenIfNeeded(this.#objectTree);
|
|
1429
1466
|
}
|
|
1430
1467
|
this.#view(this, {}, this.contentElement);
|
|
1431
1468
|
}
|
|
@@ -1469,7 +1506,6 @@ type ObjectPropertiesSectionView = (input: ObjectPropertiesSectionViewInput, out
|
|
|
1469
1506
|
void;
|
|
1470
1507
|
|
|
1471
1508
|
export const OBJECT_PROPERTIES_SECTION_DEFAULT_VIEW: ObjectPropertiesSectionView = (input, _output, target) => {
|
|
1472
|
-
|
|
1473
1509
|
const onRootItemContextMenuHandler = (event: Event): void => {
|
|
1474
1510
|
event.consume(true);
|
|
1475
1511
|
const contextMenu = new UI.ContextMenu.ContextMenu(event);
|
|
@@ -1936,16 +1972,11 @@ class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1936
1972
|
linkifier?: Components.Linkifier.Linkifier,
|
|
1937
1973
|
emptyPlaceholder?: string|null,
|
|
1938
1974
|
): Promise<void> {
|
|
1939
|
-
await
|
|
1975
|
+
await populateChildrenIfNeeded(value);
|
|
1940
1976
|
ObjectPropertyTreeElement.populateImpl(treeElement, value, skipProto, skipGettersAndSetters, linkifier,
|
|
1941
1977
|
emptyPlaceholder);
|
|
1942
1978
|
}
|
|
1943
1979
|
|
|
1944
|
-
static async populateChildrenIfNeeded(value: ObjectTreeNodeBase): Promise<void> {
|
|
1945
|
-
const children = await value.populateChildrenIfNeeded();
|
|
1946
|
-
await ArrayGroupingTreeElement.populateChildrenIfNeeded(children);
|
|
1947
|
-
}
|
|
1948
|
-
|
|
1949
1980
|
static populateImpl(
|
|
1950
1981
|
treeElement: UI.TreeOutline.TreeElement,
|
|
1951
1982
|
value: ObjectTreeNodeBase,
|
|
@@ -1985,10 +2016,11 @@ class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1985
2016
|
}
|
|
1986
2017
|
|
|
1987
2018
|
static *
|
|
1988
|
-
createPropertyNodes(
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
2019
|
+
createPropertyNodes({properties, internalProperties, accessors, arrayRanges}: NodeChildren, skipProto: boolean,
|
|
2020
|
+
skipGettersAndSetters: boolean, linkifier?: Components.Linkifier.Linkifier,
|
|
2021
|
+
emptyPlaceholder?: string|null,
|
|
2022
|
+
isNotDisplayablePropertyCallback?:
|
|
2023
|
+
(property: SDK.RemoteObject.RemoteObjectProperty) => boolean):
|
|
1992
2024
|
Generator<UI.TreeOutline.TreeElement> {
|
|
1993
2025
|
let empty = true;
|
|
1994
2026
|
// Arrays with large numbers of elements are paginated into arrayRanges.
|
|
@@ -2052,9 +2084,9 @@ class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2052
2084
|
}
|
|
2053
2085
|
}
|
|
2054
2086
|
|
|
2055
|
-
static populateWithProperties(
|
|
2056
|
-
|
|
2057
|
-
|
|
2087
|
+
static populateWithProperties(treeNode: UI.TreeOutline.TreeElement, children: NodeChildren, skipProto: boolean,
|
|
2088
|
+
skipGettersAndSetters: boolean, linkifier?: Components.Linkifier.Linkifier,
|
|
2089
|
+
emptyPlaceholder?: string|null): void {
|
|
2058
2090
|
for (const childNode of this.createPropertyNodes(
|
|
2059
2091
|
children, skipProto, skipGettersAndSetters, linkifier, emptyPlaceholder,
|
|
2060
2092
|
property => treeNode instanceof ObjectPropertyTreeElement &&
|
|
@@ -2159,77 +2191,34 @@ class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2159
2191
|
}
|
|
2160
2192
|
}
|
|
2161
2193
|
|
|
2162
|
-
|
|
2194
|
+
private contextMenuFired(event: Event): void {
|
|
2163
2195
|
const contextMenu = new UI.ContextMenu.ContextMenu(event);
|
|
2164
|
-
contextMenu
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
value;
|
|
2175
|
-
const copyValueHandler = (): void => {
|
|
2176
|
-
Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue);
|
|
2177
|
-
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText((propertyValue as string | undefined));
|
|
2178
|
-
};
|
|
2179
|
-
contextMenu.clipboardSection().appendItem(
|
|
2180
|
-
i18nString(UIStrings.copyValue), copyValueHandler, {jslogContext: 'copy-value'});
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
if (!this.property.property.synthetic && this.property.path) {
|
|
2184
|
-
const copyPathHandler = Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText.bind(
|
|
2185
|
-
Host.InspectorFrontendHost.InspectorFrontendHostInstance, this.property.path);
|
|
2186
|
-
contextMenu.clipboardSection().appendItem(
|
|
2187
|
-
i18nString(UIStrings.copyPropertyPath), copyPathHandler, {jslogContext: 'copy-property-path'});
|
|
2188
|
-
}
|
|
2189
|
-
if (this.property.parent?.object instanceof SDK.RemoteObject.LocalJSONObject) {
|
|
2190
|
-
contextMenu.viewSection().appendItem(
|
|
2191
|
-
i18nString(UIStrings.expandRecursively), this.expandRecursively.bind(this, EXPANDABLE_MAX_DEPTH),
|
|
2192
|
-
{jslogContext: 'expand-recursively'});
|
|
2193
|
-
contextMenu.viewSection().appendItem(
|
|
2194
|
-
i18nString(UIStrings.collapseChildren), this.collapseChildren.bind(this),
|
|
2195
|
-
{jslogContext: 'collapse-children'});
|
|
2196
|
-
}
|
|
2197
|
-
let root: ObjectTreeNodeBase = this.property;
|
|
2198
|
-
while (root.parent) {
|
|
2199
|
-
root = root.parent;
|
|
2200
|
-
}
|
|
2201
|
-
if (!root.isWasm) {
|
|
2202
|
-
contextMenu.viewSection().appendCheckboxItem(i18nString(UIStrings.sortPropertiesAlphabetically), () => {
|
|
2203
|
-
root.sortPropertiesAlphabetically = !root.sortPropertiesAlphabetically;
|
|
2204
|
-
}, {
|
|
2205
|
-
checked: root.sortPropertiesAlphabetically,
|
|
2206
|
-
jslogContext: 'sort-properties-alphabetically',
|
|
2207
|
-
});
|
|
2208
|
-
}
|
|
2209
|
-
contextMenu.viewSection().appendCheckboxItem(i18nString(UIStrings.showAll), () => {
|
|
2210
|
-
root.includeNullOrUndefinedValues = !root.includeNullOrUndefinedValues;
|
|
2211
|
-
}, {checked: root.includeNullOrUndefinedValues, jslogContext: 'show-all'});
|
|
2212
|
-
return contextMenu;
|
|
2213
|
-
}
|
|
2196
|
+
populateObjectTreeContextMenu(contextMenu, this.property, {
|
|
2197
|
+
expandRecursively: () => this.expandRecursively(EXPANDABLE_MAX_DEPTH),
|
|
2198
|
+
collapseChildren: () => this.collapseChildren(),
|
|
2199
|
+
sortPropertiesAlphabetically: node => {
|
|
2200
|
+
node.sortPropertiesAlphabetically = !node.sortPropertiesAlphabetically;
|
|
2201
|
+
},
|
|
2202
|
+
onShowAllToggled: node => {
|
|
2203
|
+
node.includeNullOrUndefinedValues = !node.includeNullOrUndefinedValues;
|
|
2204
|
+
},
|
|
2205
|
+
});
|
|
2214
2206
|
|
|
2215
|
-
private contextMenuFired(event: Event): void {
|
|
2216
|
-
const contextMenu = this.getContextMenu(event);
|
|
2217
2207
|
void contextMenu.show();
|
|
2218
2208
|
}
|
|
2219
2209
|
|
|
2220
2210
|
private updateExpandable(): void {
|
|
2221
2211
|
if (this.property.object) {
|
|
2222
|
-
this.setExpandable(
|
|
2223
|
-
|
|
2224
|
-
!this.property.property.wasThrown);
|
|
2212
|
+
this.setExpandable(!this.property.object.customPreview() && this.property.object.hasChildren &&
|
|
2213
|
+
!this.property.property.wasThrown);
|
|
2225
2214
|
} else {
|
|
2226
2215
|
this.setExpandable(false);
|
|
2227
2216
|
}
|
|
2228
2217
|
}
|
|
2229
2218
|
}
|
|
2230
2219
|
|
|
2231
|
-
async function arrayRangeGroups(object: SDK.RemoteObject.RemoteObject, fromIndex: number,
|
|
2232
|
-
|
|
2220
|
+
async function arrayRangeGroups(object: SDK.RemoteObject.RemoteObject, fromIndex: number,
|
|
2221
|
+
toIndex: number): Promise<{ranges: number[][]}|null|undefined> {
|
|
2233
2222
|
return await object.callFunctionJSON(packArrayRanges, [
|
|
2234
2223
|
{value: fromIndex},
|
|
2235
2224
|
{value: toIndex},
|
|
@@ -2241,9 +2230,8 @@ async function arrayRangeGroups(object: SDK.RemoteObject.RemoteObject, fromIndex
|
|
|
2241
2230
|
* This function is called on the RemoteObject.
|
|
2242
2231
|
* Note: must declare params as optional.
|
|
2243
2232
|
*/
|
|
2244
|
-
function packArrayRanges(
|
|
2245
|
-
|
|
2246
|
-
sparseIterationThreshold?: number): {
|
|
2233
|
+
function packArrayRanges(this: Object, fromIndex?: number, toIndex?: number, bucketThreshold?: number,
|
|
2234
|
+
sparseIterationThreshold?: number): {
|
|
2247
2235
|
ranges: number[][],
|
|
2248
2236
|
}|undefined {
|
|
2249
2237
|
if (fromIndex === undefined || toIndex === undefined || sparseIterationThreshold === undefined ||
|
|
@@ -2415,18 +2403,6 @@ class ArrayGroupingTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2415
2403
|
isNotDisplayablePropertyCallback);
|
|
2416
2404
|
}
|
|
2417
2405
|
|
|
2418
|
-
static async populateChildrenIfNeeded(children: NodeChildren): Promise<void> {
|
|
2419
|
-
if (!children.arrayRanges) {
|
|
2420
|
-
return;
|
|
2421
|
-
}
|
|
2422
|
-
if (children.arrayRanges.length === 1) {
|
|
2423
|
-
await ObjectPropertyTreeElement.populateChildrenIfNeeded(children.arrayRanges[0]);
|
|
2424
|
-
} else {
|
|
2425
|
-
await Promise.all(children.arrayRanges.filter(child => child.singular)
|
|
2426
|
-
.map(child => ObjectPropertyTreeElement.populateChildrenIfNeeded(child)));
|
|
2427
|
-
}
|
|
2428
|
-
}
|
|
2429
|
-
|
|
2430
2406
|
override onexpand(): void {
|
|
2431
2407
|
this.#child.expanded = true;
|
|
2432
2408
|
}
|
|
@@ -2457,31 +2433,11 @@ type ExpandableTextView = (input: ExpandableTextViewInput, output: object, targe
|
|
|
2457
2433
|
const EXPANDABLE_TEXT_DEFAULT_VIEW: ExpandableTextView = (input, output, target) => {
|
|
2458
2434
|
const totalBytesText = i18n.ByteUtilities.bytesToString(input.byteCount);
|
|
2459
2435
|
const canExpand = input.text.length < ExpandableTextPropertyValue.MAX_DISPLAYABLE_TEXT_LENGTH;
|
|
2460
|
-
const onContextMenu = (e: Event): void => {
|
|
2461
|
-
const {target} = e;
|
|
2462
|
-
if (!(target instanceof Element)) {
|
|
2463
|
-
return;
|
|
2464
|
-
}
|
|
2465
|
-
const listItem = target.closest('li');
|
|
2466
|
-
const element = listItem && UI.TreeOutline.TreeElement.getTreeElementBylistItemNode(listItem);
|
|
2467
|
-
if (!(element instanceof ObjectPropertyTreeElement)) {
|
|
2468
|
-
return;
|
|
2469
|
-
}
|
|
2470
|
-
const contextMenu = element.getContextMenu(e);
|
|
2471
|
-
if (canExpand && !input.expanded) {
|
|
2472
|
-
contextMenu.clipboardSection().appendItem(
|
|
2473
|
-
i18nString(UIStrings.showMoreS, {PH1: totalBytesText}), input.expandText, {jslogContext: 'show-more'});
|
|
2474
|
-
}
|
|
2475
|
-
contextMenu.clipboardSection().appendItem(i18nString(UIStrings.copy), input.copyText, {jslogContext: 'copy'});
|
|
2476
|
-
void contextMenu.show();
|
|
2477
|
-
e.consume(true);
|
|
2478
|
-
};
|
|
2479
|
-
|
|
2480
2436
|
const croppedText = input.text.slice(0, input.maxLength);
|
|
2481
2437
|
|
|
2482
2438
|
render(
|
|
2483
2439
|
// clang-format off
|
|
2484
|
-
html`<span title=${croppedText + '…'}
|
|
2440
|
+
html`<span title=${croppedText + '…'}>
|
|
2485
2441
|
${input.expanded ? input.text : croppedText}
|
|
2486
2442
|
<button
|
|
2487
2443
|
?hidden=${input.expanded}
|
|
@@ -2499,7 +2455,7 @@ const EXPANDABLE_TEXT_DEFAULT_VIEW: ExpandableTextView = (input, output, target)
|
|
|
2499
2455
|
></button>
|
|
2500
2456
|
</span>`,
|
|
2501
2457
|
// clang-format on
|
|
2502
|
-
target);
|
|
2458
|
+
target, {container: {classes: ['expandable-text-property-value']}});
|
|
2503
2459
|
};
|
|
2504
2460
|
|
|
2505
2461
|
export class ExpandableTextPropertyValue extends UI.Widget.Widget {
|
|
@@ -2527,15 +2483,31 @@ export class ExpandableTextPropertyValue extends UI.Widget.Widget {
|
|
|
2527
2483
|
this.requestUpdate();
|
|
2528
2484
|
}
|
|
2529
2485
|
|
|
2486
|
+
#copyText = (): void => {
|
|
2487
|
+
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(this.#text);
|
|
2488
|
+
};
|
|
2489
|
+
|
|
2490
|
+
#expandText = (): void => {
|
|
2491
|
+
if (!this.#expanded) {
|
|
2492
|
+
this.#expanded = true;
|
|
2493
|
+
this.requestUpdate();
|
|
2494
|
+
}
|
|
2495
|
+
};
|
|
2496
|
+
|
|
2497
|
+
appendApplicableItems(contextMenu: UI.ContextMenu.ContextMenu): void {
|
|
2498
|
+
const totalBytesText = i18n.ByteUtilities.bytesToString(this.#byteCount);
|
|
2499
|
+
const canExpand = this.#text.length < ExpandableTextPropertyValue.MAX_DISPLAYABLE_TEXT_LENGTH;
|
|
2500
|
+
if (canExpand && !this.#expanded) {
|
|
2501
|
+
contextMenu.clipboardSection().appendItem(i18nString(UIStrings.showMoreS, {PH1: totalBytesText}),
|
|
2502
|
+
this.#expandText, {jslogContext: 'show-more'});
|
|
2503
|
+
}
|
|
2504
|
+
contextMenu.clipboardSection().appendItem(i18nString(UIStrings.copy), this.#copyText, {jslogContext: 'copy'});
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2530
2507
|
override performUpdate(): void {
|
|
2531
2508
|
const input: ExpandableTextViewInput = {
|
|
2532
|
-
copyText:
|
|
2533
|
-
expandText:
|
|
2534
|
-
if (!this.#expanded) {
|
|
2535
|
-
this.#expanded = true;
|
|
2536
|
-
this.requestUpdate();
|
|
2537
|
-
}
|
|
2538
|
-
},
|
|
2509
|
+
copyText: this.#copyText,
|
|
2510
|
+
expandText: this.#expandText,
|
|
2539
2511
|
expanded: this.#expanded,
|
|
2540
2512
|
byteCount: this.#byteCount,
|
|
2541
2513
|
maxLength: this.#maxLength,
|
|
@@ -2544,3 +2516,20 @@ export class ExpandableTextPropertyValue extends UI.Widget.Widget {
|
|
|
2544
2516
|
this.#view(input, {}, this.contentElement);
|
|
2545
2517
|
}
|
|
2546
2518
|
}
|
|
2519
|
+
|
|
2520
|
+
UI.ContextMenu.registerProvider({
|
|
2521
|
+
contextTypes() {
|
|
2522
|
+
return [ObjectTreeNodeBase];
|
|
2523
|
+
},
|
|
2524
|
+
async loadProvider() {
|
|
2525
|
+
return {
|
|
2526
|
+
appendApplicableItems(event: Event, contextMenu: UI.ContextMenu.ContextMenu): void {
|
|
2527
|
+
const widgetElement = (event.target as Element | null)?.closest('.expandable-text-property-value');
|
|
2528
|
+
const widget = widgetElement && UI.Widget.Widget.get(widgetElement);
|
|
2529
|
+
if (widget instanceof ExpandableTextPropertyValue) {
|
|
2530
|
+
widget.appendApplicableItems(contextMenu);
|
|
2531
|
+
}
|
|
2532
|
+
},
|
|
2533
|
+
};
|
|
2534
|
+
},
|
|
2535
|
+
});
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
margin-left: -10000px;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.tree-outline:not(.hide-selection-when-blurred) li.selected {
|
|
38
|
+
.tree-outline:not(.hide-selection-when-blurred, .elements-tree-outline) li.selected {
|
|
39
39
|
color: var(--sys-color-on-surface-subtle);
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -90,7 +90,7 @@ ol.tree-outline,
|
|
|
90
90
|
min-height: var(--sys-size-8);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
ol.tree-outline:not(.hide-selection-when-blurred) li.selected:focus {
|
|
93
|
+
ol.tree-outline:not(.hide-selection-when-blurred, .elements-tree-outline) li.selected:focus {
|
|
94
94
|
color: var(--sys-color-on-tonal-container);
|
|
95
95
|
|
|
96
96
|
& ::selection {
|
package/front_end/ui/lit/lit.ts
CHANGED
|
@@ -287,6 +287,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
287
287
|
'accessibility-default',
|
|
288
288
|
'accessibility-tree',
|
|
289
289
|
'accessibility.clear-announcements',
|
|
290
|
+
'accessibility.export-csv',
|
|
290
291
|
'accessibility.toggle-recording',
|
|
291
292
|
'accessibility.view',
|
|
292
293
|
'accuracy',
|
|
@@ -1425,6 +1426,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
1425
1426
|
'device-pixel-ratio-enable',
|
|
1426
1427
|
'device-posture',
|
|
1427
1428
|
'device-scale-factor',
|
|
1429
|
+
'device-scope',
|
|
1428
1430
|
'device-type',
|
|
1429
1431
|
'device-type-enable',
|
|
1430
1432
|
'devicemotion',
|
|
@@ -1631,6 +1633,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
1631
1633
|
'emulation.capture-full-height-screenshot',
|
|
1632
1634
|
'emulation.capture-node-screenshot',
|
|
1633
1635
|
'emulation.capture-screenshot',
|
|
1636
|
+
'emulation.cpu-performance',
|
|
1634
1637
|
'emulation.cpu-pressure',
|
|
1635
1638
|
'emulation.device-height',
|
|
1636
1639
|
'emulation.device-mode-value',
|
|
@@ -2059,6 +2062,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
2059
2062
|
'hide-network-messages',
|
|
2060
2063
|
'hide-player',
|
|
2061
2064
|
'hide-repeating-children',
|
|
2065
|
+
'high',
|
|
2062
2066
|
'highlight-node-on-hover-in-overlay',
|
|
2063
2067
|
'history',
|
|
2064
2068
|
'historyRedo',
|
|
@@ -2680,6 +2684,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
2680
2684
|
'linear-memory-row',
|
|
2681
2685
|
'link',
|
|
2682
2686
|
'link-in-explanation',
|
|
2687
|
+
'link-parameters',
|
|
2683
2688
|
'linux',
|
|
2684
2689
|
'list-style',
|
|
2685
2690
|
'list-style-image',
|
|
@@ -2716,6 +2721,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
2716
2721
|
'long-tasks',
|
|
2717
2722
|
'longitude',
|
|
2718
2723
|
'lostpointercapture',
|
|
2724
|
+
'low',
|
|
2719
2725
|
'low-contrast-details',
|
|
2720
2726
|
'low-end-mobile',
|
|
2721
2727
|
'low-text-contrast',
|
|
@@ -2844,6 +2850,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
2844
2850
|
'microsoft-edge-edge-html-x-box',
|
|
2845
2851
|
'microsoft-edge-i-pad',
|
|
2846
2852
|
'microsoft-edge-i-phone',
|
|
2853
|
+
'mid',
|
|
2847
2854
|
'mid-tier-mobile',
|
|
2848
2855
|
'min-block-size',
|
|
2849
2856
|
'min-height',
|
|
@@ -3135,6 +3142,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
3135
3142
|
'page-error',
|
|
3136
3143
|
'page-margin-safety',
|
|
3137
3144
|
'page-orientation',
|
|
3145
|
+
'page-scope',
|
|
3138
3146
|
'paint-order',
|
|
3139
3147
|
'painting',
|
|
3140
3148
|
'palatino',
|
|
@@ -3193,6 +3201,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
3193
3201
|
'persistence-network-overrides-enabled-true',
|
|
3194
3202
|
'perspective',
|
|
3195
3203
|
'perspective-origin',
|
|
3204
|
+
'phone',
|
|
3196
3205
|
'picture-in-picture',
|
|
3197
3206
|
'pill',
|
|
3198
3207
|
'ping',
|
|
@@ -4526,6 +4535,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
4526
4535
|
'ui-theme-system-preferred',
|
|
4527
4536
|
'uiTheme',
|
|
4528
4537
|
'uk',
|
|
4538
|
+
'ultra',
|
|
4529
4539
|
'unavailable',
|
|
4530
4540
|
'unblock',
|
|
4531
4541
|
'undefined',
|
|
@@ -4533,6 +4543,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
4533
4543
|
'unicode-bidi',
|
|
4534
4544
|
'unicode-range',
|
|
4535
4545
|
'unit',
|
|
4546
|
+
'unknown',
|
|
4536
4547
|
'unload',
|
|
4537
4548
|
'unregister',
|
|
4538
4549
|
'unset',
|