chrome-devtools-frontend 1.0.1698733 → 1.0.1700561
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/devtools-verification/SKILL.md +19 -0
- package/.agents/skills/{repro-flaky-tests → fix-tests}/SKILL.md +2 -2
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +2 -2
- package/front_end/core/sdk/DOMModel.ts +3 -5
- package/front_end/core/sdk/NetworkManager.ts +2 -2
- package/front_end/core/sdk/OverlayModel.ts +11 -12
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +3 -0
- package/front_end/core/sdk/SourceMapScopeChainEntry.ts +84 -32
- package/front_end/core/sdk/StorageBucketsModel.ts +2 -0
- package/front_end/entrypoints/main/GlobalAiButton.ts +2 -6
- package/front_end/entrypoints/main/MainImpl.ts +8 -1
- package/front_end/generated/InspectorBackendCommands.ts +12 -2
- package/front_end/generated/SupportedCSSProperties.ts +14 -0
- package/front_end/generated/protocol-mapping.d.ts +48 -1
- package/front_end/generated/protocol-proxy-api.d.ts +37 -1
- package/front_end/generated/protocol.ts +131 -0
- 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 +2 -2
- package/front_end/models/comment_manager/CommentManager.ts +18 -0
- package/front_end/models/emulation/DeviceModeModel.ts +1 -1
- package/front_end/models/extensions/ExtensionAPI.ts +4 -2
- package/front_end/models/issues_manager/CookieIssue.ts +0 -15
- package/front_end/models/persistence/NetworkPersistenceManager.ts +29 -4
- package/front_end/models/source_map_scopes/NamesResolver.ts +34 -4
- package/front_end/models/source_map_scopes/ScopeChainModel.ts +31 -7
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +281 -3
- package/front_end/panels/accessibility/accessibilityAnnouncementRecordingView.css +85 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -2
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +5 -8
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/application/AppManifestView.ts +128 -134
- package/front_end/panels/application/CrashReportContextView.ts +6 -6
- 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/IndexedDBViews.ts +1 -1
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -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/application/components/AdsView.ts +63 -1
- package/front_end/panels/application/components/adsView.css +11 -1
- package/front_end/panels/common/CommentThreadWidget.ts +20 -22
- package/front_end/panels/common/CommentsOverlayWidget.ts +115 -9
- package/front_end/panels/common/CommentsStatusBarPill.ts +13 -1
- package/front_end/panels/common/ExtensionServer.ts +43 -34
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
- package/front_end/panels/common/commentThreadWidget.css +6 -0
- package/front_end/panels/common/common-meta.ts +4 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +1 -1
- package/front_end/panels/elements/ElementsPanel.ts +4 -4
- package/front_end/panels/elements/ElementsTreeElement.ts +9 -2
- package/front_end/panels/elements/ElementsTreeOutline.ts +25 -33
- package/front_end/panels/elements/elementsTreeOutline.css +8 -4
- package/front_end/panels/event_listeners/EventListenersView.ts +9 -4
- package/front_end/panels/issues/IssuesPane.ts +34 -22
- package/front_end/panels/lighthouse/LighthouseController.ts +1 -1
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
- package/front_end/panels/network/RequestPayloadView.ts +17 -15
- package/front_end/panels/recorder/RecordingView.ts +32 -53
- package/front_end/panels/recorder/StepView.ts +19 -4
- package/front_end/panels/recorder/TimelineSection.ts +1 -1
- package/front_end/panels/recorder/controlButton.css +6 -0
- package/front_end/panels/recorder/recordingView.css +11 -2
- package/front_end/panels/settings/BackendLinkingSettingsTab.ts +2 -1
- package/front_end/panels/settings/EditFileSystemView.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +137 -56
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +17 -15
- package/front_end/panels/timeline/components/DetailsView.ts +3 -3
- 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/OriginMap.ts +1 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -3
- 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/components/buttons/Button.ts +19 -1
- package/front_end/ui/legacy/ContextMenu.ts +16 -1
- package/front_end/ui/legacy/InspectorView.ts +4 -3
- package/front_end/ui/legacy/PlusButton.ts +5 -6
- package/front_end/ui/legacy/TabbedPane.ts +121 -80
- package/front_end/ui/legacy/Treeoutline.ts +37 -6
- package/front_end/ui/legacy/UIUtils.ts +7 -0
- package/front_end/ui/legacy/Widget.ts +33 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +3 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +14 -4
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +157 -171
- package/front_end/ui/lit/lit.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
- package/inspector_overlay/highlight_anchor.ts +197 -0
- package/inspector_overlay/tool_highlight.ts +8 -0
- package/package.json +1 -1
- package/.agents/skills/devtools-ci/SKILL.md +0 -65
- package/.agents/skills/evaluate-ai-css-completion/SKILL.md +0 -143
- package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +0 -104
- package/.agents/skills/fixing-skipped-tests/SKILL.md +0 -32
- package/.agents/skills/gerrit-cli/SKILL.md +0 -74
- package/.agents/skills/gerrit-cli/references/commands.md +0 -169
- package/.agents/skills/gerrit-cli/references/workflows.md +0 -63
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +0 -85
- package/front_end/models/issues_manager/descriptions/cookieExcludeBlockedWithinRelatedWebsiteSet.md +0 -4
|
@@ -54,6 +54,7 @@ export interface ViewInput {
|
|
|
54
54
|
data: CookieData[];
|
|
55
55
|
selectedKey?: string;
|
|
56
56
|
editable?: boolean;
|
|
57
|
+
deletable?: boolean;
|
|
57
58
|
renderInline?: boolean;
|
|
58
59
|
portBindingEnabled?: boolean;
|
|
59
60
|
schemeBindingEnabled?: boolean;
|
|
@@ -233,6 +234,7 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
233
234
|
id="cookies-table"
|
|
234
235
|
striped
|
|
235
236
|
?inline=${input.renderInline}
|
|
237
|
+
?deletable=${input.deletable}
|
|
236
238
|
@create=${(e: CustomEvent<CookieData>) => input.onCreate(e.detail)}
|
|
237
239
|
@refresh=${input.onRefresh}
|
|
238
240
|
@deselect=${() => input.onSelect(undefined)}
|
|
@@ -448,6 +450,7 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
448
450
|
data: this.data,
|
|
449
451
|
selectedKey: this.selectedKey,
|
|
450
452
|
editable: this.#editable,
|
|
453
|
+
deletable: Boolean(this.#deleteCallback),
|
|
451
454
|
renderInline: this.renderInline,
|
|
452
455
|
schemeBindingEnabled: this.schemeBindingEnabled,
|
|
453
456
|
portBindingEnabled: this.portBindingEnabled,
|
|
@@ -48,6 +48,8 @@ const DUMMY_COLUMN_ID = 'dummy'; // SortableDataGrid.create requires at least o
|
|
|
48
48
|
* visible rows are layed out and sorting is provided out of the box.
|
|
49
49
|
*
|
|
50
50
|
* @property filters Set of text filters to be applied to the data grid.
|
|
51
|
+
* @attribute deletable If true, rows can be deleted through the context menu or the Delete
|
|
52
|
+
* key, which dispatches a `delete` event on the corresponding <tr> element.
|
|
51
53
|
* @attribute inline If true, the data grid will render inline instead of taking a full container height.
|
|
52
54
|
* @attribute resize Column resize method, one of 'nearest' (default), 'first' or 'last'.
|
|
53
55
|
* @attribute striped If true, the data grid will have striped rows.
|
|
@@ -58,7 +60,7 @@ type DataGridElementNode = SortableNode|DynamicHeightNode;
|
|
|
58
60
|
const elementToNode = new WeakMap<Element, DataGridElementNode>();
|
|
59
61
|
|
|
60
62
|
export class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate {
|
|
61
|
-
static readonly observedAttributes: string[] = ['striped', 'name', 'inline', 'resize', 'highlight'];
|
|
63
|
+
static readonly observedAttributes: string[] = ['striped', 'name', 'inline', 'resize', 'highlight', 'deletable'];
|
|
62
64
|
|
|
63
65
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
66
|
#dataGrid!: DataGridImpl<any>;
|
|
@@ -220,6 +222,9 @@ export class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate
|
|
|
220
222
|
this.#revealHighlightedNode(Number(newValue));
|
|
221
223
|
});
|
|
222
224
|
break;
|
|
225
|
+
case 'deletable':
|
|
226
|
+
this.#dataGrid.deleteCallback = this.deletable ? this.#deleteCallback.bind(this) : undefined;
|
|
227
|
+
break;
|
|
223
228
|
}
|
|
224
229
|
}
|
|
225
230
|
|
|
@@ -231,6 +236,14 @@ export class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate
|
|
|
231
236
|
return hasBooleanAttribute(this, 'striped');
|
|
232
237
|
}
|
|
233
238
|
|
|
239
|
+
set deletable(deletable: boolean) {
|
|
240
|
+
this.toggleAttribute('deletable', deletable);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
get deletable(): boolean {
|
|
244
|
+
return hasBooleanAttribute(this, 'deletable');
|
|
245
|
+
}
|
|
246
|
+
|
|
234
247
|
set inline(striped: boolean) {
|
|
235
248
|
this.toggleAttribute('inline', striped);
|
|
236
249
|
}
|
|
@@ -584,9 +597,6 @@ export class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate
|
|
|
584
597
|
if (args[0] === 'refresh') {
|
|
585
598
|
this.#dataGrid.refreshCallback = this.#refreshCallback.bind(this);
|
|
586
599
|
}
|
|
587
|
-
if (args[0] === 'delete') {
|
|
588
|
-
this.#dataGrid.deleteCallback = this.#deleteCallback.bind(this);
|
|
589
|
-
}
|
|
590
600
|
}
|
|
591
601
|
|
|
592
602
|
#refreshCallback(): void {
|
|
@@ -388,6 +388,10 @@ export class ObjectTreeExpansionTracker {
|
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
+
const ARRAY_LOAD_THRESHOLD = 100;
|
|
392
|
+
const ARRAY_BUCKET_THRESHOLD = 100;
|
|
393
|
+
const ARRAY_SPARSE_ITERATION_THRESHOLD = 250000;
|
|
394
|
+
|
|
391
395
|
export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrapper<ObjectTreeNodeBase.EventTypes> {
|
|
392
396
|
#children?: NodeChildren;
|
|
393
397
|
protected readonly options: ObjectTreeOptions;
|
|
@@ -715,7 +719,7 @@ class ArrayGroupTreeNode extends ObjectTreeNodeBase {
|
|
|
715
719
|
}
|
|
716
720
|
|
|
717
721
|
override async populateChildrenIfNeededImpl(): Promise<NodeChildren> {
|
|
718
|
-
if (this.#range.count >
|
|
722
|
+
if (this.#range.count > ARRAY_BUCKET_THRESHOLD) {
|
|
719
723
|
const ranges = await arrayRangeGroups(this.object, this.#range.fromIndex, this.#range.toIndex);
|
|
720
724
|
const arrayRanges = ranges?.ranges.map(
|
|
721
725
|
([fromIndex, toIndex, count]) => new ArrayGroupTreeNode(this.object, {fromIndex, toIndex, count}, this, {
|
|
@@ -729,7 +733,7 @@ class ArrayGroupTreeNode extends ObjectTreeNodeBase {
|
|
|
729
733
|
const result = await this.#object.callFunction(buildArrayFragment, [
|
|
730
734
|
{value: this.#range.fromIndex},
|
|
731
735
|
{value: this.#range.toIndex},
|
|
732
|
-
{value:
|
|
736
|
+
{value: ARRAY_SPARSE_ITERATION_THRESHOLD},
|
|
733
737
|
]);
|
|
734
738
|
if (!result.object || result.wasThrown) {
|
|
735
739
|
return {};
|
|
@@ -766,7 +770,7 @@ export class ObjectTreeNode extends ObjectTreeNodeBase {
|
|
|
766
770
|
readonly property: SDK.RemoteObject.RemoteObjectProperty,
|
|
767
771
|
parent: ObjectTreeNodeBase|undefined,
|
|
768
772
|
options: ObjectTreeOptions,
|
|
769
|
-
readonly nonSyntheticParent?: SDK.RemoteObject.RemoteObject,
|
|
773
|
+
readonly nonSyntheticParent?: SDK.RemoteObject.RemoteObject|undefined,
|
|
770
774
|
) {
|
|
771
775
|
super(parent, options);
|
|
772
776
|
}
|
|
@@ -1228,21 +1232,20 @@ export class ObjectPropertiesSectionWidget extends UI.Widget.Widget {
|
|
|
1228
1232
|
populateObjectTreeContextMenu(
|
|
1229
1233
|
contextMenu,
|
|
1230
1234
|
root,
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
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
|
+
},
|
|
1238
1244
|
},
|
|
1239
1245
|
);
|
|
1240
1246
|
};
|
|
1241
1247
|
}
|
|
1242
1248
|
|
|
1243
|
-
/** @constant */
|
|
1244
|
-
const ARRAY_LOAD_THRESHOLD = 100;
|
|
1245
|
-
|
|
1246
1249
|
const maxRenderableStringLength = 10000;
|
|
1247
1250
|
|
|
1248
1251
|
export const enum ObjectPropertiesMode {
|
|
@@ -1250,18 +1253,24 @@ export const enum ObjectPropertiesMode {
|
|
|
1250
1253
|
OWN_AND_INTERNAL_AND_INHERITED = 1, // Own, internal, and inherited properties
|
|
1251
1254
|
}
|
|
1252
1255
|
|
|
1253
|
-
export function populateObjectTreeContextMenu(
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
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;
|
|
1265
1274
|
const propertyValue = typeof value === 'object' ?
|
|
1266
1275
|
Platform.StringUtilities.escapeUnicodeAsText(JSON.stringify(value, null, 2)) :
|
|
1267
1276
|
value;
|
|
@@ -1273,23 +1282,39 @@ export function populateObjectTreeContextMenu(
|
|
|
1273
1282
|
{jslogContext: 'copy-value'});
|
|
1274
1283
|
}
|
|
1275
1284
|
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
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) {
|
|
1281
1306
|
contextMenu.viewSection().appendCheckboxItem(i18nString(UIStrings.sortPropertiesAlphabetically),
|
|
1282
|
-
sortPropertiesAlphabetically, {
|
|
1283
|
-
checked:
|
|
1307
|
+
() => handlers.sortPropertiesAlphabetically(root), {
|
|
1308
|
+
checked: objectOrProperty.sortPropertiesAlphabetically,
|
|
1284
1309
|
jslogContext: 'sort-properties-alphabetically',
|
|
1285
1310
|
});
|
|
1286
1311
|
}
|
|
1287
1312
|
contextMenu.viewSection().appendCheckboxItem(
|
|
1288
|
-
i18nString(UIStrings.showAll), onShowAllToggled,
|
|
1289
|
-
{checked:
|
|
1313
|
+
i18nString(UIStrings.showAll), () => handlers.onShowAllToggled(root),
|
|
1314
|
+
{checked: objectOrProperty.includeNullOrUndefinedValues, jslogContext: 'show-all'});
|
|
1290
1315
|
}
|
|
1291
1316
|
|
|
1292
|
-
|
|
1317
|
+
interface ObjectTreeViewInput {
|
|
1293
1318
|
renderAsSubtree: boolean;
|
|
1294
1319
|
objectTree?: ObjectTree;
|
|
1295
1320
|
linkifier?: Components.Linkifier.Linkifier;
|
|
@@ -1298,8 +1323,8 @@ export interface ObjectTreeViewInput {
|
|
|
1298
1323
|
skipGettersAndSetters: boolean;
|
|
1299
1324
|
onExpand: (expanded: boolean) => void;
|
|
1300
1325
|
}
|
|
1301
|
-
|
|
1302
|
-
|
|
1326
|
+
type ObjectTreeView = (input: ObjectTreeViewInput, output: object, target: HTMLElement) => void;
|
|
1327
|
+
const OBJECT_TREE_DEFAULT_VIEW: ObjectTreeView = (input, output, target) => {
|
|
1303
1328
|
const objectTree = input.objectTree;
|
|
1304
1329
|
if (!objectTree) {
|
|
1305
1330
|
render(nothing, target);
|
|
@@ -1332,6 +1357,19 @@ export const OBJECT_TREE_DEFAULT_VIEW: ObjectTreeView = (input, output, target)
|
|
|
1332
1357
|
});
|
|
1333
1358
|
};
|
|
1334
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
|
+
|
|
1335
1373
|
export class ObjectTreeWidget extends UI.Widget.Widget {
|
|
1336
1374
|
#objectTree: ObjectTree|undefined = undefined;
|
|
1337
1375
|
#linkifier: Components.Linkifier.Linkifier|undefined = undefined;
|
|
@@ -1424,7 +1462,7 @@ export class ObjectTreeWidget extends UI.Widget.Widget {
|
|
|
1424
1462
|
|
|
1425
1463
|
override async performUpdate(): Promise<void> {
|
|
1426
1464
|
if (this.#objectTree?.expanded) {
|
|
1427
|
-
await
|
|
1465
|
+
await populateChildrenIfNeeded(this.#objectTree);
|
|
1428
1466
|
}
|
|
1429
1467
|
this.#view(this, {}, this.contentElement);
|
|
1430
1468
|
}
|
|
@@ -1454,7 +1492,7 @@ export function renderObjectTree(
|
|
|
1454
1492
|
widgetRef(ObjectTreeWidget, () => {})}></ul>`;
|
|
1455
1493
|
}
|
|
1456
1494
|
|
|
1457
|
-
|
|
1495
|
+
interface ObjectPropertiesSectionViewInput {
|
|
1458
1496
|
objectTree: ObjectTree;
|
|
1459
1497
|
title?: Element|TemplateResult;
|
|
1460
1498
|
linkifier?: Components.Linkifier.Linkifier;
|
|
@@ -1464,11 +1502,10 @@ export interface ObjectPropertiesSectionViewInput {
|
|
|
1464
1502
|
onExpand: (expanded: boolean) => void;
|
|
1465
1503
|
}
|
|
1466
1504
|
|
|
1467
|
-
|
|
1468
|
-
|
|
1505
|
+
type ObjectPropertiesSectionView = (input: ObjectPropertiesSectionViewInput, output: object, target: HTMLElement) =>
|
|
1506
|
+
void;
|
|
1469
1507
|
|
|
1470
1508
|
export const OBJECT_PROPERTIES_SECTION_DEFAULT_VIEW: ObjectPropertiesSectionView = (input, _output, target) => {
|
|
1471
|
-
|
|
1472
1509
|
const onRootItemContextMenuHandler = (event: Event): void => {
|
|
1473
1510
|
event.consume(true);
|
|
1474
1511
|
const contextMenu = new UI.ContextMenu.ContextMenu(event);
|
|
@@ -1674,9 +1711,9 @@ export interface ObjectPropertyViewInput {
|
|
|
1674
1711
|
node: ObjectTreeNode;
|
|
1675
1712
|
search?: UI.TreeOutline.TreeSearch<ObjectTreeNodeBase>;
|
|
1676
1713
|
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1714
|
+
type ObjectPropertyViewOutput = undefined;
|
|
1715
|
+
type ObjectPropertyView = (input: ObjectPropertyViewInput, output: ObjectPropertyViewOutput, target: HTMLElement) =>
|
|
1716
|
+
void;
|
|
1680
1717
|
export const OBJECT_PROPERTY_DEFAULT_VIEW: ObjectPropertyView = (input, _output, target) => {
|
|
1681
1718
|
const {property} = input.node;
|
|
1682
1719
|
const isInternalEntries = property.synthetic && input.node.name === '[[Entries]]';
|
|
@@ -1897,7 +1934,7 @@ export class ObjectPropertyWidget extends UI.Widget.Widget {
|
|
|
1897
1934
|
}
|
|
1898
1935
|
}
|
|
1899
1936
|
|
|
1900
|
-
|
|
1937
|
+
class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
1901
1938
|
property: ObjectTreeNode;
|
|
1902
1939
|
override toggleOnClick: boolean;
|
|
1903
1940
|
private linkifier: Components.Linkifier.Linkifier|undefined;
|
|
@@ -1935,16 +1972,11 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1935
1972
|
linkifier?: Components.Linkifier.Linkifier,
|
|
1936
1973
|
emptyPlaceholder?: string|null,
|
|
1937
1974
|
): Promise<void> {
|
|
1938
|
-
await
|
|
1975
|
+
await populateChildrenIfNeeded(value);
|
|
1939
1976
|
ObjectPropertyTreeElement.populateImpl(treeElement, value, skipProto, skipGettersAndSetters, linkifier,
|
|
1940
1977
|
emptyPlaceholder);
|
|
1941
1978
|
}
|
|
1942
1979
|
|
|
1943
|
-
static async populateChildrenIfNeeded(value: ObjectTreeNodeBase): Promise<void> {
|
|
1944
|
-
const children = await value.populateChildrenIfNeeded();
|
|
1945
|
-
await ArrayGroupingTreeElement.populateChildrenIfNeeded(children);
|
|
1946
|
-
}
|
|
1947
|
-
|
|
1948
1980
|
static populateImpl(
|
|
1949
1981
|
treeElement: UI.TreeOutline.TreeElement,
|
|
1950
1982
|
value: ObjectTreeNodeBase,
|
|
@@ -1984,10 +2016,11 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1984
2016
|
}
|
|
1985
2017
|
|
|
1986
2018
|
static *
|
|
1987
|
-
createPropertyNodes(
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
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):
|
|
1991
2024
|
Generator<UI.TreeOutline.TreeElement> {
|
|
1992
2025
|
let empty = true;
|
|
1993
2026
|
// Arrays with large numbers of elements are paginated into arrayRanges.
|
|
@@ -2051,9 +2084,9 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2051
2084
|
}
|
|
2052
2085
|
}
|
|
2053
2086
|
|
|
2054
|
-
static populateWithProperties(
|
|
2055
|
-
|
|
2056
|
-
|
|
2087
|
+
static populateWithProperties(treeNode: UI.TreeOutline.TreeElement, children: NodeChildren, skipProto: boolean,
|
|
2088
|
+
skipGettersAndSetters: boolean, linkifier?: Components.Linkifier.Linkifier,
|
|
2089
|
+
emptyPlaceholder?: string|null): void {
|
|
2057
2090
|
for (const childNode of this.createPropertyNodes(
|
|
2058
2091
|
children, skipProto, skipGettersAndSetters, linkifier, emptyPlaceholder,
|
|
2059
2092
|
property => treeNode instanceof ObjectPropertyTreeElement &&
|
|
@@ -2158,91 +2191,47 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2158
2191
|
}
|
|
2159
2192
|
}
|
|
2160
2193
|
|
|
2161
|
-
|
|
2194
|
+
private contextMenuFired(event: Event): void {
|
|
2162
2195
|
const contextMenu = new UI.ContextMenu.ContextMenu(event);
|
|
2163
|
-
contextMenu
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
value;
|
|
2174
|
-
const copyValueHandler = (): void => {
|
|
2175
|
-
Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue);
|
|
2176
|
-
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText((propertyValue as string | undefined));
|
|
2177
|
-
};
|
|
2178
|
-
contextMenu.clipboardSection().appendItem(
|
|
2179
|
-
i18nString(UIStrings.copyValue), copyValueHandler, {jslogContext: 'copy-value'});
|
|
2180
|
-
}
|
|
2181
|
-
}
|
|
2182
|
-
if (!this.property.property.synthetic && this.property.path) {
|
|
2183
|
-
const copyPathHandler = Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText.bind(
|
|
2184
|
-
Host.InspectorFrontendHost.InspectorFrontendHostInstance, this.property.path);
|
|
2185
|
-
contextMenu.clipboardSection().appendItem(
|
|
2186
|
-
i18nString(UIStrings.copyPropertyPath), copyPathHandler, {jslogContext: 'copy-property-path'});
|
|
2187
|
-
}
|
|
2188
|
-
if (this.property.parent?.object instanceof SDK.RemoteObject.LocalJSONObject) {
|
|
2189
|
-
contextMenu.viewSection().appendItem(
|
|
2190
|
-
i18nString(UIStrings.expandRecursively), this.expandRecursively.bind(this, EXPANDABLE_MAX_DEPTH),
|
|
2191
|
-
{jslogContext: 'expand-recursively'});
|
|
2192
|
-
contextMenu.viewSection().appendItem(
|
|
2193
|
-
i18nString(UIStrings.collapseChildren), this.collapseChildren.bind(this),
|
|
2194
|
-
{jslogContext: 'collapse-children'});
|
|
2195
|
-
}
|
|
2196
|
-
let root: ObjectTreeNodeBase = this.property;
|
|
2197
|
-
while (root.parent) {
|
|
2198
|
-
root = root.parent;
|
|
2199
|
-
}
|
|
2200
|
-
if (!root.isWasm) {
|
|
2201
|
-
contextMenu.viewSection().appendCheckboxItem(i18nString(UIStrings.sortPropertiesAlphabetically), () => {
|
|
2202
|
-
root.sortPropertiesAlphabetically = !root.sortPropertiesAlphabetically;
|
|
2203
|
-
}, {
|
|
2204
|
-
checked: root.sortPropertiesAlphabetically,
|
|
2205
|
-
jslogContext: 'sort-properties-alphabetically',
|
|
2206
|
-
});
|
|
2207
|
-
}
|
|
2208
|
-
contextMenu.viewSection().appendCheckboxItem(i18nString(UIStrings.showAll), () => {
|
|
2209
|
-
root.includeNullOrUndefinedValues = !root.includeNullOrUndefinedValues;
|
|
2210
|
-
}, {checked: root.includeNullOrUndefinedValues, jslogContext: 'show-all'});
|
|
2211
|
-
return contextMenu;
|
|
2212
|
-
}
|
|
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
|
+
});
|
|
2213
2206
|
|
|
2214
|
-
private contextMenuFired(event: Event): void {
|
|
2215
|
-
const contextMenu = this.getContextMenu(event);
|
|
2216
2207
|
void contextMenu.show();
|
|
2217
2208
|
}
|
|
2218
2209
|
|
|
2219
2210
|
private updateExpandable(): void {
|
|
2220
2211
|
if (this.property.object) {
|
|
2221
|
-
this.setExpandable(
|
|
2222
|
-
|
|
2223
|
-
!this.property.property.wasThrown);
|
|
2212
|
+
this.setExpandable(!this.property.object.customPreview() && this.property.object.hasChildren &&
|
|
2213
|
+
!this.property.property.wasThrown);
|
|
2224
2214
|
} else {
|
|
2225
2215
|
this.setExpandable(false);
|
|
2226
2216
|
}
|
|
2227
2217
|
}
|
|
2228
2218
|
}
|
|
2229
2219
|
|
|
2230
|
-
async function arrayRangeGroups(object: SDK.RemoteObject.RemoteObject, fromIndex: number,
|
|
2231
|
-
|
|
2220
|
+
async function arrayRangeGroups(object: SDK.RemoteObject.RemoteObject, fromIndex: number,
|
|
2221
|
+
toIndex: number): Promise<{ranges: number[][]}|null|undefined> {
|
|
2232
2222
|
return await object.callFunctionJSON(packArrayRanges, [
|
|
2233
2223
|
{value: fromIndex},
|
|
2234
2224
|
{value: toIndex},
|
|
2235
|
-
{value:
|
|
2236
|
-
{value:
|
|
2225
|
+
{value: ARRAY_BUCKET_THRESHOLD},
|
|
2226
|
+
{value: ARRAY_SPARSE_ITERATION_THRESHOLD},
|
|
2237
2227
|
]);
|
|
2238
2228
|
|
|
2239
2229
|
/**
|
|
2240
2230
|
* This function is called on the RemoteObject.
|
|
2241
2231
|
* Note: must declare params as optional.
|
|
2242
2232
|
*/
|
|
2243
|
-
function packArrayRanges(
|
|
2244
|
-
|
|
2245
|
-
sparseIterationThreshold?: number): {
|
|
2233
|
+
function packArrayRanges(this: Object, fromIndex?: number, toIndex?: number, bucketThreshold?: number,
|
|
2234
|
+
sparseIterationThreshold?: number): {
|
|
2246
2235
|
ranges: number[][],
|
|
2247
2236
|
}|undefined {
|
|
2248
2237
|
if (fromIndex === undefined || toIndex === undefined || sparseIterationThreshold === undefined ||
|
|
@@ -2361,7 +2350,7 @@ function buildArrayFragment(
|
|
|
2361
2350
|
return result;
|
|
2362
2351
|
}
|
|
2363
2352
|
|
|
2364
|
-
|
|
2353
|
+
class ArrayGroupingTreeElement extends UI.TreeOutline.TreeElement {
|
|
2365
2354
|
override toggleOnClick: boolean;
|
|
2366
2355
|
private readonly linkifier: Components.Linkifier.Linkifier|undefined;
|
|
2367
2356
|
readonly #child: ArrayGroupTreeNode;
|
|
@@ -2414,18 +2403,6 @@ export class ArrayGroupingTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2414
2403
|
isNotDisplayablePropertyCallback);
|
|
2415
2404
|
}
|
|
2416
2405
|
|
|
2417
|
-
static async populateChildrenIfNeeded(children: NodeChildren): Promise<void> {
|
|
2418
|
-
if (!children.arrayRanges) {
|
|
2419
|
-
return;
|
|
2420
|
-
}
|
|
2421
|
-
if (children.arrayRanges.length === 1) {
|
|
2422
|
-
await ObjectPropertyTreeElement.populateChildrenIfNeeded(children.arrayRanges[0]);
|
|
2423
|
-
} else {
|
|
2424
|
-
await Promise.all(children.arrayRanges.filter(child => child.singular)
|
|
2425
|
-
.map(child => ObjectPropertyTreeElement.populateChildrenIfNeeded(child)));
|
|
2426
|
-
}
|
|
2427
|
-
}
|
|
2428
|
-
|
|
2429
2406
|
override onexpand(): void {
|
|
2430
2407
|
this.#child.expanded = true;
|
|
2431
2408
|
}
|
|
@@ -2442,13 +2419,9 @@ export class ArrayGroupingTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2442
2419
|
override onattach(): void {
|
|
2443
2420
|
this.listItemElement.classList.add('object-properties-section-name');
|
|
2444
2421
|
}
|
|
2445
|
-
|
|
2446
|
-
// These should be module constants but they are modified by layout tests.
|
|
2447
|
-
static bucketThreshold = 100;
|
|
2448
|
-
static sparseIterationThreshold = 250000;
|
|
2449
2422
|
}
|
|
2450
2423
|
|
|
2451
|
-
|
|
2424
|
+
interface ExpandableTextViewInput {
|
|
2452
2425
|
copyText: () => void;
|
|
2453
2426
|
expandText: () => void;
|
|
2454
2427
|
expanded: boolean;
|
|
@@ -2456,35 +2429,15 @@ export interface ExpandableTextViewInput {
|
|
|
2456
2429
|
byteCount: number;
|
|
2457
2430
|
text: string;
|
|
2458
2431
|
}
|
|
2459
|
-
|
|
2460
|
-
|
|
2432
|
+
type ExpandableTextView = (input: ExpandableTextViewInput, output: object, target: HTMLElement) => void;
|
|
2433
|
+
const EXPANDABLE_TEXT_DEFAULT_VIEW: ExpandableTextView = (input, output, target) => {
|
|
2461
2434
|
const totalBytesText = i18n.ByteUtilities.bytesToString(input.byteCount);
|
|
2462
2435
|
const canExpand = input.text.length < ExpandableTextPropertyValue.MAX_DISPLAYABLE_TEXT_LENGTH;
|
|
2463
|
-
const onContextMenu = (e: Event): void => {
|
|
2464
|
-
const {target} = e;
|
|
2465
|
-
if (!(target instanceof Element)) {
|
|
2466
|
-
return;
|
|
2467
|
-
}
|
|
2468
|
-
const listItem = target.closest('li');
|
|
2469
|
-
const element = listItem && UI.TreeOutline.TreeElement.getTreeElementBylistItemNode(listItem);
|
|
2470
|
-
if (!(element instanceof ObjectPropertyTreeElement)) {
|
|
2471
|
-
return;
|
|
2472
|
-
}
|
|
2473
|
-
const contextMenu = element.getContextMenu(e);
|
|
2474
|
-
if (canExpand && !input.expanded) {
|
|
2475
|
-
contextMenu.clipboardSection().appendItem(
|
|
2476
|
-
i18nString(UIStrings.showMoreS, {PH1: totalBytesText}), input.expandText, {jslogContext: 'show-more'});
|
|
2477
|
-
}
|
|
2478
|
-
contextMenu.clipboardSection().appendItem(i18nString(UIStrings.copy), input.copyText, {jslogContext: 'copy'});
|
|
2479
|
-
void contextMenu.show();
|
|
2480
|
-
e.consume(true);
|
|
2481
|
-
};
|
|
2482
|
-
|
|
2483
2436
|
const croppedText = input.text.slice(0, input.maxLength);
|
|
2484
2437
|
|
|
2485
2438
|
render(
|
|
2486
2439
|
// clang-format off
|
|
2487
|
-
html`<span title=${croppedText + '…'}
|
|
2440
|
+
html`<span title=${croppedText + '…'}>
|
|
2488
2441
|
${input.expanded ? input.text : croppedText}
|
|
2489
2442
|
<button
|
|
2490
2443
|
?hidden=${input.expanded}
|
|
@@ -2502,7 +2455,7 @@ export const EXPANDABLE_TEXT_DEFAULT_VIEW: ExpandableTextView = (input, output,
|
|
|
2502
2455
|
></button>
|
|
2503
2456
|
</span>`,
|
|
2504
2457
|
// clang-format on
|
|
2505
|
-
target);
|
|
2458
|
+
target, {container: {classes: ['expandable-text-property-value']}});
|
|
2506
2459
|
};
|
|
2507
2460
|
|
|
2508
2461
|
export class ExpandableTextPropertyValue extends UI.Widget.Widget {
|
|
@@ -2530,15 +2483,31 @@ export class ExpandableTextPropertyValue extends UI.Widget.Widget {
|
|
|
2530
2483
|
this.requestUpdate();
|
|
2531
2484
|
}
|
|
2532
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
|
+
|
|
2533
2507
|
override performUpdate(): void {
|
|
2534
2508
|
const input: ExpandableTextViewInput = {
|
|
2535
|
-
copyText:
|
|
2536
|
-
expandText:
|
|
2537
|
-
if (!this.#expanded) {
|
|
2538
|
-
this.#expanded = true;
|
|
2539
|
-
this.requestUpdate();
|
|
2540
|
-
}
|
|
2541
|
-
},
|
|
2509
|
+
copyText: this.#copyText,
|
|
2510
|
+
expandText: this.#expandText,
|
|
2542
2511
|
expanded: this.#expanded,
|
|
2543
2512
|
byteCount: this.#byteCount,
|
|
2544
2513
|
maxLength: this.#maxLength,
|
|
@@ -2547,3 +2516,20 @@ export class ExpandableTextPropertyValue extends UI.Widget.Widget {
|
|
|
2547
2516
|
this.#view(input, {}, this.contentElement);
|
|
2548
2517
|
}
|
|
2549
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
|
+
});
|
package/front_end/ui/lit/lit.ts
CHANGED
|
@@ -283,8 +283,11 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
283
283
|
'accept',
|
|
284
284
|
'accept-execute-code',
|
|
285
285
|
'access-control-allow-origin',
|
|
286
|
+
'accessibility-announcements.filter-by-type',
|
|
286
287
|
'accessibility-default',
|
|
287
288
|
'accessibility-tree',
|
|
289
|
+
'accessibility.clear-announcements',
|
|
290
|
+
'accessibility.toggle-recording',
|
|
288
291
|
'accessibility.view',
|
|
289
292
|
'accuracy',
|
|
290
293
|
'achromatopsia',
|
|
@@ -1422,6 +1425,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
1422
1425
|
'device-pixel-ratio-enable',
|
|
1423
1426
|
'device-posture',
|
|
1424
1427
|
'device-scale-factor',
|
|
1428
|
+
'device-scope',
|
|
1425
1429
|
'device-type',
|
|
1426
1430
|
'device-type-enable',
|
|
1427
1431
|
'devicemotion',
|
|
@@ -2677,6 +2681,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
2677
2681
|
'linear-memory-row',
|
|
2678
2682
|
'link',
|
|
2679
2683
|
'link-in-explanation',
|
|
2684
|
+
'link-parameters',
|
|
2680
2685
|
'linux',
|
|
2681
2686
|
'list-style',
|
|
2682
2687
|
'list-style-image',
|
|
@@ -3132,6 +3137,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
3132
3137
|
'page-error',
|
|
3133
3138
|
'page-margin-safety',
|
|
3134
3139
|
'page-orientation',
|
|
3140
|
+
'page-scope',
|
|
3135
3141
|
'paint-order',
|
|
3136
3142
|
'painting',
|
|
3137
3143
|
'palatino',
|
|
@@ -3190,6 +3196,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
3190
3196
|
'persistence-network-overrides-enabled-true',
|
|
3191
3197
|
'perspective',
|
|
3192
3198
|
'perspective-origin',
|
|
3199
|
+
'phone',
|
|
3193
3200
|
'picture-in-picture',
|
|
3194
3201
|
'pill',
|
|
3195
3202
|
'ping',
|