chrome-devtools-frontend 1.0.1528866 → 1.0.1529186

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.
Files changed (38) hide show
  1. package/front_end/core/host/UserMetrics.ts +2 -1
  2. package/front_end/core/root/Runtime.ts +10 -0
  3. package/front_end/core/sdk/NetworkManager.ts +85 -35
  4. package/front_end/core/sdk/SourceMap.ts +4 -0
  5. package/front_end/core/sdk/SourceMapScopesInfo.ts +32 -2
  6. package/front_end/entrypoints/main/MainImpl.ts +23 -4
  7. package/front_end/generated/SupportedCSSProperties.js +2 -0
  8. package/front_end/models/ai_assistance/BuiltInAi.ts +1 -1
  9. package/front_end/models/ai_assistance/ConversationHandler.ts +15 -14
  10. package/front_end/models/javascript_metadata/NativeFunctions.js +8 -0
  11. package/front_end/models/persistence/NetworkPersistenceManager.ts +3 -5
  12. package/front_end/models/persistence/PersistenceImpl.ts +0 -5
  13. package/front_end/models/persistence/persistence-meta.ts +0 -31
  14. package/front_end/models/persistence/persistence.ts +0 -6
  15. package/front_end/{models/persistence → panels/common}/PersistenceUtils.ts +15 -17
  16. package/front_end/panels/common/common.ts +1 -0
  17. package/front_end/panels/console/ConsoleInsightTeaser.ts +285 -22
  18. package/front_end/panels/console/ConsoleViewMessage.ts +18 -1
  19. package/front_end/panels/console/console-meta.ts +14 -0
  20. package/front_end/panels/console/consoleInsightTeaser.css +28 -0
  21. package/front_end/panels/explain/ActionDelegate.ts +3 -0
  22. package/front_end/panels/explain/explain-meta.ts +7 -0
  23. package/front_end/panels/network/BlockedURLsPane.ts +139 -36
  24. package/front_end/panels/network/NetworkLogView.ts +1 -1
  25. package/front_end/{models/persistence → panels/settings}/EditFileSystemView.ts +2 -6
  26. package/front_end/panels/settings/WorkspaceSettingsTab.ts +2 -1
  27. package/front_end/panels/settings/settings.ts +2 -0
  28. package/front_end/{models/persistence → panels/sources}/PersistenceActions.ts +8 -12
  29. package/front_end/panels/sources/TabbedEditorContainer.ts +2 -1
  30. package/front_end/panels/sources/sources-meta.ts +15 -0
  31. package/front_end/panels/sources/sources.ts +2 -0
  32. package/front_end/panels/utils/utils.ts +2 -1
  33. package/front_end/third_party/chromium/README.chromium +1 -1
  34. package/front_end/third_party/diff/diff_match_patch.js +1 -1
  35. package/front_end/ui/legacy/ListWidget.ts +2 -2
  36. package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
  37. package/package.json +1 -1
  38. /package/front_end/{models/persistence → panels/settings}/editFileSystemView.css +0 -0
@@ -5,15 +5,17 @@
5
5
  /* eslint-disable rulesdir/no-imperative-dom-api */
6
6
 
7
7
  import '../../ui/legacy/legacy.js';
8
+ import '../../ui/components/tooltips/tooltips.js';
8
9
 
9
10
  import type * as Common from '../../core/common/common.js';
10
11
  import * as i18n from '../../core/i18n/i18n.js';
11
12
  import * as Platform from '../../core/platform/platform.js';
13
+ import * as Root from '../../core/root/root.js';
12
14
  import * as SDK from '../../core/sdk/sdk.js';
13
15
  import * as Logs from '../../models/logs/logs.js';
14
16
  import * as Buttons from '../../ui/components/buttons/buttons.js';
15
17
  import * as UI from '../../ui/legacy/legacy.js';
