chrome-devtools-frontend 1.0.1563563 → 1.0.1564339

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/AUTHORS CHANGED
@@ -23,6 +23,7 @@ Ankit Mishra <ankit.mishra131990@gmail.com>
23
23
  Anna Agoha <annaagoha@gmail.com>
24
24
  Anthony Xie <anthonyxie64@gmail.com>
25
25
  Axel Chong <haxatron1@gmail.com>
26
+ Anton Bershanskyi <bershanskyi@gmail.com>
26
27
  Biboswan Roy <biboswan98@gmail.com>
27
28
  Boris Verkhovskiy <boris.verk@gmail.com>
28
29
  Carl Espe <carl@cpespe.com>
@@ -357,27 +357,93 @@ export const compare = (a: string, b: string): number => {
357
357
  return 0;
358
358
  };
359
359
 
360
+ /** Returns a string that has no more than maxLength characters. Actual graphemes are used, not bytes. */
360
361
  export const trimMiddle = (str: string, maxLength: number): string => {
362
+ // Early return for the case where there are fewer bytes than the character limit.
361
363
  if (str.length <= maxLength) {
362
- return String(str);
364
+ return str;
363
365
  }
364
- let leftHalf = maxLength >> 1;
365
- let rightHalf = maxLength - leftHalf - 1;
366
- if ((str.codePointAt(str.length - rightHalf - 1) as number) >= 0x10000) {
367
- --rightHalf;
368
- ++leftHalf;
366
+
367
+ const segmenter = new Intl.Segmenter(undefined, {granularity: 'grapheme'});
368
+
369
+ // If the max length is so small it can't fit the ellipsis, just return the ellipsis.
370
+ const ellipsis = '…';
371
+ const ellipsisLength = 1;
372
+ if (maxLength <= ellipsisLength) {
373
+ return ellipsis;
369
374
  }
370
- if (leftHalf > 0 && (str.codePointAt(leftHalf - 1) as number) >= 0x10000) {
371
- --leftHalf;
375
+
376
+ // Calculate how many graphemes to keep on each side.
377
+ const freeSpace = maxLength - ellipsisLength;
378
+ const leftCount = Math.ceil(freeSpace / 2);
379
+ const rightCount = Math.floor(freeSpace / 2);
380
+
381
+ let currentGraphemeCount = 0;
382
+ let leftEndIndex = 0;
383
+
384
+ // Sliding Window Buffer
385
+ // We need to know where the "Right Half" starts. Since we can't iterate backwards,
386
+ // we keep track of the start index of the last N graphemes we've seen.
387
+ const rightIndexBuffer: number[] = [];
388
+
389
+ // This function would be significantly simpler if we created an array of all the
390
+ // segments upfront, but could result in poor performance for large input strings.
391
+ for (const {segment, index} of segmenter.segment(str)) {
392
+ currentGraphemeCount++;
393
+
394
+ // Mark the byte index where the "Left Half" ends
395
+ if (currentGraphemeCount === leftCount) {
396
+ leftEndIndex = index + segment.length;
397
+ }
398
+
399
+ // Maintain the buffer for the "Right Half"
400
+ if (rightCount > 0) {
401
+ rightIndexBuffer.push(index);
402
+ if (rightIndexBuffer.length > rightCount) {
403
+ rightIndexBuffer.shift(); // Remove the oldest index to keep buffer size constant.
404
+ }
405
+ }
372
406
  }
373
- return str.substr(0, leftHalf) + '…' + str.substr(str.length - rightHalf, rightHalf);
407
+
408
+ // If the total grapheme count didn't exceed the limit, return the original string.
409
+ if (currentGraphemeCount <= maxLength) {
410
+ return str;
411
+ }
412
+
413
+ // The first item in our buffer is exactly 'rightCount' graphemes away from the end.
414
+ const rightStartIndex = rightCount > 0 ? rightIndexBuffer[0] : str.length;
415
+ return str.slice(0, leftEndIndex) + ellipsis + str.slice(rightStartIndex);
374
416
  };
375
417
 
418
+ /** Returns a string that has no more than maxLength characters. Actual graphemes are used, not bytes. */
376
419
  export const trimEndWithMaxLength = (str: string, maxLength: number): string => {
420
+ // Early return for the case where there are fewer bytes than the character limit.
377
421
  if (str.length <= maxLength) {
378
- return String(str);
422
+ return str;
379
423
  }
380
- return str.substr(0, maxLength - 1) + '…';
424
+
425
+ const ellipsis = '…';
426
+ const ellipsisLength = 1;
427
+ const segmenter = new Intl.Segmenter(undefined, {granularity: 'grapheme'});
428
+ const iterator = segmenter.segment(str)[Symbol.iterator]();
429
+
430
+ let lastSegmentIndex = 0;
431
+ for (let i = 0; i <= maxLength - ellipsisLength; i++) {
432
+ const result = iterator.next();
433
+ if (result.done) {
434
+ return str;
435
+ }
436
+
437
+ lastSegmentIndex = result.value.index;
438
+ }
439
+
440
+ for (let i = 0; i < ellipsisLength; i++) {
441
+ if (iterator.next().done) {
442
+ return str;
443
+ }
444
+ }
445
+
446
+ return str.slice(0, lastSegmentIndex) + ellipsis;
381
447
  };
382
448
 
383
449
  export const escapeForRegExp = (str: string): string => {
@@ -78,10 +78,6 @@ const UIStrings = {
78
78
  * @description Tooltip to explain why a cookie was blocked due to Schemeful Same-Site
79
79
  */
80
80
  schemefulSameSiteUnspecifiedTreatedAsLax: 'This cookie didn\'t specify a "`SameSite`" attribute when it was stored, was defaulted to "`SameSite=Lax"`, and was blocked because the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site.',
81
- /**
82
- * @description Tooltip to explain why a cookie was blocked due to SameParty
83
- */
84
- samePartyFromCrossPartyContext: 'This cookie was blocked because it had the "`SameParty`" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource\'s URL and the domains of the resource\'s enclosing frames/documents are neither owners nor members in the same First-Party Set.',
85
81
  /**
86
82
  * @description Tooltip to explain why a cookie was blocked due to exceeding the maximum size
87
83
  */
@@ -119,14 +115,6 @@ const UIStrings = {
119
115
  * @description Tooltip to explain why a cookie was blocked due to Schemeful Same-Site
120
116
  */
121
117
  thisSetcookieDidntSpecifyASamesite: 'This `Set-Cookie` header didn\'t specify a "`SameSite`" attribute, was defaulted to "`SameSite=Lax"`, and was blocked because it came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site.',
122
- /**
123
- * @description Tooltip to explain why a cookie was blocked due to SameParty
124
- */
125
- thisSetcookieWasBlockedBecauseItHadTheSameparty: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameParty`" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource\'s URL and the domains of the resource\'s enclosing frames/documents are neither owners nor members in the same First-Party Set.',
126
- /**
127
- * @description Tooltip to explain why a cookie was blocked due to SameParty
128
- */
129
- thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameParty`" attribute but also had other conflicting attributes. Chrome requires cookies that use the "`SameParty`" attribute to also have the "Secure" attribute, and to not be restricted to "`SameSite=Strict`".',
130
118
  /**
131
119
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
132
120
  */
@@ -1995,8 +1983,6 @@ export const cookieBlockedReasonToUiString = function(
1995
1983
  return i18nString(UIStrings.schemefulSameSiteLax);
1996
1984
  case Protocol.Network.CookieBlockedReason.SchemefulSameSiteUnspecifiedTreatedAsLax:
1997
1985
  return i18nString(UIStrings.schemefulSameSiteUnspecifiedTreatedAsLax);
1998
- case Protocol.Network.CookieBlockedReason.SamePartyFromCrossPartyContext:
1999
- return i18nString(UIStrings.samePartyFromCrossPartyContext);
2000
1986
  case Protocol.Network.CookieBlockedReason.NameValuePairExceedsMaxSize:
2001
1987
  return i18nString(UIStrings.nameValuePairExceedsMaxSize);
2002
1988
  case Protocol.Network.CookieBlockedReason.ThirdPartyPhaseout:
@@ -2049,14 +2035,6 @@ export const setCookieBlockedReasonToUiString = function(
2049
2035
  );
2050
2036
  case Protocol.Network.SetCookieBlockedReason.SchemefulSameSiteUnspecifiedTreatedAsLax:
2051
2037
  return i18nString(UIStrings.thisSetcookieDidntSpecifyASamesite);
2052
- case Protocol.Network.SetCookieBlockedReason.SamePartyFromCrossPartyContext:
2053
- return i18nString(
2054
- UIStrings.thisSetcookieWasBlockedBecauseItHadTheSameparty,
2055
- );
2056
- case Protocol.Network.SetCookieBlockedReason.SamePartyConflictsWithOtherAttributes:
2057
- return i18nString(
2058
- UIStrings.thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute,
2059
- );
2060
2038
  case Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize:
2061
2039
  return i18nString(
2062
2040
  UIStrings.thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize,
@@ -2087,7 +2065,6 @@ export const cookieBlockedReasonToAttribute = function(
2087
2065
  case Protocol.Network.CookieBlockedReason.SchemefulSameSiteLax:
2088
2066
  case Protocol.Network.CookieBlockedReason.SchemefulSameSiteUnspecifiedTreatedAsLax:
2089
2067
  return Attribute.SAME_SITE;
2090
- case Protocol.Network.CookieBlockedReason.SamePartyFromCrossPartyContext:
2091
2068
  case Protocol.Network.CookieBlockedReason.NameValuePairExceedsMaxSize:
2092
2069
  case Protocol.Network.CookieBlockedReason.UserPreferences:
2093
2070
  case Protocol.Network.CookieBlockedReason.ThirdPartyPhaseout:
@@ -2116,8 +2093,6 @@ export const setCookieBlockedReasonToAttribute = function(
2116
2093
  return Attribute.DOMAIN;
2117
2094
  case Protocol.Network.SetCookieBlockedReason.InvalidPrefix:
2118
2095
  return Attribute.NAME;
2119
- case Protocol.Network.SetCookieBlockedReason.SamePartyConflictsWithOtherAttributes:
2120
- case Protocol.Network.SetCookieBlockedReason.SamePartyFromCrossPartyContext:
2121
2096
  case Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize:
2122
2097
  case Protocol.Network.SetCookieBlockedReason.UserPreferences:
2123
2098
  case Protocol.Network.SetCookieBlockedReason.ThirdPartyPhaseout:
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Chromium Authors
1
+ // Copyright 2026 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Chromium Authors
1
+ // Copyright 2026 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Chromium Authors
1
+ // Copyright 2026 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
@@ -26,10 +26,6 @@ const UIStrings = {
26
26
  * @description Label for the link for Schemeful Same-Site Issues
27
27
  */
28
28
  howSchemefulSamesiteWorks: 'How Schemeful Same-Site Works',
29
- /**
30
- * @description Label for a link for SameParty Issues. 'Attribute' refers to a cookie attribute.
31
- */
32
- firstPartySetsExplained: '`First-Party Sets` and the `SameParty` attribute',
33
29
  /**
34
30
  * @description Label for a link for cross-site redirect Issues.
35
31
  */
@@ -520,22 +516,6 @@ function sameSiteExcludeContextDowngradeSet(isSecure: boolean): LazyMarkdownIssu
520
516
  };
521
517
  }
522
518
 
523
- const sameSiteInvalidSameParty: LazyMarkdownIssueDescription = {
524
- file: 'SameSiteInvalidSameParty.md',
525
- links: [{
526
- link: 'https://developer.chrome.com/blog/first-party-sets-sameparty/',
527
- linkTitle: i18nLazyString(UIStrings.firstPartySetsExplained),
528
- }],
529
- };
530
-
531
- const samePartyCrossPartyContextSet: LazyMarkdownIssueDescription = {
532
- file: 'SameSiteSamePartyCrossPartyContextSet.md',
533
- links: [{
534
- link: 'https://developer.chrome.com/blog/first-party-sets-sameparty/',
535
- linkTitle: i18nLazyString(UIStrings.firstPartySetsExplained),
536
- }],
537
- };
538
-
539
519
  const attributeValueExceedsMaxSize: LazyMarkdownIssueDescription = {
540
520
  file: 'CookieAttributeValueExceedsMaxSize.md',
541
521
  links: [],
@@ -608,8 +588,6 @@ const issueDescriptions = new Map<string, LazyMarkdownIssueDescription>([
608
588
  ['CookieIssue::ExcludeContextDowngrade::ReadCookie::Insecure', sameSiteExcludeContextDowngradeRead(false)],
609
589
  ['CookieIssue::ExcludeContextDowngrade::SetCookie::Secure', sameSiteExcludeContextDowngradeSet(true)],
610
590
  ['CookieIssue::ExcludeContextDowngrade::SetCookie::Insecure', sameSiteExcludeContextDowngradeSet(false)],
611
- ['CookieIssue::ExcludeInvalidSameParty::SetCookie', sameSiteInvalidSameParty],
612
- ['CookieIssue::ExcludeSamePartyCrossPartyContext::SetCookie', samePartyCrossPartyContextSet],
613
591
  ['CookieIssue::WarnAttributeValueExceedsMaxSize::ReadCookie', attributeValueExceedsMaxSize],
614
592
  ['CookieIssue::WarnAttributeValueExceedsMaxSize::SetCookie', attributeValueExceedsMaxSize],
615
593
  ['CookieIssue::WarnDomainNonASCII::ReadCookie', warnDomainNonAscii],
@@ -1421,7 +1421,11 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
1421
1421
  } else if (!this.extensionEnabled(port)) {
1422
1422
  result = this.status.E_FAILED('Permission denied');
1423
1423
  } else {
1424
- result = await handler(message, event.target as MessagePort);
1424
+ try {
1425
+ result = await handler(message, event.target as MessagePort);
1426
+ } catch (e) {
1427
+ result = this.status.E_FAILED(e.message);
1428
+ }
1425
1429
  }
1426
1430
 
1427
1431
  if (result && message.requestId) {
@@ -162,8 +162,7 @@ function renderNoModel(input: ViewInput): Lit.TemplateResult {
162
162
  lockedString(UIStringsNotTranslate.getHelpForWarning) :
163
163
  lockedString(UIStringsNotTranslate.getHelpForError)}
164
164
  </h2>
165
- <div>You can get quick answers from
166
- <x-link
165
+ <div>You can get quick answers from <x-link
167
166
  .jslog=${VisualLogging.link().track({click: true, keydown: 'Enter|Space'}).context('insights-teaser-built-in-ai-documentation')}
168
167
  class="link"
169
168
  href=${BUILT_IN_AI_DOCUMENTATION}
@@ -21,6 +21,11 @@ const UIStrings = {
21
21
  * @description Text in Timeline Panel of the Performance panel
22
22
  */
23
23
  initializingTracing: 'Initializing tracing…',
24
+ /**
25
+ * @description Text to indicate the progress of a trace. Informs the user that we are currently
26
+ * creating a performance trace.
27
+ */
28
+ tracing: 'Tracing…',
24
29
  /**
25
30
  * @description Text in Timeline Controller of the Performance panel indicating that the Performance Panel cannot
26
31
  * record a performance trace because the type of target (where possible types are page, service worker and shared
@@ -286,6 +291,7 @@ export class TimelineController implements Tracing.TracingManager.TracingManager
286
291
  }
287
292
 
288
293
  if (!options.navigateToUrl) {
294
+ this.client.recordingStatus(i18nString(UIStrings.tracing));
289
295
  return;
290
296
  }
291
297
 
@@ -211,6 +211,10 @@ const UIStrings = {
211
211
  * @description Status text to indicate that exporting the trace has failed
212
212
  */
213
213
  exportingFailed: 'Exporting the trace failed',
214
+ /**
215
+ * @description Text in Timeline Panel of the Performance panel
216
+ */
217
+ initializingTracing: 'Initializing tracing…',
214
218
  /**
215
219
  * @description Text to indicate the progress of a trace. Informs the user that we are currently
216
220
  * creating a performance trace.
@@ -1874,6 +1878,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
1874
1878
  await SDK.TargetManager.TargetManager.instance().suspendAllTargets('performance-timeline');
1875
1879
  await this.cpuProfiler.startRecording();
1876
1880
 
1881
+ this.statusDialog?.updateStatus(i18nString(UIStrings.tracing));
1877
1882
  this.recordingStarted();
1878
1883
  } catch (e) {
1879
1884
  await this.recordingFailed(e.message);
@@ -1928,7 +1933,6 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
1928
1933
  console.assert(!this.statusDialog, 'Status pane is already opened.');
1929
1934
  this.setState(State.START_PENDING);
1930
1935
  this.showRecordingStarted();
1931
-
1932
1936
  if (this.#isNode) {
1933
1937
  await this.#startCPUProfilingRecording();
1934
1938
  } else {
@@ -2833,7 +2837,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2833
2837
  },
2834
2838
  () => this.stopRecording());
2835
2839
  this.statusDialog.showPane(this.statusPaneContainer);
2836
- this.statusDialog.updateStatus(i18nString(UIStrings.tracing));
2840
+ this.statusDialog.updateStatus(i18nString(UIStrings.initializingTracing));
2837
2841
  this.statusDialog.updateProgressBar(i18nString(UIStrings.bufferUsage), 0);
2838
2842
  }
2839
2843
 
@@ -1,7 +1,7 @@
1
1
  Name: Dependencies sourced from the upstream `chromium` repository
2
2
  URL: https://chromium.googlesource.com/chromium/src
3
3
  Version: N/A
4
- Revision: e3edb4435f06ac3de39688c44cc50378c47e35e8
4
+ Revision: 20a082853649af2a56eb07f8b915a76b5e00d24a
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE
@@ -1,6 +1,6 @@
1
1
  npm install
2
2
  ../../../node_modules/.bin/tsc -d -t esnext -m esnext --moduleResolution node bundle.ts
3
- ../../../node_modules/rollup/dist/bin/rollup -c
3
+ ../../../node_modules/@rollup/wasm-node/dist/bin/rollup -c
4
4
  rm -rf node_modules bundle.js bundle.d.ts
5
5
  # Because there's a bug in clang causing it to reformat import lists even where formatting is disabled, run it right away
6
6
  git cl format --js
@@ -1,6 +1,6 @@
1
1
  npm install
2
2
  ../../../node_modules/.bin/tsc -d -t esnext -m esnext --moduleResolution node src/*
3
- ../../../node_modules/rollup/dist/bin/rollup -c
3
+ ../../../node_modules/@rollup/wasm-node/dist/bin/rollup -c
4
4
  rm -rf node_modules src/*.js src/*.d.ts
5
5
  # Because there's a bug in clang causing it to reformat import lists even where formatting is disabled, run it right away
6
6
  git cl format --js
@@ -299,6 +299,12 @@ ol.tree-outline.tree-variant-navigation:not(.hide-selection-when-blurred) li.sel
299
299
  .tree-outline.hide-selection-when-blurred .selected:focus-visible span {
300
300
  forced-color-adjust: none;
301
301
  color: HighlightText;
302
+
303
+ --icon-default: HighlightText;
304
+
305
+ &.event-listener-details .text-button {
306
+ color: HighlightText;
307
+ }
302
308
  }
303
309
 
304
310
  .tree-outline:not(.hide-selection-when-blurred) li.selected:focus-visible devtools-adorner,
package/package.json CHANGED
@@ -105,5 +105,5 @@
105
105
  "flat-cache": "6.1.12"
106
106
  }
107
107
  },
108
- "version": "1.0.1563563"
108
+ "version": "1.0.1564339"
109
109
  }
@@ -1,8 +0,0 @@
1
- # Mark SameParty cookies as Secure and do not use SameSite=Strict for SameParty cookies
2
-
3
- Cookies marked with `SameParty` must also be marked with `Secure`. In addition, cookies marked
4
- with `SameParty` cannot use `SameSite=Strict`.
5
-
6
- Resolve this issue by updating the attributes of the cookie:
7
- * Remove `SameParty` if the cookie should only be used by the same site but not the same first-party set
8
- * Remove `SameSite=Strict` and specify `Secure` if the cookie should be available to all sites of the same first-party set
@@ -1,10 +0,0 @@
1
- # Make sure a cookie is using the SameParty attribute correctly
2
-
3
- Setting cross-site cookies with the `SameParty` attribute is only possible if
4
- both domains are a part of the same First-Party Set.
5
-
6
- To allow setting cross-site cookies, try one of the following:
7
- * If the domains satisfy the First-Party Set criteria, add them to the same First-Party Set.
8
- * If the domains don't satisfy the First-Party Set criteria, remove the `SameParty` attribute and specify `SameSite=None`.
9
-
10
- If you don't have the option to do any of the above, cookies are not intended to be set in cross-site contexts.