chrome-devtools-frontend 1.0.1573331 → 1.0.1575174
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 +1 -0
- package/docs/contributing/settings-experiments-features.md +5 -2
- package/front_end/Images/src/account-tree.svg +10 -1
- package/front_end/Images/src/arrow-right-circle.svg +2 -7
- package/front_end/Images/src/center-focus-weak.svg +3 -1
- package/front_end/Images/src/dog-paw.svg +10 -3
- package/front_end/Images/src/group.svg +3 -1
- package/front_end/Images/src/home.svg +3 -1
- package/front_end/Images/src/spark-info.svg +3 -3
- package/front_end/Images/src/spark.svg +2 -9
- package/front_end/core/common/Settings.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +5 -1
- package/front_end/core/host/InspectorFrontendHostStub.ts +10 -0
- package/front_end/core/host/UserMetrics.ts +15 -0
- package/front_end/core/root/Runtime.ts +119 -39
- package/front_end/core/sdk/AnimationModel.ts +0 -6
- package/front_end/devtools_compatibility.js +16 -1
- package/front_end/entrypoints/main/GlobalAiButton.ts +18 -3
- package/front_end/entrypoints/main/MainImpl.ts +13 -1
- package/front_end/generated/InspectorBackendCommands.ts +6 -4
- package/front_end/generated/SupportedCSSProperties.js +17 -4
- package/front_end/generated/protocol-mapping.d.ts +2 -0
- package/front_end/generated/protocol-proxy-api.d.ts +2 -0
- package/front_end/generated/protocol.ts +37 -7
- package/front_end/models/ai_assistance/AiUtils.ts +8 -0
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +3 -3
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +5 -4
- package/front_end/models/issues_manager/CorsIssue.ts +1 -44
- package/front_end/models/logs/NetworkLog.ts +0 -9
- package/front_end/models/stack_trace/StackTrace.ts +40 -0
- package/front_end/panels/ai_assistance/PatchWidget.ts +2 -1
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +34 -13
- package/front_end/panels/ai_assistance/components/ChatInput.ts +24 -2
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +3 -1
- package/front_end/panels/ai_assistance/components/ChatView.ts +20 -3
- package/front_end/panels/ai_assistance/components/chatView.css +20 -0
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +3 -1
- package/front_end/panels/common/AiCodeGenerationUpgradeDialog.ts +32 -16
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
- package/front_end/panels/console/ConsoleFormat.ts +31 -2
- package/front_end/panels/console/ConsoleInsightTeaser.ts +8 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +47 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/issues/CorsIssueDetailsView.ts +0 -46
- package/front_end/panels/network/NetworkDataGridNode.ts +3 -1
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +0 -5
- package/front_end/panels/profiler/HeapProfileView.ts +0 -6
- package/front_end/panels/profiler/HeapSnapshotView.ts +0 -14
- package/front_end/panels/settings/AISettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +12 -6
- package/front_end/panels/settings/settings-meta.ts +1 -0
- package/front_end/panels/sources/NavigatorView.ts +3 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -1
- package/front_end/panels/whats_new/ReleaseNoteText.ts +11 -11
- package/front_end/panels/whats_new/resources/WNDT.md +6 -6
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/README.md +5 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPResponse.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPResponse.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +53 -55
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +25 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +7 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +7 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +21 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPResponse.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPResponse.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +54 -56
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +25 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts +7 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +7 -1
- package/front_end/third_party/puppeteer/package/package.json +5 -5
- package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +7 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +62 -71
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +29 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +12 -1
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/buttons/Button.ts +26 -14
- package/front_end/ui/components/buttons/FloatingButton.ts +7 -3
- package/front_end/ui/components/buttons/floatingButton.css +44 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/mcp/HostBindings.ts +6 -0
- package/package.json +3 -2
|
@@ -181,20 +181,6 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
181
181
|
this.appendColumnTitle(header, i18nString(UIStrings.initiatorAddressSpace));
|
|
182
182
|
this.appendColumnTitle(header, i18nString(UIStrings.initiatorContext));
|
|
183
183
|
break;
|
|
184
|
-
case IssuesManager.CorsIssue.IssueCode.PREFLIGHT_ALLOW_PRIVATE_NETWORK_ERROR:
|
|
185
|
-
this.appendColumnTitle(header, i18nString(UIStrings.preflightRequest));
|
|
186
|
-
this.appendColumnTitle(header, i18nString(UIStrings.invalidValue));
|
|
187
|
-
this.appendColumnTitle(header, i18nString(UIStrings.initiatorAddressSpace));
|
|
188
|
-
this.appendColumnTitle(header, i18nString(UIStrings.initiatorContext));
|
|
189
|
-
break;
|
|
190
|
-
case IssuesManager.CorsIssue.IssueCode.PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_ID:
|
|
191
|
-
case IssuesManager.CorsIssue.IssueCode.PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_NAME:
|
|
192
|
-
this.appendColumnTitle(header, i18nString(UIStrings.preflightRequest));
|
|
193
|
-
this.appendColumnTitle(header, i18nString(UIStrings.invalidValue));
|
|
194
|
-
this.appendColumnTitle(header, i18nString(UIStrings.resourceAddressSpace));
|
|
195
|
-
this.appendColumnTitle(header, i18nString(UIStrings.initiatorAddressSpace));
|
|
196
|
-
this.appendColumnTitle(header, i18nString(UIStrings.initiatorContext));
|
|
197
|
-
break;
|
|
198
184
|
case IssuesManager.CorsIssue.IssueCode.METHOD_DISALLOWED_BY_PREFLIGHT_RESPONSE:
|
|
199
185
|
this.appendColumnTitle(header, i18nString(UIStrings.preflightRequest));
|
|
200
186
|
this.appendColumnTitle(header, i18nString(UIStrings.disallowedRequestMethod));
|
|
@@ -222,9 +208,6 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
222
208
|
Platform.assertUnhandled<IssuesManager.CorsIssue.IssueCode.PREFLIGHT_MISSING_ALLOW_EXTERNAL|
|
|
223
209
|
IssuesManager.CorsIssue.IssueCode.PREFLIGHT_INVALID_ALLOW_EXTERNAL|
|
|
224
210
|
IssuesManager.CorsIssue.IssueCode.INVALID_PRIVATE_NETWORK_ACCESS|
|
|
225
|
-
IssuesManager.CorsIssue.IssueCode.UNEXPECTED_PRIVATE_NETWORK_ACCESS|IssuesManager
|
|
226
|
-
.CorsIssue.IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_UNAVAILABLE|IssuesManager
|
|
227
|
-
.CorsIssue.IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_DENIED|
|
|
228
211
|
IssuesManager.CorsIssue.IssueCode.LOCAL_NETWORK_ACCESS_PERMISSION_DENIED>(issueCode);
|
|
229
212
|
}
|
|
230
213
|
|
|
@@ -267,18 +250,11 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
267
250
|
case Protocol.Network.CorsError.InvalidAllowCredentials:
|
|
268
251
|
case Protocol.Network.CorsError.PreflightInvalidAllowCredentials:
|
|
269
252
|
return 'Access-Control-Allow-Credentials';
|
|
270
|
-
case Protocol.Network.CorsError.PreflightMissingAllowPrivateNetwork:
|
|
271
|
-
case Protocol.Network.CorsError.PreflightInvalidAllowPrivateNetwork:
|
|
272
|
-
return 'Access-Control-Allow-Private-Network';
|
|
273
253
|
case Protocol.Network.CorsError.RedirectContainsCredentials:
|
|
274
254
|
case Protocol.Network.CorsError.PreflightDisallowedRedirect:
|
|
275
255
|
return 'Location';
|
|
276
256
|
case Protocol.Network.CorsError.PreflightInvalidStatus:
|
|
277
257
|
return 'Status-Code';
|
|
278
|
-
case Protocol.Network.CorsError.PreflightMissingPrivateNetworkAccessId:
|
|
279
|
-
return 'Private-Network-Access-Id';
|
|
280
|
-
case Protocol.Network.CorsError.PreflightMissingPrivateNetworkAccessName:
|
|
281
|
-
return 'Private-Network-Access-Name';
|
|
282
258
|
}
|
|
283
259
|
return '';
|
|
284
260
|
}
|
|
@@ -393,15 +369,6 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
393
369
|
this.appendIssueDetailCell(element, details.clientSecurityState?.initiatorIPAddressSpace ?? '');
|
|
394
370
|
this.#appendSecureContextCell(element, details.clientSecurityState?.initiatorIsSecureContext);
|
|
395
371
|
break;
|
|
396
|
-
case IssuesManager.CorsIssue.IssueCode.PREFLIGHT_ALLOW_PRIVATE_NETWORK_ERROR: {
|
|
397
|
-
element.appendChild(this.createRequestCell(details.request, opts));
|
|
398
|
-
this.#appendStatus(element, details.isWarning);
|
|
399
|
-
element.appendChild(this.createRequestCell(details.request, {...opts, linkToPreflight: true, highlightHeader}));
|
|
400
|
-
this.appendIssueDetailCell(element, details.corsErrorStatus.failedParameter, 'code-example');
|
|
401
|
-
this.appendIssueDetailCell(element, details.clientSecurityState?.initiatorIPAddressSpace ?? '');
|
|
402
|
-
this.#appendSecureContextCell(element, details.clientSecurityState?.initiatorIsSecureContext);
|
|
403
|
-
break;
|
|
404
|
-
}
|
|
405
372
|
case IssuesManager.CorsIssue.IssueCode.METHOD_DISALLOWED_BY_PREFLIGHT_RESPONSE:
|
|
406
373
|
element.appendChild(this.createRequestCell(details.request, opts));
|
|
407
374
|
this.#appendStatus(element, details.isWarning);
|
|
@@ -461,25 +428,12 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
461
428
|
this.#appendStatus(element, details.isWarning);
|
|
462
429
|
this.appendSourceLocation(element, details.location, issue.model()?.getTargetIfNotDisposed());
|
|
463
430
|
break;
|
|
464
|
-
case IssuesManager.CorsIssue.IssueCode.PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_ID:
|
|
465
|
-
case IssuesManager.CorsIssue.IssueCode.PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_NAME:
|
|
466
|
-
element.appendChild(this.createRequestCell(details.request, opts));
|
|
467
|
-
this.#appendStatus(element, details.isWarning);
|
|
468
|
-
element.appendChild(this.createRequestCell(details.request, {...opts, linkToPreflight: true, highlightHeader}));
|
|
469
|
-
this.appendIssueDetailCell(element, CorsIssueDetailsView.getHeaderFromError(corsError));
|
|
470
|
-
this.appendIssueDetailCell(element, details.resourceIPAddressSpace ?? '');
|
|
471
|
-
this.appendIssueDetailCell(element, details.clientSecurityState?.initiatorIPAddressSpace ?? '');
|
|
472
|
-
this.#appendSecureContextCell(element, details.clientSecurityState?.initiatorIsSecureContext);
|
|
473
|
-
break;
|
|
474
431
|
default:
|
|
475
432
|
element.appendChild(this.createRequestCell(details.request, opts));
|
|
476
433
|
this.#appendStatus(element, details.isWarning);
|
|
477
434
|
Platform.assertUnhandled<IssuesManager.CorsIssue.IssueCode.PREFLIGHT_MISSING_ALLOW_EXTERNAL|
|
|
478
435
|
IssuesManager.CorsIssue.IssueCode.PREFLIGHT_INVALID_ALLOW_EXTERNAL|
|
|
479
436
|
IssuesManager.CorsIssue.IssueCode.INVALID_PRIVATE_NETWORK_ACCESS|
|
|
480
|
-
IssuesManager.CorsIssue.IssueCode.UNEXPECTED_PRIVATE_NETWORK_ACCESS|IssuesManager
|
|
481
|
-
.CorsIssue.IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_UNAVAILABLE|IssuesManager
|
|
482
|
-
.CorsIssue.IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_DENIED|
|
|
483
437
|
IssuesManager.CorsIssue.IssueCode.LOCAL_NETWORK_ACCESS_PERMISSION_DENIED>(issueCode);
|
|
484
438
|
break;
|
|
485
439
|
}
|
|
@@ -42,6 +42,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
42
42
|
import * as Platform from '../../core/platform/platform.js';
|
|
43
43
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
44
44
|
import * as Protocol from '../../generated/protocol.js';
|
|
45
|
+
import * as AiAssistance from '../../models/ai_assistance/ai_assistance.js';
|
|
45
46
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
46
47
|
import type * as HAR from '../../models/har/har.js';
|
|
47
48
|
import * as Logs from '../../models/logs/logs.js';
|
|
@@ -1621,7 +1622,8 @@ export class NetworkRequestNode extends NetworkNode {
|
|
|
1621
1622
|
const action = UI.ActionRegistry.ActionRegistry.instance().getAction('drjones.network-floating-button');
|
|
1622
1623
|
const aiButtonContainer = document.createElement('span');
|
|
1623
1624
|
aiButtonContainer.classList.add('ai-button-container');
|
|
1624
|
-
const
|
|
1625
|
+
const icon = AiAssistance.AiUtils.getIconName();
|
|
1626
|
+
const floatingButton = Buttons.FloatingButton.create(icon, action.title(), 'ask-ai');
|
|
1625
1627
|
floatingButton.addEventListener('click', ev => {
|
|
1626
1628
|
ev.stopPropagation();
|
|
1627
1629
|
this.select();
|
|
@@ -126,11 +126,6 @@ export class DetachedElementsProfileType extends
|
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
const animationModel = target?.model(SDK.AnimationModel.AnimationModel);
|
|
130
|
-
if (animationModel) {
|
|
131
|
-
// TODO(b/406904348): Remove this once we correctly release animations on the backend.
|
|
132
|
-
await animationModel.releaseAllAnimations();
|
|
133
|
-
}
|
|
134
129
|
const data = await domModel.getDetachedDOMNodes();
|
|
135
130
|
|
|
136
131
|
const profile: DetachedElementsProfileHeader = new DetachedElementsProfileHeader(heapProfilerModel, this, data);
|
|
@@ -283,12 +283,6 @@ export class SamplingHeapProfileTypeBase extends
|
|
|
283
283
|
UI.InspectorView.InspectorView.instance().setPanelWarnings('heap-profiler', warnings);
|
|
284
284
|
|
|
285
285
|
this.recording = true;
|
|
286
|
-
const target = heapProfilerModel.target();
|
|
287
|
-
const animationModel = target.model(SDK.AnimationModel.AnimationModel);
|
|
288
|
-
if (animationModel) {
|
|
289
|
-
// TODO(b/406904348): Remove this once we correctly release animations on the backend.
|
|
290
|
-
await animationModel.releaseAllAnimations();
|
|
291
|
-
}
|
|
292
286
|
this.startSampling();
|
|
293
287
|
}
|
|
294
288
|
|
|
@@ -1369,15 +1369,6 @@ export class HeapSnapshotProfileType extends
|
|
|
1369
1369
|
this.addProfile(profile);
|
|
1370
1370
|
profile.updateStatus(i18nString(UIStrings.snapshotting));
|
|
1371
1371
|
|
|
1372
|
-
// Release all the animations before taking a heap snapshot.
|
|
1373
|
-
// The animations are stored for replay in the animations panel and they might cause
|
|
1374
|
-
// detached nodes to appear in snapshots. Because of this, we release
|
|
1375
|
-
// all the animations first before taking a heap snapshot.
|
|
1376
|
-
const animationModel = heapProfilerModel.target().model(SDK.AnimationModel.AnimationModel);
|
|
1377
|
-
if (animationModel) {
|
|
1378
|
-
await animationModel.releaseAllAnimations();
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
1372
|
await heapProfilerModel.takeHeapSnapshot({
|
|
1382
1373
|
reportProgress: true,
|
|
1383
1374
|
captureNumericValue: true,
|
|
@@ -1541,11 +1532,6 @@ export class TrackingHeapSnapshotProfileType extends
|
|
|
1541
1532
|
return;
|
|
1542
1533
|
}
|
|
1543
1534
|
|
|
1544
|
-
const animationModel = heapProfilerModel.target().model(SDK.AnimationModel.AnimationModel);
|
|
1545
|
-
if (animationModel) {
|
|
1546
|
-
// TODO(b/406904348): Remove this once we correctly release animations on the backend.
|
|
1547
|
-
await animationModel.releaseAllAnimations();
|
|
1548
|
-
}
|
|
1549
1535
|
void heapProfilerModel.startTrackingHeapObjects(this.recordAllocationStacksSettingInternal.get());
|
|
1550
1536
|
}
|
|
1551
1537
|
|
|
@@ -483,7 +483,7 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
483
483
|
if (this.#aiAssistanceSetting) {
|
|
484
484
|
const aiAssistanceData: AiSettingParams = {
|
|
485
485
|
settingName: i18n.i18n.lockedString('AI assistance'),
|
|
486
|
-
iconName:
|
|
486
|
+
iconName: AiAssistanceModel.AiUtils.getIconName(),
|
|
487
487
|
settingDescription: this.#getAiAssistanceSettingDescription(),
|
|
488
488
|
enableSettingText: i18nString(UIStrings.enableAiAssistance),
|
|
489
489
|
settingItems: [
|
|
@@ -383,7 +383,7 @@ export class GenericSettingsTab extends UI.Widget.VBox implements SettingsTab {
|
|
|
383
383
|
|
|
384
384
|
export class ExperimentsSettingsTab extends UI.Widget.VBox implements SettingsTab {
|
|
385
385
|
#experimentsSection: Card|undefined;
|
|
386
|
-
private readonly experimentToControl = new Map<Root.Runtime.Experiment, HTMLElement>();
|
|
386
|
+
private readonly experimentToControl = new Map<Root.Runtime.Experiment|Root.Runtime.HostExperiment, HTMLElement>();
|
|
387
387
|
private readonly containerElement: HTMLElement;
|
|
388
388
|
|
|
389
389
|
constructor() {
|
|
@@ -452,12 +452,16 @@ export class ExperimentsSettingsTab extends UI.Widget.VBox implements SettingsTa
|
|
|
452
452
|
return subsection;
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
-
private createExperimentCheckbox(experiment: Root.Runtime.Experiment):
|
|
455
|
+
private createExperimentCheckbox(experiment: Root.Runtime.Experiment|Root.Runtime.HostExperiment):
|
|
456
|
+
HTMLParagraphElement {
|
|
456
457
|
const checkbox =
|
|
457
458
|
UI.UIUtils.CheckboxLabel.createWithStringLiteral(experiment.title, experiment.isEnabled(), experiment.name);
|
|
458
459
|
checkbox.classList.add('experiment-label');
|
|
459
460
|
checkbox.name = experiment.name;
|
|
460
461
|
function listener(): void {
|
|
462
|
+
if (experiment instanceof Root.Runtime.HostExperiment) {
|
|
463
|
+
Host.InspectorFrontendHost.InspectorFrontendHostInstance.setChromeFlag(experiment.aboutFlag, checkbox.checked);
|
|
464
|
+
}
|
|
461
465
|
experiment.setEnabled(checkbox.checked);
|
|
462
466
|
Host.userMetrics.experimentChanged(experiment.name, experiment.isEnabled());
|
|
463
467
|
UI.InspectorView.InspectorView.instance().displayReloadRequiredWarning(
|
|
@@ -499,7 +503,7 @@ export class ExperimentsSettingsTab extends UI.Widget.VBox implements SettingsTa
|
|
|
499
503
|
}
|
|
500
504
|
|
|
501
505
|
highlightObject(experiment: Object): void {
|
|
502
|
-
if (experiment instanceof Root.Runtime.Experiment) {
|
|
506
|
+
if (experiment instanceof Root.Runtime.Experiment || experiment instanceof Root.Runtime.HostExperiment) {
|
|
503
507
|
const element = this.experimentToControl.get(experiment);
|
|
504
508
|
if (element) {
|
|
505
509
|
PanelUtils.highlightElement(element);
|
|
@@ -534,10 +538,12 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
|
534
538
|
return false;
|
|
535
539
|
}
|
|
536
540
|
}
|
|
537
|
-
export class Revealer implements
|
|
538
|
-
|
|
541
|
+
export class Revealer implements
|
|
542
|
+
Common.Revealer.Revealer<Root.Runtime.Experiment|Root.Runtime.HostExperiment|Common.Settings.Setting<unknown>> {
|
|
543
|
+
async reveal(object: Root.Runtime.Experiment|Root.Runtime.HostExperiment|Common.Settings.Setting<unknown>):
|
|
544
|
+
Promise<void> {
|
|
539
545
|
const context = UI.Context.Context.instance();
|
|
540
|
-
if (object instanceof Root.Runtime.Experiment) {
|
|
546
|
+
if (object instanceof Root.Runtime.Experiment || object instanceof Root.Runtime.HostExperiment) {
|
|
541
547
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.bringToFront();
|
|
542
548
|
await SettingsScreen.showSettingsScreen({name: 'experiments'});
|
|
543
549
|
const experimentsSettingsTab = context.flavor(ExperimentsSettingsTab);
|
|
@@ -10,6 +10,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
10
10
|
import * as Platform from '../../core/platform/platform.js';
|
|
11
11
|
import * as Root from '../../core/root/root.js';
|
|
12
12
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
13
|
+
import * as AiAssistance from '../../models/ai_assistance/ai_assistance.js';
|
|
13
14
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
14
15
|
import * as Persistence from '../../models/persistence/persistence.js';
|
|
15
16
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
@@ -1426,7 +1427,8 @@ export class NavigatorSourceTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1426
1427
|
const action = UI.ActionRegistry.ActionRegistry.instance().getAction('drjones.sources-floating-button');
|
|
1427
1428
|
if (!this.aiButtonContainer) {
|
|
1428
1429
|
this.aiButtonContainer = this.listItemElement.createChild('span', 'ai-button-container');
|
|
1429
|
-
const
|
|
1430
|
+
const icon = AiAssistance.AiUtils.getIconName();
|
|
1431
|
+
const floatingButton = Buttons.FloatingButton.create(icon, action.title(), 'ask-ai');
|
|
1430
1432
|
floatingButton.addEventListener('click', ev => {
|
|
1431
1433
|
ev.stopPropagation();
|
|
1432
1434
|
this.navigatorView.sourceSelected(this.uiSourceCode, false);
|
|
@@ -113,6 +113,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
113
113
|
const aiLabel = 'Debug with AI';
|
|
114
114
|
const ariaLabel = `Ask AI about ${model.title} insight`;
|
|
115
115
|
const content = renderContent();
|
|
116
|
+
const iconName = AIAssistance.AiUtils.getIconName();
|
|
116
117
|
|
|
117
118
|
// clang-format off
|
|
118
119
|
return html`
|
|
@@ -123,7 +124,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
123
124
|
<div class="ask-ai-btn-wrap">
|
|
124
125
|
<devtools-button class="ask-ai"
|
|
125
126
|
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
126
|
-
.iconName=${
|
|
127
|
+
.iconName=${iconName}
|
|
127
128
|
data-insights-ask-ai
|
|
128
129
|
jslog=${VisualLogging.action(`timeline.insight-ask-ai.${internalName}`).track({click: true})}
|
|
129
130
|
@click=${onAskAIButtonClick}
|
|
@@ -40,28 +40,28 @@ export function getReleaseNote(): ReleaseNote {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
let releaseNote: ReleaseNote = {
|
|
43
|
-
version:
|
|
44
|
-
header: 'What\'s new in DevTools
|
|
43
|
+
version: 145,
|
|
44
|
+
header: 'What\'s new in DevTools 145',
|
|
45
45
|
markdownLinks: [
|
|
46
46
|
{
|
|
47
|
-
key: '
|
|
48
|
-
link: 'https://developer.chrome.com/blog/new-in-devtools-
|
|
47
|
+
key: 'soft-navigations',
|
|
48
|
+
link: 'https://developer.chrome.com/blog/new-in-devtools-145/#soft-navigations',
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
key: '
|
|
52
|
-
link: 'https://developer.chrome.com/blog/new-in-devtools-
|
|
51
|
+
key: 'render-blocking',
|
|
52
|
+
link: 'https://developer.chrome.com/blog/new-in-devtools-145/#render-blocking',
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
key: '
|
|
56
|
-
link: 'https://developer.chrome.com/blog/new-in-devtools-
|
|
55
|
+
key: 'mcp-server',
|
|
56
|
+
link: 'https://developer.chrome.com/blog/new-in-devtools-145/#mcp-server',
|
|
57
57
|
},
|
|
58
58
|
],
|
|
59
59
|
videoLinks: [
|
|
60
60
|
{
|
|
61
|
-
description: 'See past highlights from Chrome 144',
|
|
62
|
-
link: 'https://
|
|
61
|
+
description: 'See past highlights from Chrome 142-144',
|
|
62
|
+
link: 'https://www.youtube.com/watch?v=2rOeZ98AOb8' as Platform.DevToolsPath.UrlString,
|
|
63
63
|
type: VideoType.WHATS_NEW,
|
|
64
64
|
},
|
|
65
65
|
],
|
|
66
|
-
link: 'https://developer.chrome.com/blog/new-in-devtools-
|
|
66
|
+
link: 'https://developer.chrome.com/blog/new-in-devtools-145/',
|
|
67
67
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
### [
|
|
1
|
+
### [Soft navigations in performance traces](soft-navigations)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Soft navigation and soft LCP markers are now visible in performance traces for single-page applications.
|
|
4
4
|
|
|
5
|
-
### [
|
|
5
|
+
### [Identify render blocking requests](render-blocking)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Enable the Render blocking column in the Network panel to spot scripts or stylesheets that are blocking the rendering process.
|
|
8
8
|
|
|
9
|
-
### [
|
|
9
|
+
### [MCP server](mcp-server)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Simulate device viewports and user agents, work with extensions, and open pages in the background.
|
|
@@ -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:
|
|
4
|
+
Revision: bc1603560023b946da473a7b51ecabb5b091a2d4
|
|
5
5
|
Update Mechanism: Manual (https://crbug.com/428069060)
|
|
6
6
|
License: BSD-3-Clause
|
|
7
7
|
License File: LICENSE
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Name: Puppeteer Core
|
|
2
2
|
Short Name: Puppeteer Core
|
|
3
3
|
URL: https://github.com/puppeteer/puppeteer/tree/main/packages/puppeteer-core
|
|
4
|
-
Version: 24.
|
|
4
|
+
Version: 24.36.0
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
License File: LICENSE
|
|
7
|
-
Revision:
|
|
7
|
+
Revision: c5fdc0c57ddc736439ed8f20a2ccc24647a896ff
|
|
8
8
|
Security Critical: no
|
|
9
9
|
Shipped: yes
|
|
10
10
|
Update Mechanism: Autoroll
|
|
@@ -19,6 +19,11 @@ npm i puppeteer # Downloads compatible Chrome during installation.
|
|
|
19
19
|
npm i puppeteer-core # Alternatively, install as a library, without downloading Chrome.
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
## MCP
|
|
23
|
+
|
|
24
|
+
Install [`chrome-devtools-mcp`](https://github.com/ChromeDevTools/chrome-devtools-mcp),
|
|
25
|
+
a Puppeteer-based MCP server for browser automation and debugging.
|
|
26
|
+
|
|
22
27
|
## Example
|
|
23
28
|
|
|
24
29
|
```ts
|
|
@@ -69,7 +69,8 @@ export declare abstract class HTTPResponse {
|
|
|
69
69
|
* The buffer might be re-encoded by the browser
|
|
70
70
|
* based on HTTP-headers or other heuristics. If the browser
|
|
71
71
|
* failed to detect the correct encoding, the buffer might
|
|
72
|
-
* be encoded incorrectly. See
|
|
72
|
+
* be encoded incorrectly. See
|
|
73
|
+
* https://github.com/puppeteer/puppeteer/issues/6478.
|
|
73
74
|
*/
|
|
74
75
|
abstract content(): Promise<Uint8Array>;
|
|
75
76
|
/**
|
|
@@ -78,6 +79,10 @@ export declare abstract class HTTPResponse {
|
|
|
78
79
|
buffer(): Promise<Buffer>;
|
|
79
80
|
/**
|
|
80
81
|
* Promise which resolves to a text (utf8) representation of response body.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
*
|
|
85
|
+
* This method will throw if the content is not utf-8 string
|
|
81
86
|
*/
|
|
82
87
|
text(): Promise<string>;
|
|
83
88
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTTPResponse.d.ts","sourceRoot":"","sources":["../../../../src/api/HTTPResponse.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAElE,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,8BAAsB,YAAY;IAChC;;OAEG;;IAGH;;;OAGG;IACH,QAAQ,CAAC,aAAa,IAAI,aAAa;IAEvC;;OAEG;IACH,QAAQ,CAAC,GAAG,IAAI,MAAM;IAEtB;;OAEG;IACH,EAAE,IAAI,OAAO;IAMb;;OAEG;IACH,QAAQ,CAAC,MAAM,IAAI,MAAM;IAEzB;;;OAGG;IACH,QAAQ,CAAC,UAAU,IAAI,MAAM;IAE7B;;;OAGG;IACH,QAAQ,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAE1C;;;OAGG;IACH,QAAQ,CAAC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MG;IACG,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAK7B;;;;;;;OAOG;IACG,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC;IAK1B;;OAEG;IACH,QAAQ,CAAC,OAAO,IAAI,WAAW;IAE/B;;;OAGG;IACH,QAAQ,CAAC,SAAS,IAAI,OAAO;IAE7B;;OAEG;IACH,QAAQ,CAAC,iBAAiB,IAAI,OAAO;IAErC;;;OAGG;IACH,QAAQ,CAAC,KAAK,IAAI,KAAK,GAAG,IAAI;CAC/B"}
|
|
@@ -34,10 +34,14 @@ class HTTPResponse {
|
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Promise which resolves to a text (utf8) representation of response body.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
*
|
|
40
|
+
* This method will throw if the content is not utf-8 string
|
|
37
41
|
*/
|
|
38
42
|
async text() {
|
|
39
43
|
const content = await this.content();
|
|
40
|
-
return new TextDecoder().decode(content);
|
|
44
|
+
return new TextDecoder('utf-8', { fatal: true }).decode(content);
|
|
41
45
|
}
|
|
42
46
|
/**
|
|
43
47
|
* Promise which resolves to a JSON representation of response body.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTTPResponse.js","sourceRoot":"","sources":["../../../../src/api/HTTPResponse.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAiBH;;;;;GAKG;AACH,MAAsB,YAAY;IAChC;;OAEG;IACH,gBAAe,CAAC;IAahB;;OAEG;IACH,EAAE;QACA,6BAA6B;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC7B,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG,CAAC,CAAC;IAC1D,CAAC;
|
|
1
|
+
{"version":3,"file":"HTTPResponse.js","sourceRoot":"","sources":["../../../../src/api/HTTPResponse.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAiBH;;;;;GAKG;AACH,MAAsB,YAAY;IAChC;;OAEG;IACH,gBAAe,CAAC;IAahB;;OAEG;IACH,EAAE;QACA,6BAA6B;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC7B,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG,CAAC,CAAC;IAC1D,CAAC;IA2CD;;OAEG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrC,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IACD;;;;;;OAMG;IACH,KAAK,CAAC,IAAI;QACR,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrC,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI;QACR,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;CAuBF;AAxHD,oCAwHC"}
|
|
@@ -47,6 +47,9 @@ export declare class BidiPage extends Page {
|
|
|
47
47
|
readonly coverage: Coverage;
|
|
48
48
|
_client(): BidiCdpSession;
|
|
49
49
|
private constructor();
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
50
53
|
setUserAgent(userAgentOrOptions: string | {
|
|
51
54
|
userAgent?: string;
|
|
52
55
|
userAgentMetadata?: Protocol.Emulation.UserAgentMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../../src/bidi/Page.ts"],"names":[],"mappings":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I,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxD,OAAO,IAAI,KAAK;IAIV,MAAM,CACnB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAIhB,SAAS,CACtB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAyBhB,mBAAmB,CAChC,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,mBAAmB,CAAC;IAI/B,IAAa,SAAS,IAAI,kBAAkB,CAE3C;CACF;AAiED,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAC/B,2BAA2B,UAAQ,GAClC,MAAM,CA+CR;AAwBD;;;GAGG;AACH,wBAAgB,8CAA8C,CAC5D,WAAW,EAAE,WAAW,EACxB,GAAG,aAAa,EAAE,KAAK,CAAC,MAAM,WAAW,CAAC,GACzC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB;AAQD,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,cAAc,GAAG,SAAS,GACnC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAMvB;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,6CAA6C,CAC3D,YAAY,EAAE,kBAAkB,GAAG,MAAM,GAAG,SAAS,GACpD,MAAM,GAAG,SAAS,CAUpB"}
|
|
@@ -180,63 +180,35 @@ let BidiPage = (() => {
|
|
|
180
180
|
/**
|
|
181
181
|
* @internal
|
|
182
182
|
*/
|
|
183
|
-
#overrideNavigatorPropertiesPreloadScript;
|
|
184
183
|
async setUserAgent(userAgentOrOptions, userAgentMetadata) {
|
|
185
184
|
let userAgent;
|
|
186
|
-
let
|
|
185
|
+
let clientHints;
|
|
187
186
|
let platform;
|
|
188
187
|
if (typeof userAgentOrOptions === 'string') {
|
|
189
188
|
userAgent = userAgentOrOptions;
|
|
190
|
-
|
|
189
|
+
clientHints = userAgentMetadata;
|
|
191
190
|
}
|
|
192
191
|
else {
|
|
193
|
-
userAgent =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
await this.#frame.browsingContext.setUserAgent(enable ? userAgent : null);
|
|
214
|
-
const overrideNavigatorProperties = (platform) => {
|
|
215
|
-
if (platform) {
|
|
216
|
-
Object.defineProperty(navigator, 'platform', {
|
|
217
|
-
value: platform,
|
|
218
|
-
configurable: true,
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
const frames = [this.#frame];
|
|
223
|
-
for (const frame of frames) {
|
|
224
|
-
frames.push(...frame.childFrames());
|
|
225
|
-
}
|
|
226
|
-
if (this.#overrideNavigatorPropertiesPreloadScript) {
|
|
227
|
-
await this.removeScriptToEvaluateOnNewDocument(this.#overrideNavigatorPropertiesPreloadScript);
|
|
228
|
-
}
|
|
229
|
-
const [evaluateToken] = await Promise.all([
|
|
230
|
-
enable
|
|
231
|
-
? this.evaluateOnNewDocument(overrideNavigatorProperties, platform || undefined)
|
|
232
|
-
: undefined,
|
|
233
|
-
// When we disable the UserAgent we want to
|
|
234
|
-
// evaluate the original value in all Browsing Contexts
|
|
235
|
-
...frames.map(frame => {
|
|
236
|
-
return frame.evaluate(overrideNavigatorProperties, platform || undefined);
|
|
237
|
-
}),
|
|
238
|
-
]);
|
|
239
|
-
this.#overrideNavigatorPropertiesPreloadScript = evaluateToken?.identifier;
|
|
192
|
+
userAgent = userAgentOrOptions.userAgent ?? null;
|
|
193
|
+
clientHints = userAgentOrOptions.userAgentMetadata;
|
|
194
|
+
// Empty string platform should be interpreted as "no override".
|
|
195
|
+
platform =
|
|
196
|
+
userAgentOrOptions.platform === ''
|
|
197
|
+
? undefined
|
|
198
|
+
: userAgentOrOptions.platform;
|
|
199
|
+
}
|
|
200
|
+
if (userAgent === '') {
|
|
201
|
+
// In WebDriver BiDi null is used to restore the original user agent.
|
|
202
|
+
userAgent = null;
|
|
203
|
+
}
|
|
204
|
+
await this.#frame.browsingContext.setUserAgent(userAgent);
|
|
205
|
+
if (platform && platform !== '') {
|
|
206
|
+
// Work-around until https://github.com/w3c/webdriver-bidi/issues/1065 is resolved.
|
|
207
|
+
// Set platform via client hints override.
|
|
208
|
+
clientHints = clientHints ?? {};
|
|
209
|
+
clientHints.platform = platform;
|
|
210
|
+
}
|
|
211
|
+
await this.#frame.browsingContext.setClientHintsOverride(clientHints ?? null);
|
|
240
212
|
}
|
|
241
213
|
async setBypassCSP(enabled) {
|
|
242
214
|
// TODO: handle CDP-specific cases such as MPArch.
|
|
@@ -400,6 +372,7 @@ let BidiPage = (() => {
|
|
|
400
372
|
return await this.#cdpEmulationManager.emulateVisionDeficiency(type);
|
|
401
373
|
}
|
|
402
374
|
async setViewport(viewport) {
|
|
375
|
+
let needsReload = false;
|
|
403
376
|
if (!this.browser().cdpSupported) {
|
|
404
377
|
const viewportSize = viewport?.width && viewport?.height
|
|
405
378
|
? {
|
|
@@ -422,17 +395,38 @@ let BidiPage = (() => {
|
|
|
422
395
|
type: 'portrait-primary',
|
|
423
396
|
}
|
|
424
397
|
: null;
|
|
425
|
-
|
|
398
|
+
const commands = [
|
|
426
399
|
this.#frame.browsingContext.setViewport({
|
|
427
400
|
viewport: viewportSize,
|
|
428
401
|
devicePixelRatio,
|
|
429
402
|
}),
|
|
430
403
|
this.#frame.browsingContext.setScreenOrientationOverride(screenOrientation),
|
|
431
|
-
]
|
|
432
|
-
this.#viewport
|
|
433
|
-
|
|
404
|
+
];
|
|
405
|
+
if ((this.#viewport?.hasTouch ?? false) !== (viewport?.hasTouch ?? false)) {
|
|
406
|
+
// The requested touch override state is different from the current one, meaning
|
|
407
|
+
// the reload is needed.
|
|
408
|
+
needsReload = true;
|
|
409
|
+
// 1 touch point if touch is enabled, null otherwise.
|
|
410
|
+
const maxTouchPoints = viewport?.hasTouch ? 1 : null;
|
|
411
|
+
commands.push(this.#frame.browsingContext
|
|
412
|
+
.setTouchOverride(maxTouchPoints)
|
|
413
|
+
.catch(error => {
|
|
414
|
+
if (error instanceof Errors_js_1.ProtocolError &&
|
|
415
|
+
(error.message.includes('unknown command') ||
|
|
416
|
+
error.message.includes('unsupported operation'))) {
|
|
417
|
+
// Tolerate not implemented or not supported commands. At least until
|
|
418
|
+
// the `emulation.setTouchOverride` is supported by all the supported
|
|
419
|
+
// browsers.
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
throw error;
|
|
423
|
+
}));
|
|
424
|
+
}
|
|
425
|
+
await Promise.all(commands);
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
needsReload = await this.#cdpEmulationManager.emulateViewport(viewport);
|
|
434
429
|
}
|
|
435
|
-
const needsReload = await this.#cdpEmulationManager.emulateViewport(viewport);
|
|
436
430
|
this.#viewport = viewport;
|
|
437
431
|
if (needsReload) {
|
|
438
432
|
await this.reload();
|
|
@@ -915,6 +909,10 @@ function cdpSpecificCookiePropertiesFromBidiToPuppeteer(bidiCookie, ...propertyN
|
|
|
915
909
|
result[property] = bidiCookie[CDP_SPECIFIC_PREFIX + property];
|
|
916
910
|
}
|
|
917
911
|
}
|
|
912
|
+
// TODO: remove once deprecated sameParty attribute is dropped.
|
|
913
|
+
if (!result.sameParty) {
|
|
914
|
+
result.sameParty = false;
|
|
915
|
+
}
|
|
918
916
|
return result;
|
|
919
917
|
}
|
|
920
918
|
/**
|