16
- import {Directives, html, render} from '../../ui/lit/lit.js';
18
+ import {Directives, html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
17
19
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
18
20
 
19
21
  import blockedURLsPaneStyles from './blockedURLsPane.css.js';
@@ -51,6 +53,10 @@ const UIStrings = {
51
53
  * @description Text in Blocked URLs Pane of the Network panel
52
54
  */
53
55
  textPatternToBlockMatching: 'Text pattern to block matching requests; use * for wildcard',
56
+ /**
57
+ * @description Text in Blocked URLs Pane of the Network panel
58
+ */
59
+ textPatternToBlockMatchingURLPatterns: 'Text pattern to block matching requests; use URLPattern syntax.',
54
60
  /**
55
61
  * @description Error text for empty list widget input in Request Blocking tool
56
62
  */
@@ -59,6 +65,19 @@ const UIStrings = {
59
65
  * @description Error text for duplicate list widget input in Request Blocking tool
60
66
  */
61
67
  patternAlreadyExists: 'Pattern already exists.',
68
+ /**
69
+ * @description Tooltip message when a pattern failed to parse as a URLPattern
70
+ */
71
+ patternFailedToParse: 'This pattern failed to parse as a URLPattern',
72
+ /**
73
+ * @description Tooltip message when a pattern failed to parse as a URLPattern because it contains RegExp groups
74
+ */
75
+ patternFailedWithRegExpGroups: 'RegExp groups are not allowed',
76
+ /**
77
+ * @description Tooltip message when a pattern was converted to a URLPattern
78
+ * @example {example.com} PH1
79
+ */
80
+ patternWasUpgraded: 'This pattern was upgraded from "{PH1}"',
62
81
  /**
63
82
  * @description Message to be announced for a when list item is removed from list widget
64
83
  */
@@ -73,6 +92,8 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
73
92
 
74
93
  const NETWORK_REQUEST_BLOCKING_EXPLANATION_URL =
75
94
  'https://developer.chrome.com/docs/devtools/network-request-blocking' as Platform.DevToolsPath.UrlString;
95
+ const PATTERN_API_DOCS_URL =
96
+ 'https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API' as Platform.DevToolsPath.UrlString;
76
97
 
77
98
  const {bindToAction} = UI.UIUtils;
78
99
 
@@ -126,12 +147,22 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
126
147
  target);
127
148
  };
128
149
 
150
+ function learnMore(): LitTemplate {
151
+ return html`<x-link
152
+ href=${NETWORK_REQUEST_BLOCKING_EXPLANATION_URL}
153
+ tabindex=0
154
+ class=devtools-link
155
+ jslog=${VisualLogging.link().track({click: true, keydown: 'Enter|Space'}).context('learn-more')}>
156
+ ${i18nString(UIStrings.learnMore)}
157
+ </x-link>`;
158
+ }
159
+
129
160
  export class BlockedURLsPane extends UI.Widget.VBox implements
130
161
  UI.ListWidget.Delegate<SDK.NetworkManager.RequestCondition> {
131
162
  private manager: SDK.NetworkManager.MultitargetNetworkManager;
132
163
  private readonly list: UI.ListWidget.ListWidget<SDK.NetworkManager.RequestCondition>;
133
164
  private editor: UI.ListWidget.Editor<SDK.NetworkManager.RequestCondition>|null;
134
- private blockedCountForUrl: Map<string, number>;
165
+ private blockedCountForUrl: Map<Platform.DevToolsPath.UrlString, number>;
135
166
  #view: View;
136
167
 
137
168
  constructor(target?: HTMLElement, view = DEFAULT_VIEW) {
@@ -183,8 +214,8 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
183
214
  this.manager.requestConditions.clear();
184
215
  }
185
216
 
186
- renderItem(condition: SDK.NetworkManager.RequestCondition, editable: boolean): Element {
187
- const count = this.blockedRequestsCount(condition.url);
217
+ renderItem(condition: SDK.NetworkManager.RequestCondition, editable: boolean, index: number): Element {
218
+ const count = this.blockedRequestsCount(condition);
188
219
  const element = document.createElement('div');
189
220
  element.classList.add('blocked-url');
190
221
  const toggle = (e: Event): void => {
@@ -193,8 +224,56 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
193
224
  condition.enabled = !condition.enabled;
194
225
  }
195
226
  };
196
- render(
197
- // clang-format off
227
+
228
+ const {enabled, originalOrUpgradedURLPattern, constructorStringOrWildcardURL, wildcardURL} = condition;
229
+
230
+ if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
231
+ render(
232
+ // clang-format off
233
+ html`
234
+ <input class=blocked-url-checkbox
235
+ @click=${toggle}
236
+ type=checkbox
237
+ ?checked=${enabled}
238
+ ?disabled=${!editable || !originalOrUpgradedURLPattern}
239
+ .jslog=${VisualLogging.toggle().track({ change: true })}>
240
+ ${originalOrUpgradedURLPattern ? html`
241
+ <devtools-tooltip variant=rich jslogcontext=url-pattern id=url-pattern-${index}>
242
+ <div>hash: ${originalOrUpgradedURLPattern.hash}</div>
243
+ <div>hostname: ${originalOrUpgradedURLPattern.hostname}</div>
244
+ <div>password: ${originalOrUpgradedURLPattern.password}</div>
245
+ <div>pathname: ${originalOrUpgradedURLPattern.pathname}</div>
246
+ <div>port: ${originalOrUpgradedURLPattern.port}</div>
247
+ <div>protocol: ${originalOrUpgradedURLPattern.protocol}</div>
248
+ <div>search: ${originalOrUpgradedURLPattern.search}</div>
249
+ <div>username: ${originalOrUpgradedURLPattern.username}</div>
250
+ <hr />
251
+ ${learnMore()}
252
+ </devtools-tooltip>` : nothing}
253
+ ${wildcardURL ? html`
254
+ <devtools-icon name=warning-filled class="small warning" aria-details=url-pattern-warning-${index}>
255
+ </devtools-icon>
256
+ <devtools-tooltip variant=rich jslogcontext=url-pattern-warning id=url-pattern-warning-${index}>
257
+ ${i18nString(UIStrings.patternWasUpgraded, {PH1: wildcardURL})}
258
+ </devtools-tooltip>
259
+ `: nothing}
260
+ ${!originalOrUpgradedURLPattern ? html`
261
+ <devtools-icon name=cross-circle-filled class=small aria-details=url-pattern-error-${index}>
262
+ </devtools-icon>
263
+ <devtools-tooltip variant=rich jslogcontext=url-pattern-warning id=url-pattern-error-${index}>
264
+ ${SDK.NetworkManager.RequestURLPattern.isValidPattern(constructorStringOrWildcardURL) ===
265
+ SDK.NetworkManager.RequestURLPatternValidity.HAS_REGEXP_GROUPS
266
+ ? i18nString(UIStrings.patternFailedWithRegExpGroups)
267
+ : i18nString(UIStrings.patternFailedToParse)}
268
+ ${learnMore()}
269
+ </devtools-tooltip>`: nothing}
270
+ <div @click=${toggle} class=blocked-url-label aria-details=url-pattern-${index}>${constructorStringOrWildcardURL}</div>
271
+ <div class=blocked-url-count>${i18nString(UIStrings.dBlocked, {PH1: count})}</div>`,
272
+ // clang-format on
273
+ element);
274
+ } else {
275
+ render(
276
+ // clang-format off
198
277
  html`
199
278
  <input class=blocked-url-checkbox
200
279
  @click=${toggle}
@@ -202,10 +281,11 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
202
281
  ?checked=${condition.enabled}
203
282
  ?disabled=${!editable}
204
283
  .jslog=${VisualLogging.toggle().track({ change: true })}>
205
- <div @click=${toggle} class=blocked-url-label>${condition.url}</div>
284
+ <div @click=${toggle} class=blocked-url-label>${wildcardURL}</div>
206
285
  <div class=blocked-url-count>${i18nString(UIStrings.dBlocked, {PH1: count})}</div>`,
207
- // clang-format off
208
- element);
286
+ // clang-format on
287
+ element);
288
+ }
209
289
  return element;
210
290
  }
211
291
 
@@ -215,21 +295,29 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
215
295
  }
