chrome-devtools-frontend 1.0.1641723 → 1.0.1642845

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.
@@ -1068,6 +1068,17 @@ export abstract class HeapSnapshot {
1068
1068
  this.#progress.updateStatus('Finished processing.');
1069
1069
  }
1070
1070
 
1071
+ nodeIndexForId(nodeId: number): number|undefined {
1072
+ const nodesLength = this.nodes.length;
1073
+ const {nodes, nodeFieldCount, nodeIdOffset} = this;
1074
+ for (let nodeIndex = 0; nodeIndex < nodesLength; nodeIndex += nodeFieldCount) {
1075
+ if (nodes.getValue(nodeIndex + nodeIdOffset) === nodeId) {
1076
+ return nodeIndex;
1077
+ }
1078
+ }
1079
+ return undefined;
1080
+ }
1081
+
1071
1082
  private startInitStep1InSecondThread(secondWorker: PlatformApi.HostRuntime.WorkerMessagePort):
1072
1083
  Promise<ResultsFromSecondWorker> {
1073
1084
  const resultsFromSecondWorker = new Promise<ResultsFromSecondWorker>((resolve, reject) => {
@@ -274,6 +274,14 @@ export const UIStrings = {
274
274
  * @description This warning occurs when the deprecated `BluetoothRemoteGATTCharacteristic.writeValue()` method is used. Developers should use `writeValueWithResponse()` or `writeValueWithoutResponse()` instead.
275
275
  */
276
276
  WebBluetoothRemoteCharacteristicWriteValue: "`BluetoothRemoteGATTCharacteristic.writeValue()` is deprecated. Use `writeValueWithResponse()` or `writeValueWithoutResponse()` instead.",
277
+ /**
278
+ * @description Warning for using the deprecated 'incomingHighWaterMark' attribute on WebTransportDatagramDuplexStream. Developers should use 'incomingMaxBufferedDatagrams' instead.
279
+ */
280
+ WebTransportDatagramDuplexStreamIncomingHighWaterMark: "WebTransportDatagramDuplexStream.incomingHighWaterMark has been renamed to incomingMaxBufferedDatagrams. incomingHighWaterMark will be removed in a future version of Chrome.",
281
+ /**
282
+ * @description Warning for using the deprecated 'outgoingHighWaterMark' attribute on WebTransportDatagramDuplexStream. Developers should use 'outgoingMaxBufferedDatagrams' instead.
283
+ */
284
+ WebTransportDatagramDuplexStreamOutgoingHighWaterMark: "WebTransportDatagramDuplexStream.outgoingHighWaterMark has been renamed to outgoingMaxBufferedDatagrams. outgoingHighWaterMark will be removed in a future version of Chrome.",
277
285
  /**
278
286
  * @description Warning displayed to developers that they are using `XMLHttpRequest` API in a way that they expect an unsupported character encoding `UTF-16` could be used in the server reply.
279
287
  */
@@ -439,6 +447,14 @@ export const DEPRECATIONS_METADATA: Partial<Record<string, DeprecationDescriptor
439
447
  "WebBluetoothRemoteCharacteristicWriteValue": {
440
448
  "chromeStatusFeature": 5088568590598144
441
449
  },
450
+ "WebTransportDatagramDuplexStreamIncomingHighWaterMark": {
451
+ "chromeStatusFeature": 5143839699501056,
452
+ "milestone": 156
453
+ },
454
+ "WebTransportDatagramDuplexStreamOutgoingHighWaterMark": {
455
+ "chromeStatusFeature": 5143839699501056,
456
+ "milestone": 156
457
+ },
442
458
  "XHRJSONEncodingDetection": {
443
459
  "milestone": 93
444
460
  },
@@ -1038,7 +1038,7 @@ inspectorBackend.registerEnum("Page.AdFrameExplanation", {ParentIsAd: "ParentIsA
1038
1038
  inspectorBackend.registerEnum("Page.SecureContextType", {Secure: "Secure", SecureLocalhost: "SecureLocalhost", InsecureScheme: "InsecureScheme", InsecureAncestor: "InsecureAncestor"});
1039
1039
  inspectorBackend.registerEnum("Page.CrossOriginIsolatedContextType", {Isolated: "Isolated", NotIsolated: "NotIsolated", NotIsolatedFeatureDisabled: "NotIsolatedFeatureDisabled"});
1040
1040
  inspectorBackend.registerEnum("Page.GatedAPIFeatures", {SharedArrayBuffers: "SharedArrayBuffers", SharedArrayBuffersTransferAllowed: "SharedArrayBuffersTransferAllowed", PerformanceMeasureMemory: "PerformanceMeasureMemory", PerformanceProfile: "PerformanceProfile"});
1041
- inspectorBackend.registerEnum("Page.PermissionsPolicyFeature", {Accelerometer: "accelerometer", AllScreensCapture: "all-screens-capture", AmbientLightSensor: "ambient-light-sensor", AriaNotify: "aria-notify", AttributionReporting: "attribution-reporting", Autofill: "autofill", Autoplay: "autoplay", Bluetooth: "bluetooth", BrowsingTopics: "browsing-topics", Camera: "camera", CapturedSurfaceControl: "captured-surface-control", ChDpr: "ch-dpr", ChDeviceMemory: "ch-device-memory", ChDownlink: "ch-downlink", ChEct: "ch-ect", ChPrefersColorScheme: "ch-prefers-color-scheme", ChPrefersReducedMotion: "ch-prefers-reduced-motion", ChPrefersReducedTransparency: "ch-prefers-reduced-transparency", ChRtt: "ch-rtt", ChSaveData: "ch-save-data", ChUa: "ch-ua", ChUaArch: "ch-ua-arch", ChUaBitness: "ch-ua-bitness", ChUaHighEntropyValues: "ch-ua-high-entropy-values", ChUaPlatform: "ch-ua-platform", ChUaModel: "ch-ua-model", ChUaMobile: "ch-ua-mobile", ChUaFormFactors: "ch-ua-form-factors", ChUaFullVersion: "ch-ua-full-version", ChUaFullVersionList: "ch-ua-full-version-list", ChUaPlatformVersion: "ch-ua-platform-version", ChUaWow64: "ch-ua-wow64", ChViewportHeight: "ch-viewport-height", ChViewportWidth: "ch-viewport-width", ChWidth: "ch-width", ClipboardRead: "clipboard-read", ClipboardWrite: "clipboard-write", ComputePressure: "compute-pressure", ControlledFrame: "controlled-frame", CrossOriginIsolated: "cross-origin-isolated", DeferredFetch: "deferred-fetch", DeferredFetchMinimal: "deferred-fetch-minimal", DeviceAttributes: "device-attributes", DigitalCredentialsCreate: "digital-credentials-create", DigitalCredentialsGet: "digital-credentials-get", DirectSockets: "direct-sockets", DirectSocketsMulticast: "direct-sockets-multicast", DirectSocketsPrivate: "direct-sockets-private", DisplayCapture: "display-capture", DocumentDomain: "document-domain", EncryptedMedia: "encrypted-media", ExecutionWhileOutOfViewport: "execution-while-out-of-viewport", ExecutionWhileNotRendered: "execution-while-not-rendered", FocusWithoutUserActivation: "focus-without-user-activation", Fullscreen: "fullscreen", Frobulate: "frobulate", Gamepad: "gamepad", Geolocation: "geolocation", Gyroscope: "gyroscope", Hid: "hid", IdentityCredentialsGet: "identity-credentials-get", IdleDetection: "idle-detection", InterestCohort: "interest-cohort", JoinAdInterestGroup: "join-ad-interest-group", KeyboardMap: "keyboard-map", LanguageDetector: "language-detector", LanguageModel: "language-model", LocalFonts: "local-fonts", LocalNetwork: "local-network", LocalNetworkAccess: "local-network-access", LoopbackNetwork: "loopback-network", Magnetometer: "magnetometer", ManualText: "manual-text", MediaPlaybackWhileNotVisible: "media-playback-while-not-visible", Microphone: "microphone", Midi: "midi", OnDeviceSpeechRecognition: "on-device-speech-recognition", OtpCredentials: "otp-credentials", Payment: "payment", PictureInPicture: "picture-in-picture", PrivateAggregation: "private-aggregation", PrivateStateTokenIssuance: "private-state-token-issuance", PrivateStateTokenRedemption: "private-state-token-redemption", PublickeyCredentialsCreate: "publickey-credentials-create", PublickeyCredentialsGet: "publickey-credentials-get", RecordAdAuctionEvents: "record-ad-auction-events", Rewriter: "rewriter", RunAdAuction: "run-ad-auction", ScreenWakeLock: "screen-wake-lock", Serial: "serial", SharedStorage: "shared-storage", SharedStorageSelectUrl: "shared-storage-select-url", SmartCard: "smart-card", SpeakerSelection: "speaker-selection", StorageAccess: "storage-access", SubApps: "sub-apps", Summarizer: "summarizer", SyncXhr: "sync-xhr", Tools: "tools", Translator: "translator", Unload: "unload", Usb: "usb", UsbUnrestricted: "usb-unrestricted", VerticalScroll: "vertical-scroll", WebAppInstallation: "web-app-installation", WebPrinting: "web-printing", WebShare: "web-share", WindowManagement: "window-management", Writer: "writer", XrSpatialTracking: "xr-spatial-tracking"});
1041
+ inspectorBackend.registerEnum("Page.PermissionsPolicyFeature", {Accelerometer: "accelerometer", AllScreensCapture: "all-screens-capture", AmbientLightSensor: "ambient-light-sensor", AriaNotify: "aria-notify", AttributionReporting: "attribution-reporting", Autofill: "autofill", Autoplay: "autoplay", Bluetooth: "bluetooth", BrowsingTopics: "browsing-topics", Camera: "camera", CapturedSurfaceControl: "captured-surface-control", ChDpr: "ch-dpr", ChDeviceMemory: "ch-device-memory", ChDownlink: "ch-downlink", ChEct: "ch-ect", ChPrefersColorScheme: "ch-prefers-color-scheme", ChPrefersReducedMotion: "ch-prefers-reduced-motion", ChPrefersReducedTransparency: "ch-prefers-reduced-transparency", ChRtt: "ch-rtt", ChSaveData: "ch-save-data", ChUa: "ch-ua", ChUaArch: "ch-ua-arch", ChUaBitness: "ch-ua-bitness", ChUaHighEntropyValues: "ch-ua-high-entropy-values", ChUaPlatform: "ch-ua-platform", ChUaModel: "ch-ua-model", ChUaMobile: "ch-ua-mobile", ChUaFormFactors: "ch-ua-form-factors", ChUaFullVersion: "ch-ua-full-version", ChUaFullVersionList: "ch-ua-full-version-list", ChUaPlatformVersion: "ch-ua-platform-version", ChUaWow64: "ch-ua-wow64", ChViewportHeight: "ch-viewport-height", ChViewportWidth: "ch-viewport-width", ChWidth: "ch-width", ClipboardRead: "clipboard-read", ClipboardWrite: "clipboard-write", ComputePressure: "compute-pressure", ControlledFrame: "controlled-frame", CrossOriginIsolated: "cross-origin-isolated", DeferredFetch: "deferred-fetch", DeferredFetchMinimal: "deferred-fetch-minimal", DeviceAttributes: "device-attributes", DigitalCredentialsCreate: "digital-credentials-create", DigitalCredentialsGet: "digital-credentials-get", DirectSockets: "direct-sockets", DirectSocketsMulticast: "direct-sockets-multicast", DirectSocketsPrivate: "direct-sockets-private", DisplayCapture: "display-capture", DocumentDomain: "document-domain", EncryptedMedia: "encrypted-media", ExecutionWhileOutOfViewport: "execution-while-out-of-viewport", ExecutionWhileNotRendered: "execution-while-not-rendered", FocusWithoutUserActivation: "focus-without-user-activation", Fullscreen: "fullscreen", Frobulate: "frobulate", Gamepad: "gamepad", Geolocation: "geolocation", Gyroscope: "gyroscope", Hid: "hid", IdentityCredentialsGet: "identity-credentials-get", IdleDetection: "idle-detection", InterestCohort: "interest-cohort", JoinAdInterestGroup: "join-ad-interest-group", KeyboardMap: "keyboard-map", LanguageDetector: "language-detector", LanguageModel: "language-model", LocalFonts: "local-fonts", LocalNetwork: "local-network", LocalNetworkAccess: "local-network-access", LoopbackNetwork: "loopback-network", Magnetometer: "magnetometer", ManualText: "manual-text", MediaPlaybackWhileNotVisible: "media-playback-while-not-visible", Microphone: "microphone", Midi: "midi", OnDeviceSpeechRecognition: "on-device-speech-recognition", OtpCredentials: "otp-credentials", Payment: "payment", PictureInPicture: "picture-in-picture", PrivateAggregation: "private-aggregation", PrivateStateTokenIssuance: "private-state-token-issuance", PrivateStateTokenRedemption: "private-state-token-redemption", PublickeyCredentialsCreate: "publickey-credentials-create", PublickeyCredentialsGet: "publickey-credentials-get", RecordAdAuctionEvents: "record-ad-auction-events", Rewriter: "rewriter", RunAdAuction: "run-ad-auction", ScreenWakeLock: "screen-wake-lock", Serial: "serial", SharedStorage: "shared-storage", SharedStorageSelectUrl: "shared-storage-select-url", SmartCard: "smart-card", SpeakerSelection: "speaker-selection", StorageAccess: "storage-access", SubApps: "sub-apps", Summarizer: "summarizer", SyncXhr: "sync-xhr", Tools: "tools", Translator: "translator", Unload: "unload", Usb: "usb", UsbUnrestricted: "usb-unrestricted", VerticalScroll: "vertical-scroll", WebAppInstallation: "web-app-installation", Webnn: "webnn", WebPrinting: "web-printing", WebShare: "web-share", WindowManagement: "window-management", Writer: "writer", XrSpatialTracking: "xr-spatial-tracking"});
1042
1042
  inspectorBackend.registerEnum("Page.PermissionsPolicyBlockReason", {Header: "Header", IframeAttribute: "IframeAttribute", InFencedFrameTree: "InFencedFrameTree", InIsolatedApp: "InIsolatedApp"});
1043
1043
  inspectorBackend.registerEnum("Page.OriginTrialTokenStatus", {Success: "Success", NotSupported: "NotSupported", Insecure: "Insecure", Expired: "Expired", WrongOrigin: "WrongOrigin", InvalidSignature: "InvalidSignature", Malformed: "Malformed", WrongVersion: "WrongVersion", FeatureDisabled: "FeatureDisabled", TokenDisabled: "TokenDisabled", FeatureDisabledForUser: "FeatureDisabledForUser", UnknownTrial: "UnknownTrial"});
1044
1044
  inspectorBackend.registerEnum("Page.OriginTrialStatus", {Enabled: "Enabled", ValidTokenNotProvided: "ValidTokenNotProvided", OSNotSupported: "OSNotSupported", TrialNotAllowed: "TrialNotAllowed"});
@@ -14655,6 +14655,7 @@ export namespace Page {
14655
14655
  UsbUnrestricted = 'usb-unrestricted',
14656
14656
  VerticalScroll = 'vertical-scroll',
14657
14657
  WebAppInstallation = 'web-app-installation',
14658
+ Webnn = 'webnn',
14658
14659
  WebPrinting = 'web-printing',
14659
14660
  WebShare = 'web-share',
14660
14661
  WindowManagement = 'window-management',
@@ -161,10 +161,6 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
161
161
  };
162
162
  }
163
163
 
164
- override preambleFeatures(): string[] {
165
- return ['function_calling'];
166
- }
167
-
168
164
  protected override async preRun(): Promise<void> {
169
165
  this.#currentTurnId++;
170
166
  const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
@@ -530,10 +530,6 @@ export abstract class AiAgent<T> {
530
530
  return undefined;
531
531
  }
532
532
 
533
- preambleFeatures(): string[] {
534
- return [];
535
- }
536
-
537
533
  buildRequest(
538
534
  part: Host.AidaClient.Part|Host.AidaClient.Part[],
539
535
  role: Host.AidaClient.Role.USER|Host.AidaClient.Role.ROLE_UNSPECIFIED): Host.AidaClient.DoConversationRequest {
@@ -577,8 +573,7 @@ export abstract class AiAgent<T> {
577
573
  disable_user_content_logging: !(this.#serverSideLoggingEnabled ?? false),
578
574
  string_session_id: this.#sessionId,
579
575
  user_tier: userTier,
580
- client_version:
581
- Root.Runtime.getChromeVersion() + this.preambleFeatures().map(feature => `+${feature}`).join(''),
576
+ client_version: Root.Runtime.getChromeVersion(),
582
577
  },
583
578
 
584
579
  functionality_type: enableAidaFunctionCalling ? Host.AidaClient.FunctionalityType.AGENTIC_CHAT :
@@ -154,7 +154,7 @@ Content:
154
154
  "disable_user_content_logging": false,
155
155
  "string_session_id": "sessionId",
156
156
  "user_tier": 3,
157
- "client_version": "unit_test+function_calling"
157
+ "client_version": "unit_test"
158
158
  },
159
159
  "functionality_type": 5,
160
160
  "client_feature": 2
@@ -254,10 +254,6 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
254
254
  return Boolean(Root.Runtime.hostConfig.devToolsFreestyler?.multimodal);
255
255
  }
256
256
 
257
- override preambleFeatures(): string[] {
258
- return ['function_calling'];
259
- }
260
-
261
257
  #execJs: typeof executeJsCode;
262
258
  #javascriptExecutor: JavascriptExecutor;
263
259
 
@@ -2,6 +2,8 @@
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
 
5
+ import * as Common from '../../../core/common/common.js';
6
+ import type * as Platform from '../../../core/platform/platform.js';
5
7
  import type * as SDK from '../../../core/sdk/sdk.js';
6
8
  import * as Protocol from '../../../generated/protocol.js';
7
9
  import * as Annotations from '../../annotations/annotations.js';
@@ -68,17 +70,16 @@ export class NetworkRequestFormatter {
68
70
  return `${title}\n<binary data>`;
69
71
  }
70
72
 
71
- static formatInitiatorUrl(initiatorUrl: string, allowedOrigin: string): string {
72
- try {
73
- // Some scheme or URLs might cause errors depending on the runtime environment.
74
- const initiatorOrigin = new URL(initiatorUrl).origin;
75
- if (initiatorOrigin === allowedOrigin) {
76
- return initiatorUrl;
77
- }
78
- return '<redacted cross-origin initiator URL>';
79
- } catch {
80
- return '<redacted cross-origin initiator URL>';
73
+ static formatInitiatorUrl(
74
+ initiatorUrl: Platform.DevToolsPath.UrlString,
75
+ allowedOrigin: Platform.DevToolsPath.UrlString,
76
+ ): string {
77
+ // We extract the origin, and if it is invalid/empty we default to redacting.
78
+ const initiatorOrigin = Common.ParsedURL.ParsedURL.extractOrigin(initiatorUrl);
79
+ if (initiatorOrigin && initiatorOrigin === allowedOrigin) {
80
+ return initiatorUrl;
81
81
  }
82
+ return '<redacted cross-origin initiator URL>';
82
83
  }
83
84
 
84
85
  static formatStatus(status: {
@@ -196,7 +197,7 @@ Request initiator chain:\n${this.formatRequestInitiatorChain()}`;
196
197
  * the request's origin.
197
198
  */
198
199
  formatRequestInitiatorChain(): string {
199
- const allowedOrigin = new URL(this.#request.url()).origin;
200
+ const allowedOrigin = Common.ParsedURL.ParsedURL.extractOrigin(this.#request.url());
200
201
  let initiatorChain = '';
201
202
  let lineStart = '- URL: ';
202
203
  const graph = Logs.NetworkLog.NetworkLog.instance().initiatorGraphForRequest(this.#request);
@@ -268,7 +269,7 @@ Request initiator chain:\n${this.formatRequestInitiatorChain()}`;
268
269
  parentRequest: SDK.NetworkRequest.NetworkRequest,
269
270
  initiatorChain: string,
270
271
  lineStart: string,
271
- allowedOrigin: string,
272
+ allowedOrigin: Platform.DevToolsPath.UrlString,
272
273
  ): string {
273
274
  const visited = new Set<SDK.NetworkRequest.NetworkRequest>();
274
275
 
@@ -289,6 +289,10 @@ export class HeapSnapshotProxy extends HeapSnapshotProxyObject {
289
289
  return this.callMethodPromise('nodeClassKey', snapshotObjectId);
290
290
  }
291
291
 
292
+ nodeIndexForId(nodeId: number): Promise<number|undefined> {
293
+ return this.callMethodPromise('nodeIndexForId', nodeId);
294
+ }
295
+
292
296
  createEdgesProvider(nodeIndex: number): HeapSnapshotProviderProxy {
293
297
  return this.callFactoryMethod('createEdgesProvider', HeapSnapshotProviderProxy, nodeIndex);
294
298
  }
@@ -6489,6 +6489,22 @@ export const NativeFunctions = [
6489
6489
  name: "XRLayerEvent",
6490
6490
  signatures: [["type","eventInitDict"]]
6491
6491
  },
6492
+ {
6493
+ name: "XRMediaBinding",
6494
+ signatures: [["session"]]
6495
+ },
6496
+ {
6497
+ name: "createQuadLayer",
6498
+ signatures: [["video","init"]]
6499
+ },
6500
+ {
6501
+ name: "createCylinderLayer",
6502
+ signatures: [["video","init"]]
6503
+ },
6504
+ {
6505
+ name: "createEquirectLayer",
6506
+ signatures: [["video","init"]]
6507
+ },
6492
6508
  {
6493
6509
  name: "XRRay",
6494
6510
  signatures: [["transform"],["?origin","?direction"]]
@@ -3,15 +3,108 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Bindings from '../../models/bindings/bindings.js';
6
+ import type * as StackTrace from '../../models/stack_trace/stack_trace.js';
6
7
  import type * as Workspace from '../../models/workspace/workspace.js';
8
+ import * as Components from '../../ui/legacy/components/utils/utils.js';
7
9
  import * as UI from '../../ui/legacy/legacy.js';
10
+ import * as Lit from '../../ui/lit/lit.js';
11
+
12
+ const {html, render} = Lit;
8
13
 
9
14
  export interface ViewInput {
10
15
  error: Bindings.SymbolizedError.SymbolizedError;
11
16
  ignoreListManager?: Workspace.IgnoreListManager.IgnoreListManager;
12
17
  }
13
18
 
14
- const DEFAULT_VIEW = (_input: ViewInput, _output: object, _target: HTMLElement): void => {};
19
+ function renderHeader(content: Lit.LitTemplate|Node|UI.Widget.Widget, isCause: boolean): Lit.LitTemplate {
20
+ if (isCause) {
21
+ return html`<div class="symbolized-error-header"><span>Caused by: </span><span class="error-message-text">${
22
+ content}</span></div>`;
23
+ }
24
+ return html`<span class="error-message-text">${content}</span>`;
25
+ }
26
+
27
+ function renderFramePrefix(
28
+ frame: StackTrace.StackTrace.ParsedErrorStackFrame,
29
+ _options: Components.Linkifier.LinkifyOptions): Lit.LitTemplate {
30
+ const asyncPrefix = frame.isAsync ? 'async ' : '';
31
+ if (frame.promiseIndex !== undefined) {
32
+ const name = frame.name || 'Promise.all';
33
+ return html`${asyncPrefix}${name} (index ${frame.promiseIndex})`;
34
+ }
35
+ const constructorPrefix = frame.isConstructor ? 'new ' : '';
36
+ let name = frame.name || '';
37
+ const isInline = Boolean(frame.rawName) && frame.name !== frame.rawName;
38
+ if (!isInline && frame.methodName && name && name !== frame.methodName && !name.endsWith('.' + frame.methodName) &&
39
+ !name.endsWith(' ' + frame.methodName)) {
40
+ name += ` [as ${frame.methodName}]`;
41
+ }
42
+
43
+ if (name) {
44
+ return html`${asyncPrefix}${constructorPrefix}${name} (`;
45
+ }
46
+ return html`${asyncPrefix}${constructorPrefix}`;
47
+ }
48
+
49
+ function renderFrameSuffix(frame: StackTrace.StackTrace.ParsedErrorStackFrame): Lit.LitTemplate {
50
+ if (frame.promiseIndex !== undefined) {
51
+ return Lit.nothing;
52
+ }
53
+ if (frame.name) {
54
+ return html`)`;
55
+ }
56
+ return Lit.nothing;
57
+ }
58
+
59
+ const DEFAULT_VIEW = (input: ViewInput, _output: object, target: HTMLElement): void => {
60
+ const renderError = (error: Bindings.SymbolizedError.SymbolizedError, isCause: boolean): Lit.LitTemplate => {
61
+ if (!(error instanceof Bindings.SymbolizedError.SymbolizedErrorObject)) {
62
+ console.error('SymbolizedErrorWidget received an unsupported error type:', error);
63
+ return Lit.nothing;
64
+ }
65
+ const linkOptions: Components.Linkifier.LinkifyOptions = {
66
+ showColumnNumber: true,
67
+ inlineFrameIndex: 0,
68
+ maxLength: UI.UIUtils.MaxLengthForDisplayedURLsInConsole,
69
+ ignoreListManager: input.ignoreListManager,
70
+ };
71
+ const headerContent = html`${error.message}`;
72
+ const header = renderHeader(headerContent, isCause);
73
+ const syncFrames = error.stackTrace.syncFragment.frames;
74
+ // clang-format off
75
+ return html`
76
+ <span class=${isCause ? 'console-message-stack-trace-wrapper' : ''}
77
+ >${header}${syncFrames.length > 0 ? '\n' : ''}${syncFrames.map((frame: StackTrace.StackTrace.ParsedErrorStackFrame, i: number) => {
78
+ let linkElement: HTMLElement|Lit.LitTemplate = Lit.nothing;
79
+ let isBuiltin = false;
80
+ if (frame.promiseIndex !== undefined) {
81
+ // Promise.all doesn't have a linkable location.
82
+ isBuiltin = true;
83
+ } else if (frame.url || frame.uiSourceCode) {
84
+ const link = Components.Linkifier.Linkifier.linkifyStackTraceFrame(frame, linkOptions);
85
+ link.tabIndex = -1;
86
+ linkElement = link;
87
+ } else {
88
+ linkElement = html`<span>&lt;anonymous&gt;</span>`;
89
+ isBuiltin = true;
90
+ }
91
+
92
+ const newline = i < error.stackTrace.syncFragment.frames.length - 1 ? '\n' : '';
93
+ const frameClass = isBuiltin ? 'formatted-builtin-stack-frame' : 'formatted-stack-frame';
94
+ return html`
95
+ <span class=${frameClass}>${' at '}${renderFramePrefix(frame, linkOptions)}${linkElement}${renderFrameSuffix(frame)}${newline}</span>
96
+ `;
97
+ })}
98
+ </span>
99
+ ${error.cause ? renderError(error.cause, true) : Lit.nothing}
100
+ `;
101
+ // clang-format on
102
+ };
103
+
104
+ // clang-format off
105
+ render(html`<span class="symbolized-error-widget">${renderError(input.error, false)}</span>`, target);
106
+ // clang-format on
107
+ };
15
108
 
16
109
  export class SymbolizedErrorWidget extends UI.Widget.Widget {
17
110
  #error?: Bindings.SymbolizedError.SymbolizedError;
@@ -19,7 +112,8 @@ export class SymbolizedErrorWidget extends UI.Widget.Widget {
19
112
  #ignoreListManager?: Workspace.IgnoreListManager.IgnoreListManager;
20
113
 
21
114
  constructor(element?: HTMLElement, view: typeof DEFAULT_VIEW = DEFAULT_VIEW) {
22
- super(element);
115
+ const host = element || document.createElement('span');
116
+ super(host, {classes: ['symbolized-error-widget-host']});
23
117
  this.#view = view;
24
118
  }
25
119
 
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Copyright 2026 The Chromium Authors
3
+ * Use of this source code is governed by a BSD-style license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ .symbolized-error-widget {
8
+ white-space: pre-wrap;
9
+ word-break: break-all;
10
+
11
+ --display-formatted-stack-frame-default: block;
12
+ --display-ignored-formatted-stack-frame-local: var(--display-ignored-formatted-stack-frame, none);
13
+
14
+ &.show-hidden-rows {
15
+ --display-ignored-formatted-stack-frame-local: var(--display-formatted-stack-frame-default);
16
+ }
17
+ }
18
+
19
+ .symbolized-error-widget .formatted-stack-frame {
20
+ display: var(--display-formatted-stack-frame-default);
21
+
22
+ &:has(.ignore-list-link) {
23
+ display: var(--display-ignored-formatted-stack-frame-local);
24
+ opacity: 60%;
25
+
26
+ /* Subsequent builtin stack frames are also treated as ignored */
27
+ & + .formatted-builtin-stack-frame {
28
+ display: var(--display-ignored-formatted-stack-frame-local);
29
+ opacity: 60%;
30
+ }
31
+ }
32
+ }
33
+
34
+ .symbolized-error-widget .formatted-builtin-stack-frame {
35
+ display: var(--display-formatted-stack-frame-default);
36
+ }
37
+
38
+ .symbolized-error-widget-host {
39
+ display: inline;
40
+ }
41
+
42
+ .symbolized-error-header {
43
+ display: block;
44
+ }
45
+
46
+ .error-message-text {
47
+ display: inline;
48
+ }
@@ -1,7 +1,7 @@
1
1
  Name: Dependencies sourced from the upstream `chromium` repository
2
2
  URL: Internal
3
3
  Version: N/A
4
- Revision: 8a5961c5c41c55be7d3959808cd39654ffc76581
4
+ Revision: 2d046db188ecad76b2859f8baeb9685cb8fe9c08
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE
@@ -80,6 +80,12 @@ export async function addDocument(document: Document): Promise<void> {
80
80
  }
81
81
  document.addEventListener('visibilitychange', scheduleProcessing);
82
82
  document.addEventListener('scroll', scheduleProcessing);
83
+ const resizeListener = (): void => {
84
+ viewportRects.delete(document);
85
+ scheduleProcessing();
86
+ };
87
+ document.defaultView?.addEventListener('resize', resizeListener);
88
+ resizeListeners.set(document, resizeListener);
83
89
  observeMutations([document.body]);
84
90
  }
85
91
 
@@ -90,12 +96,18 @@ export async function stopLogging(): Promise<void> {
90
96
  for (const document of documents) {
91
97
  document.removeEventListener('visibilitychange', scheduleProcessing);
92
98
  document.removeEventListener('scroll', scheduleProcessing);
99
+ const resizeListener = resizeListeners.get(document);
100
+ if (resizeListener) {
101
+ document.defaultView?.removeEventListener('resize', resizeListener);
102
+ resizeListeners.delete(document);
103
+ }
93
104
  }
94
105
  mutationObserver.disconnect();
95
106
  resizeObserver.disconnect();
96
107
  intersectionObserver.disconnect();
97
108
  documents.length = 0;
98
109
  viewportRects.clear();
110
+ resizeListeners.clear();
99
111
  processingThrottler = noOpThrottler;
100
112
  pendingResize.clear();
101
113
  pendingChange.clear();
@@ -130,6 +142,7 @@ export function scheduleProcessing(): void {
130
142
  }
131
143
 
132
144
  const viewportRects = new Map<Document, DOMRect>();
145
+ const resizeListeners = new Map<Document, () => void>();
133
146
  const viewportRectFor = (element: Element): DOMRect => {
134
147
  const ownerDocument = element.ownerDocument;
135
148
  const viewportRect = viewportRects.get(ownerDocument) ||
package/package.json CHANGED
@@ -92,5 +92,5 @@
92
92
  "webidl2": "24.5.0",
93
93
  "yargs": "17.7.2"
94
94
  },
95
- "version": "1.0.1641723"
95
+ "version": "1.0.1642845"
96
96
  }