chrome-devtools-frontend 1.0.1572937 → 1.0.1574367

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 (145) hide show
  1. package/front_end/Images/src/account-tree.svg +10 -1
  2. package/front_end/Images/src/arrow-right-circle.svg +2 -7
  3. package/front_end/Images/src/center-focus-weak.svg +3 -1
  4. package/front_end/Images/src/dog-paw.svg +10 -3
  5. package/front_end/Images/src/group.svg +3 -1
  6. package/front_end/Images/src/home.svg +3 -1
  7. package/front_end/Images/src/spark-info.svg +3 -3
  8. package/front_end/Images/src/spark.svg +2 -9
  9. package/front_end/core/sdk/AnimationModel.ts +0 -6
  10. package/front_end/core/sdk/IsolateManager.ts +0 -7
  11. package/front_end/devtools_compatibility.js +16 -1
  12. package/front_end/entrypoints/main/GlobalAiButton.ts +18 -3
  13. package/front_end/generated/InspectorBackendCommands.ts +6 -4
  14. package/front_end/generated/SupportedCSSProperties.js +17 -4
  15. package/front_end/generated/protocol-mapping.d.ts +2 -0
  16. package/front_end/generated/protocol-proxy-api.d.ts +2 -0
  17. package/front_end/generated/protocol.ts +37 -7
  18. package/front_end/models/ai_assistance/AiUtils.ts +8 -0
  19. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +7 -7
  20. package/front_end/models/ai_assistance/agents/StylingAgent.ts +4 -4
  21. package/front_end/models/issues_manager/CorsIssue.ts +4 -44
  22. package/front_end/models/logs/NetworkLog.ts +0 -9
  23. package/front_end/panels/ai_assistance/PatchWidget.ts +5 -5
  24. package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +1 -1
  25. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +34 -13
  26. package/front_end/panels/ai_assistance/components/ChatMessage.ts +3 -1
  27. package/front_end/panels/ai_assistance/components/ChatView.ts +20 -3
  28. package/front_end/panels/ai_assistance/components/chatView.css +20 -0
  29. package/front_end/panels/application/AppManifestView.ts +5 -5
  30. package/front_end/panels/application/DeviceBoundSessionsModel.ts +32 -3
  31. package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +31 -9
  32. package/front_end/panels/application/FrameDetailsView.ts +3 -4
  33. package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +1 -1
  34. package/front_end/panels/application/components/ProtocolHandlersView.ts +2 -2
  35. package/front_end/panels/application/components/ReportsGrid.ts +2 -2
  36. package/front_end/panels/application/preloading/PreloadingView.ts +2 -2
  37. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -2
  38. package/front_end/panels/autofill/AutofillView.ts +3 -3
  39. package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +1 -1
  40. package/front_end/panels/common/AiCodeCompletionTeaser.ts +4 -2
  41. package/front_end/panels/common/AiCodeGenerationUpgradeDialog.ts +2 -2
  42. package/front_end/panels/common/BadgeNotification.ts +3 -2
  43. package/front_end/panels/common/GdpSignUpDialog.ts +3 -3
  44. package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
  45. package/front_end/panels/console/ConsoleInsightTeaser.ts +5 -4
  46. package/front_end/panels/elements/ElementsTreeElement.ts +3 -1
  47. package/front_end/panels/explain/components/ConsoleInsight.ts +7 -7
  48. package/front_end/panels/issues/CorsIssueDetailsView.ts +0 -46
  49. package/front_end/panels/issues/IssueView.ts +1 -1
  50. package/front_end/panels/network/NetworkDataGridNode.ts +3 -1
  51. package/front_end/panels/network/RequestConditionsDrawer.ts +4 -4
  52. package/front_end/panels/network/RequestTimingView.ts +1 -1
  53. package/front_end/panels/network/components/RequestHeadersView.ts +2 -2
  54. package/front_end/panels/profiler/HeapDetachedElementsView.ts +0 -5
  55. package/front_end/panels/profiler/HeapProfileView.ts +0 -6
  56. package/front_end/panels/profiler/HeapSnapshotView.ts +0 -14
  57. package/front_end/panels/profiler/IsolateSelector.ts +1 -2
  58. package/front_end/panels/recorder/RecorderController.ts +2 -2
  59. package/front_end/panels/security/CookieReportView.ts +6 -6
  60. package/front_end/panels/settings/AISettingsTab.ts +1 -1
  61. package/front_end/panels/settings/components/SyncSection.ts +1 -1
  62. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +1 -1
  63. package/front_end/panels/sources/BreakpointEditDialog.ts +1 -1
  64. package/front_end/panels/sources/NavigatorView.ts +3 -1
  65. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -1
  66. package/front_end/panels/whats_new/ReleaseNoteView.ts +1 -1
  67. package/front_end/third_party/chromium/README.chromium +1 -1
  68. package/front_end/third_party/puppeteer/README.chromium +2 -2
  69. package/front_end/third_party/puppeteer/package/README.md +5 -0
  70. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPResponse.d.ts +6 -1
  71. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPResponse.d.ts.map +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPResponse.js +5 -1
  73. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPResponse.js.map +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +3 -0
  75. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  76. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +53 -55
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +25 -0
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +7 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +3 -0
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +2 -0
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +2 -0
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  99. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +7 -1
  100. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +21 -8
  101. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPResponse.d.ts +6 -1
  102. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPResponse.d.ts.map +1 -1
  103. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPResponse.js +5 -1
  104. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPResponse.js.map +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +3 -0
  106. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  107. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +54 -56
  108. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
  110. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +25 -0
  112. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts +7 -1
  114. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +3 -0
  116. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  118. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +2 -0
  119. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +2 -0
  122. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/types.d.ts +7 -1
  129. package/front_end/third_party/puppeteer/package/package.json +5 -5
  130. package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +7 -2
  131. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +62 -71
  132. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +29 -0
  133. package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +12 -1
  134. package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +2 -0
  135. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +2 -0
  136. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  137. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  138. package/front_end/ui/components/buttons/Button.ts +26 -14
  139. package/front_end/ui/components/buttons/FloatingButton.ts +7 -3
  140. package/front_end/ui/components/buttons/floatingButton.css +44 -0
  141. package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
  142. package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
  143. package/front_end/ui/components/text_editor/AutocompleteHistory.ts +33 -1
  144. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  145. package/package.json +3 -2