216
296
 
217
297
  removeItemRequested(condition: SDK.NetworkManager.RequestCondition): void {
218
- this.manager.requestConditions.delete(condition);
298
+ this.manager.requestConditions.delete(condition);
219
299
  UI.ARIAUtils.LiveAnnouncer.alert(UIStrings.itemDeleted);
220
300
  }
221
301
 
222
302
  beginEdit(pattern: SDK.NetworkManager.RequestCondition): UI.ListWidget.Editor<SDK.NetworkManager.RequestCondition> {
223
303
  this.editor = this.createEditor();
224
- this.editor.control('url').value = pattern.url;
304
+ this.editor.control('url').value = Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled ?
305
+ pattern.constructorStringOrWildcardURL :
306
+ pattern.wildcardURL ?? '';
225
307
  return this.editor;
226
308
  }
227
309
 
228
310
  commitEdit(
229
311
  item: SDK.NetworkManager.RequestCondition, editor: UI.ListWidget.Editor<SDK.NetworkManager.RequestCondition>,
230
312
  isNew: boolean): void {
231
- item.url =
232
- editor.control('url').value as Platform.DevToolsPath.UrlString;
313
+ const constructorString = editor.control('url').value as SDK.NetworkManager.URLPatternConstructorString;
314
+ const pattern = Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled ?
315
+ SDK.NetworkManager.RequestURLPattern.create(constructorString) :
316
+ constructorString;
317
+ if (!pattern) {
318
+ throw new Error('Failed to parse pattern');
319
+ }
320
+ item.pattern = pattern;
233
321
  if (isNew) {
234
322
  this.manager.requestConditions.add(item);
235
323
  }
@@ -243,23 +331,37 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
243
331
  const editor = new UI.ListWidget.Editor<SDK.NetworkManager.RequestCondition>();
244
332
  const content = editor.contentElement();
245
333
  const titles = content.createChild('div', 'blocked-url-edit-row');
246
- titles.createChild('div').textContent = i18nString(UIStrings.textPatternToBlockMatching);
334
+ const label = titles.createChild('div');
335
+ if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
336
+ label.textContent = i18nString(UIStrings.textPatternToBlockMatchingURLPatterns);
337
+ label.append(UI.XLink.XLink.create(
338
+ PATTERN_API_DOCS_URL, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more'));
339
+ } else {
340
+ label.textContent = i18nString(UIStrings.textPatternToBlockMatching);
341
+ }
247
342
  const fields = content.createChild('div', 'blocked-url-edit-row');
248
- const validator = (_item: SDK.NetworkManager.RequestCondition, _index: number, input: UI.ListWidget.EditorControl): {
249
- valid: boolean,
250
- errorMessage: Common.UIString.LocalizedString|undefined,
251
- } => {
252
- let valid = true;
253
- let errorMessage;
254
- if (!input.value) {
255
- errorMessage = i18nString(UIStrings.patternInputCannotBeEmpty);
256
- valid = false;
257
- } else if (this.manager.requestConditions.has(input.value)) {
258
- errorMessage = i18nString(UIStrings.patternAlreadyExists);
259
- valid = false;
260
- }
261
- return {valid, errorMessage};
262
- };
343
+ const validator =
344
+ (_item: SDK.NetworkManager.RequestCondition, _index: number, input: UI.ListWidget.EditorControl): {
345
+ valid: boolean,
346
+ errorMessage: Common.UIString.LocalizedString|undefined,
347
+ } => {
348
+ if (!input.value) {
349
+ return {errorMessage: i18nString(UIStrings.patternInputCannotBeEmpty), valid: false};
350
+ }
351
+ if (this.manager.requestConditions.has(input.value)) {
352
+ return {errorMessage: i18nString(UIStrings.patternAlreadyExists), valid: false};
353
+ }
354
+ if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
355
+ const isValid = SDK.NetworkManager.RequestURLPattern.isValidPattern(input.value);
356
+ switch (isValid) {
357
+ case SDK.NetworkManager.RequestURLPatternValidity.FAILED_TO_PARSE:
358
+ return {errorMessage: i18nString(UIStrings.patternFailedToParse), valid: false};
359
+ case SDK.NetworkManager.RequestURLPatternValidity.HAS_REGEXP_GROUPS:
360
+ return {errorMessage: i18nString(UIStrings.patternFailedWithRegExpGroups), valid: false};
361
+ }
362
+ }
363
+ return {valid: true, errorMessage: undefined};
364
+ };
263
365
  const urlInput = editor.createInput('url', 'text', '', validator);
264
366
  fields.createChild('div', 'blocked-url-edit-value').appendChild(urlInput);
265
367
  return editor;
@@ -269,19 +371,20 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
269
371
  const enabled = this.manager.blockingEnabled();
270
372
  this.list.clear();
271
373
  for (const pattern of this.manager.requestConditions.conditions) {
272
- this.list.appendItem(pattern, enabled);
374
+ if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled || pattern.wildcardURL) {
375
+ this.list.appendItem(pattern, enabled);
376
+ }
273
377
  }
274
378
  this.requestUpdate();
275
379
  }
276
380
 
277
- private blockedRequestsCount(url: string): number {
278
- if (!url) {
279
- return 0;
280
- }
281
-
381
+ private blockedRequestsCount(condition: SDK.NetworkManager.RequestCondition): number {
282
382
  let result = 0;
283
383
  for (const blockedUrl of this.blockedCountForUrl.keys()) {
284
- if (this.matches(url, blockedUrl)) {
384
+ const match = Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled ?
385
+ condition.originalOrUpgradedURLPattern?.test(blockedUrl) :
386
+ (condition.wildcardURL && this.matches(condition.wildcardURL, blockedUrl));
387
+ if (match) {
285
388
  result += (this.blockedCountForUrl.get(blockedUrl) as number);
286
389
  }
287
390
  }
@@ -1857,7 +1857,7 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
1857
1857
  }
1858
1858
 
1859
1859
  function removeBlockedURL(url: string): void {
1860
- const entry = manager.requestConditions.conditions.find(condition => condition.url === url);
1860
+ const entry = manager.requestConditions.findCondition(url);
1861
1861
  if (entry) {
1862
1862
  manager.requestConditions.delete(entry);
1863
1863
  }
@@ -6,15 +6,11 @@ import '../../ui/legacy/components/data_grid/data_grid.js';
6
6
 
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
8
  import * as Platform from '../../core/platform/platform.js';
9
- // TODO(crbug.com/442509324): remove UI dependency
10
- // eslint-disable-next-line rulesdir/no-imports-in-directory
9
+ import type {PlatformFileSystem} from '../../models/persistence/PlatformFileSystem.js';
11
10
  import * as UI from '../../ui/legacy/legacy.js';
12
- // TODO(crbug.com/442509324): remove UI dependency
13
- // eslint-disable-next-line rulesdir/no-imports-in-directory
14
11
  import {Directives, html, render} from '../../ui/lit/lit.js';
15
12
 
16
13
  import editFileSystemViewStyles from './editFileSystemView.css.js';
17
- import type {PlatformFileSystem} from './PlatformFileSystem.js';
18
14
 
19
15
  const {styleMap} = Directives;
20
16
 
@@ -36,7 +32,7 @@ const UIStrings = {
36
32
  */
37
33
  enterAUniquePath: 'Enter a unique path',
38
34
  } as const;
39
- const str_ = i18n.i18n.registerUIStrings('models/persistence/EditFileSystemView.ts', UIStrings);
35
+ const str_ = i18n.i18n.registerUIStrings('panels/settings/EditFileSystemView.ts', UIStrings);
40
36
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
41
37
 
42
38
  export const enum ExcludedFolderStatus {
@@ -14,6 +14,7 @@ import * as UI from '../../ui/legacy/legacy.js';
14
14
  import {html, render} from '../../ui/lit/lit.js';
15
15
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
16
16
 
17
+ import {EditFileSystemView} from './EditFileSystemView.js';
17
18
  import workspaceSettingsTabStyles from './workspaceSettingsTab.css.js';
18
19
 
19
20
  const UIStrings = {
@@ -71,7 +72,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
71
72
  <div class="mapping-view-container">
72
73
  <devtools-widget .widgetConfig=${
73
74
  UI.Widget.widgetConfig(
74
- Persistence.EditFileSystemView.EditFileSystemView,
75
+ EditFileSystemView,
75
76
  {fileSystem: fileSystem.fileSystem})}>
76
77
  </devtools-widget>
77
78
  </div>
@@ -5,6 +5,7 @@
5
5
  import './SettingsScreen.js';
6
6
 
7
7
  import * as AISettingsTab from './AISettingsTab.js';
8
+ import * as EditFileSystemView from './EditFileSystemView.js';
8
9
  import * as FrameworkIgnoreListSettingsTab from './FrameworkIgnoreListSettingsTab.js';
9
10
  import * as KeybindsSettingsTab from './KeybindsSettingsTab.js';
10
11
  import * as SettingsScreen from './SettingsScreen.js';
@@ -12,6 +13,7 @@ import * as WorkspaceSettingsTab from './WorkspaceSettingsTab.js';
12
13
 
13
14
  export {
14
15
  AISettingsTab,
16
+ EditFileSystemView,
15
17
  FrameworkIgnoreListSettingsTab,
16
18
  KeybindsSettingsTab,
17
19
  SettingsScreen,
@@ -7,15 +7,11 @@ import * as Host from '../../core/host/host.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
8
  import type * as Platform from '../../core/platform/platform.js';
9
9
  import * as SDK from '../../core/sdk/sdk.js';
10
- // TODO(crbug.com/442509324): remove UI dependency
11
- // eslint-disable-next-line rulesdir/no-imports-in-directory
10
+ import * as Bindings from '../../models/bindings/bindings.js';
11
+ import * as Persistence from '../../models/persistence/persistence.js';
12
+ import * as TextUtils from '../../models/text_utils/text_utils.js';
13
+ import * as Workspace from '../../models/workspace/workspace.js';
12
14
  import * as UI from '../../ui/legacy/legacy.js';
13
- import * as Bindings from '../bindings/bindings.js';
14
- import * as TextUtils from '../text_utils/text_utils.js';
15
- import * as Workspace from '../workspace/workspace.js';
16
-
17
- import {NetworkPersistenceManager} from './NetworkPersistenceManager.js';
18
- import {PersistenceImpl} from './PersistenceImpl.js';
19
15
 
20
16
  const UIStrings = {
21
17
  /**
@@ -59,7 +55,7 @@ const UIStrings = {
59
55
  */
60
56
  saveWasmFailed: 'Unable to save WASM module to disk. Most likely the module is too large.',
61
57
  } as const;
62
- const str_ = i18n.i18n.registerUIStrings('models/persistence/PersistenceActions.ts', UIStrings);
58
+ const str_ = i18n.i18n.registerUIStrings('panels/sources/PersistenceActions.ts', UIStrings);
63
59
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
64
60
 
65
61
  export class ContextMenuProvider implements
@@ -116,9 +112,9 @@ export class ContextMenuProvider implements
116
112
 
117
113
  // Retrieve uiSourceCode by URL to pick network resources everywhere.
118
114
  const uiSourceCode = Workspace.Workspace.WorkspaceImpl.instance().uiSourceCodeForURL(contentProvider.contentURL());
119
- const networkPersistenceManager = NetworkPersistenceManager.instance();
115
+ const networkPersistenceManager = Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance();
120
116
 
121
- const binding = uiSourceCode && PersistenceImpl.instance().binding(uiSourceCode);
117
+ const binding = uiSourceCode && Persistence.Persistence.PersistenceImpl.instance().binding(uiSourceCode);
122
118
  const fileURL = binding ? binding.fileSystem.contentURL() : contentProvider.contentURL();
123
119
 
124
120
  if (Common.ParsedURL.schemeIs(fileURL, 'file:')) {
@@ -164,7 +160,7 @@ export class ContextMenuProvider implements
164
160
  private async handleOverrideContent(
165
161
  uiSourceCode: Workspace.UISourceCode.UISourceCode,
166
162
  contentProvider: TextUtils.ContentProvider.ContentProvider): Promise<void> {
167
- const networkPersistenceManager = NetworkPersistenceManager.instance();
163
+ const networkPersistenceManager = Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance();
168
164
  const isSuccess = await networkPersistenceManager.setupAndStartLocalOverrides(uiSourceCode);
169
165
  if (isSuccess) {
170
166
  await Common.Revealer.reveal(uiSourceCode);
@@ -16,6 +16,7 @@ import * as Tooltips from '../../ui/components/tooltips/tooltips.js';
16
16
  import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
17
17
  import * as UI from '../../ui/legacy/legacy.js';
18
18
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
19
+ import * as PanelCommon from '../common/common.js';
19
20
  import * as Snippets from '../snippets/snippets.js';
20
21
 
21
22
  import {SourcesView} from './SourcesView.js';
@@ -644,7 +645,7 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
644
645
  /* eslint-enable rulesdir/no-imperative-dom-api */
645
646
  this.tabbedPane.setSuffixElement(tabId, suffixElement);
646
647
  } else {
647
- const icon = Persistence.PersistenceUtils.PersistenceUtils.iconForUISourceCode(uiSourceCode);
648
+ const icon = PanelCommon.PersistenceUtils.PersistenceUtils.iconForUISourceCode(uiSourceCode);
648
649
  this.tabbedPane.setTrailingTabIcon(tabId, icon);
649
650
  }
650
651
  }
@@ -2092,3 +2092,18 @@ QuickOpen.FilteredListWidget.registerProvider({
2092
2092
  titlePrefix: i18nLazyString(UIStrings.open),
2093
2093
  titleSuggestion: i18nLazyString(UIStrings.file),
2094
2094
  });
2095
+
2096
+ UI.ContextMenu.registerProvider({
2097
+ contextTypes() {
2098
+ return [
2099
+ Workspace.UISourceCode.UISourceCode,
2100
+ SDK.Resource.Resource,
2101
+ SDK.NetworkRequest.NetworkRequest,
2102
+ ];
2103
+ },
2104
+ async loadProvider() {
2105
+ const Sources = await loadSourcesModule();
2106
+ return new Sources.PersistenceActions.ContextMenuProvider();
2107
+ },
2108
+ experiment: undefined,
2109
+ });
@@ -22,6 +22,7 @@ import * as InplaceFormatterEditorAction from './InplaceFormatterEditorAction.js
22
22
  import * as NavigatorView from './NavigatorView.js';
23
23
  import * as OpenFileQuickOpen from './OpenFileQuickOpen.js';
24
24
  import * as OutlineQuickOpen from './OutlineQuickOpen.js';
25
+ import * as PersistenceActions from './PersistenceActions.js';
25
26
  import * as Plugin from './Plugin.js';
26
27
  import * as ResourceOriginPlugin from './ResourceOriginPlugin.js';
27
28
  import * as ScopeChainSidebarPane from './ScopeChainSidebarPane.js';
@@ -57,6 +58,7 @@ export {
57
58
  NavigatorView,
58
59
  OpenFileQuickOpen,
59
60
  OutlineQuickOpen,
61
+ PersistenceActions,
60
62
  Plugin,
61
63
  ResourceOriginPlugin,
62
64
  ScopeChainSidebarPane,
@@ -13,6 +13,7 @@ import type * as Workspace from '../../models/workspace/workspace.js';
13
13
  import type * as Diff from '../../third_party/diff/diff.js';
14
14
  import * as DiffView from '../../ui/components/diff_view/diff_view.js';
15
15
  import {Directives, html, type TemplateResult} from '../../ui/lit/lit.js';
16
+ import * as PanelCommon from '../common/common.js';
16
17
  import * as Snippets from '../snippets/snippets.js';
17
18
 
18
19
  const {ref, styleMap, ifDefined} = Directives;
@@ -212,7 +213,7 @@ export class PanelUtils {
212
213
  }
213
214
 
214
215
  const title =
215
- binding ? Persistence.PersistenceUtils.PersistenceUtils.tooltipForUISourceCode(uiSourceCode) : undefined;
216
+ binding ? PanelCommon.PersistenceUtils.PersistenceUtils.tooltipForUISourceCode(uiSourceCode) : undefined;
216
217
  // clang-format off
217
218
  return html`<devtools-file-source-icon
218
219
  name=${iconType} title=${ifDefined(title)} .data=${{
@@ -1,7 +1,7 @@
1
1
  Name: Dependencies sourced from the upstream `chromium` repository
2
2
  URL: https://source.chromium.org/chromium/chromium/src/+/main:components/variations/proto/devtools/
3
3
  Version: N/A
4
- Revision: 31876d8522d405cfcc6ea0f2a717a237382faa20
4
+ Revision: ef2fde9d4f45cbb0cbfb3c9aa912496f73d7b927
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE
@@ -50,4 +50,4 @@ j=!1):-1===g&&1==h.diffs.length&&0==h.diffs[0][0]&&i.length>2*b?(h.length1+=i.le
50
50
  diff_match_patch.prototype.patch_fromText=function(a){var b=[];if(!a)return b;a=a.split("\n");for(var c=0,d=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;c<a.length;){var e=a[c].match(d);if(!e)throw Error("Invalid patch string: "+a[c]);var f=new diff_match_patch.patch_obj;b.push(f);f.start1=parseInt(e[1],10);""===e[2]?(f.start1--,f.length1=1):"0"==e[2]?f.length1=0:(f.start1--,f.length1=parseInt(e[2],10));f.start2=parseInt(e[3],10);""===e[4]?(f.start2--,f.length2=1):"0"==e[4]?f.length2=0:(f.start2--,f.length2=
51
51
  parseInt(e[4],10));for(c++;c<a.length;){e=a[c].charAt(0);try{var g=decodeURI(a[c].substring(1))}catch(h){throw Error("Illegal escape in patch_fromText: "+g);}if("-"==e)f.diffs.push([-1,g]);else if("+"==e)f.diffs.push([1,g]);else if(" "==e)f.diffs.push([0,g]);else if("@"==e)break;else if(""!==e)throw Error('Invalid patch mode "'+e+'" in: '+g);c++}}return b};diff_match_patch.patch_obj=function(){this.diffs=[];this.start2=this.start1=null;this.length2=this.length1=0};
52
52
  diff_match_patch.patch_obj.prototype.toString=function(){var a,b;a=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1;b=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;a=["@@ -"+a+" +"+b+" @@\n"];var c;for(b=0;b<this.diffs.length;b++){switch(this.diffs[b][0]){case 1:c="+";break;case -1:c="-";break;case 0:c=" "}a[b+1]=c+encodeURI(this.diffs[b][1])+"\n"}return a.join("").replace(/%20/g," ")};
53
- window.diff_match_patch=diff_match_patch;window.DIFF_DELETE=-1;window.DIFF_INSERT=1;window.DIFF_EQUAL=0;})()
53
+ globalThis.diff_match_patch=diff_match_patch;globalThis.DIFF_DELETE=-1;globalThis.DIFF_INSERT=1;globalThis.DIFF_EQUAL=0;})()
@@ -118,7 +118,7 @@ export class ListWidget<T> extends VBox {
118
118
  if (this.isTable) {
119
119
  element.role = 'rowgroup';
120
120
  }
121
- const content = this.delegate.renderItem(item, editable);
121
+ const content = this.delegate.renderItem(item, editable, this.items.length - 1);
122
122
  if (!content.hasAttribute('jslog')) {
123
123
  element.setAttribute('jslog', `${VisualLogging.item()}`);
124
124
  }
@@ -297,7 +297,7 @@ export class ListWidget<T> extends VBox {
297
297
  }
298
298
 
299
299
  export interface Delegate<T> {
300
- renderItem(item: T, editable: boolean): Element;
300
+ renderItem(item: T, editable: boolean, index: number): Element;
301
301
  removeItemRequested(item: T, index: number): void;
302
302
  beginEdit(item: T): Editor<T>;
303
303
  commitEdit(item: T, editor: Editor<T>, isNew: boolean): void;
@@ -845,6 +845,7 @@ export const knownContextValues = new Set([
845
845
  'console-group-similar-false',
846
846
  'console-history-autocomplete',
847
847
  'console-history-autocomplete-false',
848
+ 'console-insight-teasers-enabled',
848
849
  'console-insights',
849
850
  'console-insights-enabled',
850
851
  'console-insights-setting',
@@ -1508,6 +1509,10 @@ export const knownContextValues = new Set([
1508
1509
  'explain.console-message.context.other',
1509
1510
  'explain.console-message.context.warning',
1510
1511
  'explain.console-message.hover',
1512
+ 'explain.console-message.teaser',
1513
+ 'explain.teaser.code-snippets-explainer',
1514
+ 'explain.teaser.dont-show',
1515
+ 'explain.teaser.learn-more',
1511
1516
  'explanation',
1512
1517
  'export-ai-conversation',
1513
1518
  'export-har',
@@ -1896,6 +1901,7 @@ export const knownContextValues = new Set([
1896
1901
  'insights-deprecation-learn-more',
1897
1902
  'insights-deprecation-open-performance-panel',
1898
1903
  'insights-deprecation-send-feedback',
1904
+ 'insights-teaser-tell-me-more',
1899
1905
  'inspect',
1900
1906
  'inspect-prerendered-page',
1901
1907
  'inspector-main.focus-debuggee',
@@ -3410,6 +3416,7 @@ export const knownContextValues = new Set([
3410
3416
  'show-adorner-settings',
3411
3417
  'show-all-properties',
3412
3418
  'show-as-javascript-object',
3419
+ 'show-console-insight-teasers',
3413
3420
  'show-content-scripts',
3414
3421
  'show-css-property-documentation-on-hover',
3415
3422
  'show-debug-borders',
@@ -4042,6 +4049,7 @@ export const knownContextValues = new Set([
4042
4049
  'upload-image',
4043
4050
  'ur',
4044
4051
  'url',
4052
+ 'url-pattern',
4045
4053
  'usage',
4046
4054
  'usb',
4047
4055
  'use-code-with-caution',
package/package.json CHANGED
@@ -102,5 +102,5 @@
102
102
  "flat-cache": "6.1.12"
103
103
  }
104
104
  },
105
- "version": "1.0.1528866"
105
+ "version": "1.0.1529186"
106
106
  }