@@ -43,7 +43,7 @@ import type {
43
43
  CookieSameSite,
44
44
  DeleteCookiesRequest,
45
45
  } from '../common/Cookie.js';
46
- import {UnsupportedOperation} from '../common/Errors.js';
46
+ import {ProtocolError, UnsupportedOperation} from '../common/Errors.js';
47
47
  import {EventEmitter} from '../common/EventEmitter.js';
48
48
  import {FileChooser} from '../common/FileChooser.js';
49
49
  import type {PDFOptions} from '../common/PDFOptions.js';
@@ -136,7 +136,6 @@ export class BidiPage extends Page {
136
136
  /**
137
137
  * @internal
138
138
  */
139
- #overrideNavigatorPropertiesPreloadScript?: string;
140
139
  override async setUserAgent(
141
140
  userAgentOrOptions:
142
141
  | string
@@ -147,79 +146,40 @@ export class BidiPage extends Page {
147
146
  },
148
147
  userAgentMetadata?: Protocol.Emulation.UserAgentMetadata,
149
148
  ): Promise<void> {
150
- let userAgent: string;
151
- let metadata: Protocol.Emulation.UserAgentMetadata | undefined;
149
+ let userAgent: string | null;
150
+ let clientHints:
151
+ | Bidi.BidiUaClientHints.Emulation.ClientHintsMetadata
152
+ | undefined;
152
153
  let platform: string | undefined;
153
154
 
154
155
  if (typeof userAgentOrOptions === 'string') {
155
156
  userAgent = userAgentOrOptions;
156
- metadata = userAgentMetadata;
157
+ clientHints = userAgentMetadata;
157
158
  } else {
158
- userAgent =
159
- userAgentOrOptions.userAgent ??
160
- (await this.#browserContext.browser().userAgent());
161
- metadata = userAgentOrOptions.userAgentMetadata;
162
- platform = userAgentOrOptions.platform;
159
+ userAgent = userAgentOrOptions.userAgent ?? null;
160
+ clientHints = userAgentOrOptions.userAgentMetadata;
161
+ // Empty string platform should be interpreted as "no override".
162
+ platform =
163
+ userAgentOrOptions.platform === ''
164
+ ? undefined
165
+ : userAgentOrOptions.platform;
163
166
  }
164
-
165
- if (
166
- !this.#browserContext.browser().cdpSupported &&
167
- (metadata || platform)
168
- ) {
169
- throw new UnsupportedOperation(
170
- 'Current Browser does not support `userAgentMetadata` or `platform`',
171
- );
172
- } else if (
173
- this.#browserContext.browser().cdpSupported &&
174
- (metadata || platform)
175
- ) {
176
- return await this._client().send('Network.setUserAgentOverride', {
177
- userAgent: userAgent,
178
- userAgentMetadata: metadata,
179
- platform: platform,
180
- });
167
+ if (userAgent === '') {
168
+ // In WebDriver BiDi null is used to restore the original user agent.
169
+ userAgent = null;
181
170
  }
182
- const enable = userAgent !== '';
183
- userAgent = userAgent ?? (await this.#browserContext.browser().userAgent());
171
+ await this.#frame.browsingContext.setUserAgent(userAgent);
184
172
 
185
- await this.#frame.browsingContext.setUserAgent(enable ? userAgent : null);
186
-
187
- const overrideNavigatorProperties = (platform: string | undefined) => {
188
- if (platform) {
189
- Object.defineProperty(navigator, 'platform', {
190
- value: platform,
191
- configurable: true,
192
- });
193
- }
194
- };
195
-
196
- const frames = [this.#frame];
197
- for (const frame of frames) {
198
- frames.push(...frame.childFrames());
173
+ if (platform && platform !== '') {
174
+ // Work-around until https://github.com/w3c/webdriver-bidi/issues/1065 is resolved.
175
+ // Set platform via client hints override.
176
+ clientHints = clientHints ?? {};
177
+ clientHints.platform = platform;
199
178
  }
200
179
 
201
- if (this.#overrideNavigatorPropertiesPreloadScript) {
202
- await this.removeScriptToEvaluateOnNewDocument(
203
- this.#overrideNavigatorPropertiesPreloadScript,
204
- );
205
- }
206
- const [evaluateToken] = await Promise.all([
207
- enable
208
- ? this.evaluateOnNewDocument(
209
- overrideNavigatorProperties,
210
- platform || undefined,
211
- )
212
- : undefined,
213
- // When we disable the UserAgent we want to
214
- // evaluate the original value in all Browsing Contexts
215
- ...frames.map(frame => {
216
- return frame.evaluate(
217
- overrideNavigatorProperties,
218
- platform || undefined,
219
- );
220
- }),
221
- ]);
222
- this.#overrideNavigatorPropertiesPreloadScript = evaluateToken?.identifier;
180
+ await this.#frame.browsingContext.setClientHintsOverride(
181
+ clientHints ?? null,
182
+ );
223
183
  }
224
184
 
225
185
  override async setBypassCSP(enabled: boolean): Promise<void> {
@@ -420,6 +380,7 @@ export class BidiPage extends Page {
420
380
  }
421
381
 
422
382
  override async setViewport(viewport: Viewport | null): Promise<void> {
383
+ let needsReload = false;
423
384
  if (!this.browser().cdpSupported) {
424
385
  const viewportSize =
425
386
  viewport?.width && viewport?.height
@@ -447,7 +408,7 @@ export class BidiPage extends Page {
447
408
  }
448
409
  : null;
449
410
 
450
- await Promise.all([
411
+ const commands = [
451
412
  this.#frame.browsingContext.setViewport({
452
413
  viewport: viewportSize,
453
414
  devicePixelRatio,
@@ -455,13 +416,39 @@ export class BidiPage extends Page {
455
416
  this.#frame.browsingContext.setScreenOrientationOverride(
456
417
  screenOrientation,
457
418
  ),
458
- ]);
419
+ ];
459
420
 
460
- this.#viewport = viewport;
461
- return;
421
+ if (
422
+ (this.#viewport?.hasTouch ?? false) !== (viewport?.hasTouch ?? false)
423
+ ) {
424
+ // The requested touch override state is different from the current one, meaning
425
+ // the reload is needed.
426
+ needsReload = true;
427
+ // 1 touch point if touch is enabled, null otherwise.
428
+ const maxTouchPoints = viewport?.hasTouch ? 1 : null;
429
+
430
+ commands.push(
431
+ this.#frame.browsingContext
432
+ .setTouchOverride(maxTouchPoints)
433
+ .catch(error => {
434
+ if (
435
+ error instanceof ProtocolError &&
436
+ (error.message.includes('unknown command') ||
437
+ error.message.includes('unsupported operation'))
438
+ ) {
439
+ // Tolerate not implemented or not supported commands. At least until
440
+ // the `emulation.setTouchOverride` is supported by all the supported
441
+ // browsers.
442
+ return;
443
+ }
444
+ throw error;
445
+ }),
446
+ );
447
+ }
448
+ await Promise.all(commands);
449
+ } else {
450
+ needsReload = await this.#cdpEmulationManager.emulateViewport(viewport);
462
451
  }
463
- const needsReload =
464
- await this.#cdpEmulationManager.emulateViewport(viewport);
465
452
  this.#viewport = viewport;
466
453
  if (needsReload) {
467
454
  await this.reload();
@@ -1139,6 +1126,10 @@ function cdpSpecificCookiePropertiesFromBidiToPuppeteer(
1139
1126
  result[property] = bidiCookie[CDP_SPECIFIC_PREFIX + property];
1140
1127
  }
1141
1128
  }
1129
+ // TODO: remove once deprecated sameParty attribute is dropped.
1130
+ if (!result.sameParty) {
1131
+ result.sameParty = false;
1132
+ }
1142
1133
  return result;
1143
1134
  }
1144
1135
 
@@ -155,6 +155,8 @@ export class BrowsingContext extends EventEmitter<{
155
155
  #navigation: Navigation | undefined;
156
156
  #reason?: string;
157
157
  #url: string;
158
+ // Indicated whether client hints have been set to non-default.
159
+ #clientHintsAreSet = false;
158
160
  readonly #children = new Map<string, BrowsingContext>();
159
161
  readonly #disposables = new DisposableStack();
160
162
  readonly #realms = new Map<string, WindowRealm>();
@@ -508,6 +510,17 @@ export class BrowsingContext extends EventEmitter<{
508
510
  });
509
511
  }
510
512
 
513
+ @throwIfDisposed<BrowsingContext>(context => {
514
+ // SAFETY: Disposal implies this exists.
515
+ return context.#reason!;
516
+ })
517
+ async setTouchOverride(maxTouchPoints: number | null): Promise<void> {
518
+ await this.#session.send('emulation.setTouchOverride', {
519
+ contexts: [this.id],
520
+ maxTouchPoints,
521
+ });
522
+ }
523
+
511
524
  @throwIfDisposed<BrowsingContext>(context => {
512
525
  // SAFETY: Disposal implies this exists.
513
526
  return context.#reason!;
@@ -761,6 +774,22 @@ export class BrowsingContext extends EventEmitter<{
761
774
  });
762
775
  }
763
776
 
777
+ async setClientHintsOverride(
778
+ clientHints: Bidi.BidiUaClientHints.Emulation.ClientHintsMetadata | null,
779
+ ): Promise<void> {
780
+ if (clientHints === null && !this.#clientHintsAreSet) {
781
+ // Ignore the call, as the client hints are not supposed to be changed. Required to
782
+ // avoid breakage with browsers that don't support client hints emulation.
783
+ return;
784
+ }
785
+ this.#clientHintsAreSet = true;
786
+
787
+ await this.#session.send('emulation.setClientHintsOverride', {
788
+ clientHints,
789
+ contexts: [this.id],
790
+ });
791
+ }
792
+
764
793
  async setOfflineMode(enabled: boolean): Promise<void> {
765
794
  await this.#session.send('emulation.setNetworkConditions', {
766
795
  networkConditions: enabled
@@ -8,6 +8,7 @@ import type {Protocol} from 'devtools-protocol';
8
8
 
9
9
  import type {ElementHandle} from '../api/ElementHandle.js';
10
10
  import type {Realm} from '../api/Realm.js';
11
+ import type {CdpFrame} from '../cdp/Frame.js';
11
12
  import {debugError} from '../common/util.js';
12
13
 
13
14
  /**
@@ -88,12 +89,19 @@ export interface SerializedAXNode {
88
89
  children?: SerializedAXNode[];
89
90
 
90
91
  /**
91
- * CDP-specifc ID to reference the DOM node.
92
+ * CDP-specific ID to reference the DOM node.
92
93
  *
93
94
  * @internal
94
95
  */
95
96
  backendNodeId?: number;
96
97
 
98
+ /**
99
+ * CDP-specific documentId.
100
+ *
101
+ * @internal
102
+ */
103
+ loaderId: string;
104
+
97
105
  /**
98
106
  * Get an ElementHandle for this AXNode if available.
99
107
  *
@@ -553,6 +561,9 @@ class AXNode {
553
561
  })) as ElementHandle<Element>;
554
562
  },
555
563
  backendNodeId: this.payload.backendDOMNodeId,
564
+ // LoaderId is an experimental mechanism to establish unique IDs across
565
+ // navigations.
566
+ loaderId: (this.#realm.environment as CdpFrame)._loaderId,
556
567
  };
557
568
 
558
569
  type UserStringProperty =
@@ -116,6 +116,8 @@ export class CdpBrowserContext extends BrowserContext {
116
116
  hasCrossSiteAncestor: cookie.partitionKey.hasCrossSiteAncestor,
117
117
  }
118
118
  : undefined,
119
+ // TODO: remove sameParty as it is removed from Chrome.
120
+ sameParty: cookie.sameParty ?? false,
119
121
  };
120
122
  });
121
123
  }
@@ -650,6 +650,8 @@ export class CdpPage extends Page {
650
650
  partitionKey: cookie.partitionKey
651
651
  ? cookie.partitionKey.topLevelSite
652
652
  : undefined,
653
+ // TODO: remove sameParty as it is removed from Chrome.
654
+ sameParty: cookie.sameParty ?? false,
653
655
  };
654
656
  });
655
657
  }
@@ -8,7 +8,7 @@
8
8
  * @internal
9
9
  */
10
10
  export const PUPPETEER_REVISIONS = Object.freeze({
11
- chrome: '143.0.7499.192',
12
- 'chrome-headless-shell': '143.0.7499.192',
13
- firefox: 'stable_146.0.1',
11
+ chrome: '144.0.7559.96',
12
+ 'chrome-headless-shell': '144.0.7559.96',
13
+ firefox: 'stable_147.0.1',
14
14
  });
@@ -6,5 +6,5 @@
6
6
 
7
7
  // If moved update release-please config
8
8
  // x-release-please-start-version
9
- export const packageVersion = '24.35.0';
9
+ export const packageVersion = '24.36.0';
10
10
  // x-release-please-end
@@ -56,17 +56,12 @@ interface ButtonState {
56
56
  spinner?: boolean;
57
57
  type: ButtonType;
58
58
  value?: string;
59
- title?: string;
60
59
  iconName?: string;
61
60
  toggledIconName?: string;
62
61
  toggleType?: ToggleType;
63
62
  jslogContext?: string;
64
63
  longClickable?: boolean;
65
64
  inverseColorTheme?: boolean;
66
- /**
67
- * Sets aria-label on the internal <button> element.
68
- */
69
- accessibleLabel?: string;
70
65
  }
71
66
 
72
67
  interface CommonButtonData {
@@ -151,9 +146,6 @@ export class Button extends HTMLElement {
151
146
  if ('size' in data && data.size) {
152
147
  this.#props.size = data.size;
153
148
  }
154
- if (data.accessibleLabel) {
155
- this.#props.accessibleLabel = data.accessibleLabel;
156
- }
157
149
 
158
150
  this.#props.active = Boolean(data.active);
159
151
  this.#props.spinner = Boolean('spinner' in data ? data.spinner : false);
@@ -166,7 +158,14 @@ export class Button extends HTMLElement {
166
158
  this.#props.toggleType = data.toggleType;
167
159
  this.#props.checked = data.checked;
168
160
  this.#props.disabled = Boolean(data.disabled);
169
- this.#props.title = data.title;
161
+ if (data.title) {
162
+ this.title = data.title;
163
+ }
164
+
165
+ if (data.accessibleLabel) {
166
+ this.accessibleLabel = data.accessibleLabel;
167
+ }
168
+
170
169
  this.#props.jslogContext = data.jslogContext;
171
170
  this.#props.longClickable = data.longClickable;
172
171
  this.#props.inverseColorTheme = data.inverseColorTheme;
@@ -198,11 +197,20 @@ export class Button extends HTMLElement {
198
197
  this.#render();
199
198
  }
200
199
 
201
- set accessibleLabel(label: string) {
202
- this.#props.accessibleLabel = label;
200
+ set accessibleLabel(label: string|undefined) {
201
+ if (label) {
202
+ this.setAttribute('accessibleLabel', label);
203
+ } else {
204
+ this.removeAttribute('accessibleLabel');
205
+ }
206
+
203
207
  this.#render();
204
208
  }
205
209
 
210
+ get accessibleLabel(): string|undefined {
211
+ return this.getAttribute('accessibleLabel') || undefined;
212
+ }
213
+
206
214
  set reducedFocusRing(reducedFocusRing: boolean) {
207
215
  this.#props.reducedFocusRing = reducedFocusRing;
208
216
  this.#render();
@@ -213,8 +221,12 @@ export class Button extends HTMLElement {
213
221
  this.#render();
214
222
  }
215
223
 
224
+ override get title(): string {
225
+ return super.title;
226
+ }
227
+
216
228
  override set title(title: string) {
217
- this.#props.title = title;
229
+ super.title = title;
218
230
  this.#render();
219
231
  }
220
232
 
@@ -369,11 +381,11 @@ export class Button extends HTMLElement {
369
381
  Lit.render(
370
382
  html`
371
383
  <style>${buttonStyles}</style>
372
- <button title=${ifDefined(this.#props.title)}
384
+ <button title=${ifDefined(this.title || undefined)}
373
385
  ?disabled=${this.#props.disabled}
374
386
  class=${classMap(classes)}
375
387
  aria-pressed=${ifDefined(this.#props.toggled)}
376
- aria-label=${ifDefined(this.#props.accessibleLabel)}
388
+ aria-label=${ifDefined(this.accessibleLabel || this.title || undefined)}
377
389
  jslog=${ifDefined(jslog)}>
378
390
  ${hasIcon ? html`
379
391
  <devtools-icon name=${ifDefined(this.#props.toggled ? this.#props.toggledIconName : this.#props.iconName)}>
@@ -9,7 +9,7 @@ import * as Lit from '../../lit/lit.js';
9
9
 
10
10
  import floatingButtonStyles from './floatingButton.css.js';
11
11
 
12
- const {html} = Lit;
12
+ const {html, Directives: {classMap}} = Lit;
13
13
 
14
14
  /**
15
15
  * A simple floating button component, primarily used to display the 'Ask AI!'
@@ -19,7 +19,7 @@ const {html} = Lit;
19
19
  *
20
20
  * ```js
21
21
  * // Instantiate programmatically via the `create()` helper:
22
- * const button = Buttons.FloatingButton.create('smart-assistant', 'Ask AI!');
22
+ * const button = Buttons.FloatingButton.create(AiAssistance.AiUtils.getIconName(), 'Ask AI!');
23
23
  *
24
24
  * // Use within a template:
25
25
  * html`
@@ -96,10 +96,14 @@ export class FloatingButton extends HTMLElement {
96
96
  }
97
97
 
98
98
  #render(): void {
99
+ const classes = classMap({
100
+ gemini: this.iconName === 'spark',
101
+ });
102
+
99
103
  // clang-format off
100
104
  Lit.render(html`
101
105
  <style>${floatingButtonStyles}</style>
102
- <button><devtools-icon .name=${this.iconName}></devtools-icon></button>`,
106
+ <button class=${classes}><devtools-icon .name=${this.iconName}></devtools-icon></button>`,
103
107
  this.#shadow, {host: this});
104
108
  // clang-format on
105
109
  }
@@ -72,3 +72,47 @@ button {
72
72
  color: var(--sys-color-state-disabled);
73
73
  }
74
74
  }
75
+
76
+ .gemini {
77
+ display: flex;
78
+ justify-content: center;
79
+ align-items: center;
80
+ width: var(--sys-size-9);
81
+ height: var(--sys-size-9);
82
+ border-radius: var(--sys-shape-corner-full);
83
+ background-image: var(--app-gradient-google-ai);
84
+ font: var(--sys-typescale-body4-medium);
85
+ color: var(--ref-palette-neutral100);
86
+ transition: width 1s, padding 1s;
87
+ margin-left: auto;
88
+ overflow: hidden;
89
+ position: relative;
90
+ border: 0;
91
+
92
+ &:focus-visible {
93
+ outline: var(--sys-size-2) solid var(--sys-color-state-focus-ring);
94
+ }
95
+
96
+ &:hover::after,
97
+ &:active::after {
98
+ content: "";
99
+ height: 100%;
100
+ width: 100%;
101
+ border-radius: inherit;
102
+ position: absolute;
103
+ top: 0;
104
+ left: 0;
105
+ }
106
+
107
+ &:hover::after {
108
+ background-color: var(--sys-color-state-hover-on-prominent);
109
+ }
110
+
111
+ &:active::after {
112
+ background-color: var(--sys-color-state-ripple-primary);
113
+ }
114
+
115
+ devtools-icon {
116
+ color: var(--ref-palette-neutral100) !important; /* stylelint-disable-line declaration-no-important */
117
+ }
118
+ }
@@ -204,7 +204,7 @@ export class CodeBlock extends HTMLElement {
204
204
  #renderNotice(): Lit.TemplateResult {
205
205
  // clang-format off
206
206
  return html`<p class="notice">
207
- <devtools-link class="link" href="https://support.google.com/legal/answer/13505487" .jslogContext=${'code-disclaimer'}>
207
+ <devtools-link class="link" href="https://support.google.com/legal/answer/13505487" jslogcontext="code-disclaimer">
208
208
  ${i18nString(UIStrings.disclaimer)}
209
209
  </devtools-link>
210
210
  </p>`;
@@ -74,7 +74,7 @@ export class PanelFeedback extends HTMLElement {
74
74
  </div>
75
75
  <div class="video-description">
76
76
  <h3>${i18nString(UIStrings.videoAndDocumentation)}</h3>
77
- <devtools-link class="quick-start-link" href=${this.#props.quickStartUrl} .jslogContext=${'css-overview.quick-start'}>${this.#props.quickStartLinkText}</devtools-link>
77
+ <devtools-link class="quick-start-link" href=${this.#props.quickStartUrl} jslogcontext="css-overview.quick-start">${this.#props.quickStartLinkText}</devtools-link>
78
78
  </div>
79
79
  </div>
80
80
  </div>
@@ -20,6 +20,12 @@ export class AutocompleteHistory {
20
20
  #historyOffset = 1;
21
21
  #uncommittedIsTop = false;
22
22
 
23
+ /**
24
+ * Tracks session-local edits made to history entries during navigation.
25
+ * Maps history index to edited text. Cleared when a new command is committed.
26
+ */
27
+ #editedEntries = new Map<number, string>();
28
+
23
29
  /**
24
30
  * Creates a new settings-backed history. The class assumes it has sole
25
31
  * ownership of the setting.
@@ -33,6 +39,7 @@ export class AutocompleteHistory {
33
39
  this.#data = [];
34
40
  this.#setting.set([]);
35
41
  this.#historyOffset = 1;
42
+ this.#editedEntries.clear();
36
43
  }
37
44
 
38
45
  length(): number {
@@ -49,6 +56,7 @@ export class AutocompleteHistory {
49
56
  }
50
57
 
51
58
  this.#historyOffset = 1;
59
+ this.#editedEntries.clear();
52
60
  if (text !== this.#currentHistoryItem()) {
53
61
  this.#data.push(text);
54
62
  }
@@ -72,11 +80,33 @@ export class AutocompleteHistory {
72
80
  }
73
81
  if (this.#historyOffset === 1) {
74
82
  this.#pushCurrentText(currentText);
83
+ } else {
84
+ this.#saveCurrentEdit(currentText);
75
85
  }
76
86
  ++this.#historyOffset;
77
87
  return this.#currentHistoryItem();
78
88
  }
79
89
 
90
+ /**
91
+ * Saves the current text as an edit if it differs from the current history item
92
+ * (which may already have edits from a previous navigation).
93
+ * Only saves non-empty edits to avoid issues with navigation-only calls.
94
+ */
95
+ #saveCurrentEdit(text: string): void {
96
+ const index = this.#data.length - this.#historyOffset;
97
+ const currentValue = this.#currentHistoryItem();
98
+ if (text === currentValue) {
99
+ return;
100
+ }
101
+ const original = this.#data[index];
102
+ if (text !== original && text.length > 0) {
103
+ this.#editedEntries.set(index, text);
104
+ } else {
105
+ // Remove edit if text was restored to original (or emptied)
106
+ this.#editedEntries.delete(index);
107
+ }
108
+ }
109
+
80
110
  next(): string|undefined {
81
111
  if (this.#historyOffset === 1) {
82
112
  return undefined;
@@ -98,7 +128,9 @@ export class AutocompleteHistory {
98
128
  }
99
129
 
100
130
  #currentHistoryItem(): string|undefined {
101
- return this.#data[this.#data.length - this.#historyOffset];
131
+ const index = this.#data.length - this.#historyOffset;
132
+ // Return edited version if available, otherwise return original
133
+ return this.#editedEntries.get(index) ?? this.#data[index];
102
134
  }
103
135
 
104
136
  #store(): void {
@@ -4201,6 +4201,7 @@ export const knownContextValues = new Set([
4201
4201
  'view-transition-class',
4202
4202
  'view-transition-group',
4203
4203
  'view-transition-name',
4204
+ 'view-transition-scope',
4204
4205
  'views-location-override',
4205
4206
  'virtual-authenticators',
4206
4207
  'visibility',
package/package.json CHANGED
@@ -93,7 +93,8 @@
93
93
  "typescript-eslint": "8.47.0",
94
94
  "uuid": "13.0.0",
95
95
  "webidl2": "24.5.0",
96
- "yargs": "17.7.2"
96
+ "yargs": "17.7.2",
97
+ "js-rouge": "3.2.0"
97
98
  },
98
99
  "overrides": {
99
100
  "@typescript-eslint/types": "8.47.0",
@@ -104,5 +105,5 @@
104
105
  "flat-cache": "6.1.12"
105
106
  }
106
107
  },
107
- "version": "1.0.1572937"
108
+ "version": "1.0.1574367"
108
109
  }