chrome-devtools-frontend 1.0.1636056 → 1.0.1640418
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/front_end/core/common/Color.ts +0 -4
- package/front_end/core/host/AidaClientTypes.ts +8 -6
- package/front_end/core/root/Runtime.ts +2 -2
- package/front_end/core/sdk/DOMStorageModel.ts +1 -1
- package/front_end/core/sdk/SourceMap.ts +8 -3
- package/front_end/core/sdk/TargetManager.ts +14 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +147 -0
- package/front_end/generated/ARIAProperties.js +17 -4
- package/front_end/generated/InspectorBackendCommands.ts +13 -7
- package/front_end/generated/SupportedCSSProperties.js +1 -0
- package/front_end/generated/protocol-mapping.d.ts +7 -0
- package/front_end/generated/protocol-proxy-api.d.ts +14 -0
- package/front_end/generated/protocol.ts +120 -2
- package/front_end/global_typings/global_defs.d.ts +13 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +116 -0
- package/front_end/models/ai_assistance/AiConversation.ts +22 -36
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +0 -1
- package/front_end/models/ai_assistance/AiOrigins.ts +46 -0
- package/front_end/models/ai_assistance/AiUtils.ts +9 -0
- package/front_end/models/ai_assistance/README.md +16 -0
- package/front_end/models/ai_assistance/StorageItem.ts +30 -26
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +12 -5
- package/front_end/models/ai_assistance/agents/AiAgent.ts +86 -32
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +31 -10
- package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/FileAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +1 -3
- package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +19 -0
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +9 -4
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +41 -12
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +442 -122
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -2
- package/front_end/models/ai_assistance/ai_assistance.ts +4 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/performance/AIContext.ts +7 -8
- package/front_end/models/ai_assistance/skills/README.md +40 -0
- package/front_end/models/ai_assistance/skills/Skill.ts +13 -0
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +10 -0
- package/front_end/models/ai_assistance/skills/styling.md +6 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +12 -4
- package/front_end/models/breakpoints/BreakpointManager.ts +54 -2
- package/front_end/models/greendev/Prototypes.ts +0 -7
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +20 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +5 -0
- package/front_end/models/issues_manager/EmailVerificationRequestIssue.ts +293 -0
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestInvalidEmail.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +1748 -1739
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +1 -1
- package/front_end/models/stack_trace/DetailedErrorStackParser.ts +9 -1
- package/front_end/models/stack_trace/StackTraceImpl.ts +29 -9
- package/front_end/models/stack_trace/StackTraceModel.ts +23 -11
- package/front_end/models/stack_trace/Trie.ts +11 -1
- package/front_end/models/trace/extras/TraceTree.ts +20 -1
- package/front_end/models/trace/insights/Common.ts +9 -0
- package/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +21 -25
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +19 -75
- package/front_end/panels/ai_assistance/components/AccessibilityAgentMarkdownRenderer.ts +10 -3
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +148 -2
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +2 -3
- package/front_end/panels/ai_assistance/components/chatMessage.css +27 -0
- package/front_end/panels/application/CookieItemsView.ts +24 -0
- package/front_end/panels/application/DOMStorageItemsView.ts +9 -4
- package/front_end/panels/application/preloading/components/PreloadingString.ts +6 -0
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -4
- package/front_end/panels/console/ConsoleViewMessage.ts +13 -102
- package/front_end/panels/elements/StandaloneStylesContainer.ts +10 -0
- package/front_end/panels/elements/StylePropertiesSection.ts +6 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +30 -1
- package/front_end/panels/elements/StylesContainer.ts +3 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +54 -4
- package/front_end/panels/elements/elements-meta.ts +14 -0
- package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +4 -4
- package/front_end/panels/network/NetworkDataGridNode.ts +14 -0
- package/front_end/panels/network/NetworkLogViewColumns.ts +2 -2
- package/front_end/panels/network/RequestHeadersView.ts +55 -19
- package/front_end/panels/network/networkTimingTable.css +2 -4
- package/front_end/panels/recorder/components/ReplaySection.ts +28 -16
- package/front_end/panels/recorder/converters/LighthouseConverter.snapshot.txt +47 -0
- package/front_end/panels/recorder/converters/PuppeteerConverter.snapshot.txt +49 -0
- package/front_end/panels/recorder/converters/PuppeteerReplayConverter.snapshot.txt +33 -0
- package/front_end/panels/settings/SettingsScreen.ts +1 -2
- package/front_end/panels/sources/BreakpointsView.ts +23 -42
- package/front_end/panels/sources/DebuggerPlugin.ts +12 -5
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +169 -106
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +2 -2
- package/front_end/third_party/marked/README.chromium +3 -6
- package/front_end/third_party/marked/package/README.md +5 -5
- package/front_end/third_party/marked/package/bin/main.js +27 -22
- package/front_end/third_party/marked/package/bin/marked.js +2 -1
- package/front_end/third_party/marked/package/lib/marked.esm.d.ts +346 -256
- package/front_end/third_party/marked/package/lib/marked.esm.js +67 -2698
- package/front_end/third_party/marked/package/lib/marked.esm.js.map +7 -1
- package/front_end/third_party/marked/package/lib/marked.umd.js +69 -2722
- package/front_end/third_party/marked/package/lib/marked.umd.js.map +7 -1
- package/front_end/third_party/marked/package/man/marked.1 +4 -2
- package/front_end/third_party/marked/package/man/marked.1.md +2 -1
- package/front_end/third_party/marked/package/package.json +49 -57
- package/front_end/third_party/puppeteer-replay/README.chromium +2 -2
- package/front_end/third_party/puppeteer-replay/package/lib/cli.js +84 -80
- package/front_end/third_party/puppeteer-replay/package/lib/cli.js.map +1 -1
- package/front_end/third_party/puppeteer-replay/package/lib/extension-test.js +79 -83
- package/front_end/third_party/puppeteer-replay/package/lib/extension-test.js.map +1 -1
- package/front_end/third_party/puppeteer-replay/package/lib/main.d.ts +43 -171
- package/front_end/third_party/puppeteer-replay/package/lib/main.js +51 -206
- package/front_end/third_party/puppeteer-replay/package/lib/main.js.map +1 -1
- package/front_end/third_party/puppeteer-replay/package/package.json +37 -67
- package/front_end/tsconfig.json +1 -1
- package/front_end/ui/components/markdown_view/CodeBlock.ts +17 -6
- package/front_end/ui/components/markdown_view/MarkdownView.ts +39 -3
- package/front_end/ui/components/markdown_view/codeBlock.css +11 -0
- package/front_end/ui/components/markdown_view/markdownView.css +17 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +0 -79
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +16 -4
- package/front_end/ui/visual_logging/KnownContextValues.ts +4 -0
- package/inspector_overlay/testing/InspectorOverlayHelpers.ts +2 -0
- package/mcp/mcp.ts +1 -6
- package/package.json +14 -16
- package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +0 -1015
- package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgentOverlay.ts +0 -87
- package/front_end/third_party/marked/package/bin/marked +0 -215
- package/front_end/third_party/marked/package/lib/marked.cjs +0 -2726
- package/front_end/third_party/marked/package/lib/marked.cjs.map +0 -1
- package/front_end/third_party/marked/package/lib/marked.d.cts +0 -670
- package/front_end/third_party/marked/package/lib/marked.js +0 -2780
- package/front_end/third_party/marked/package/man/marked.1.txt +0 -86
- package/front_end/third_party/marked/package/marked.min.js +0 -6
- package/front_end/third_party/marked/package/src/Lexer.js +0 -492
- package/front_end/third_party/marked/package/src/Parser.js +0 -286
- package/front_end/third_party/marked/package/src/Renderer.js +0 -166
- package/front_end/third_party/marked/package/src/Slugger.js +0 -49
- package/front_end/third_party/marked/package/src/TextRenderer.js +0 -42
- package/front_end/third_party/marked/package/src/Tokenizer.js +0 -755
- package/front_end/third_party/marked/package/src/defaults.js +0 -29
- package/front_end/third_party/marked/package/src/helpers.js +0 -249
- package/front_end/third_party/marked/package/src/marked.js +0 -350
- package/front_end/third_party/marked/package/src/rules.js +0 -285
- package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.cjs +0 -2099
- package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.cjs.map +0 -1
- package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.d.cts +0 -686
- package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.d.ts +0 -35
- package/mcp/HostBindings.ts +0 -319
- /package/front_end/third_party/marked/package/{LICENSE.md → LICENSE} +0 -0
|
@@ -300,7 +300,7 @@ export class BreakpointsSidebarController implements UI.ContextFlavorListener.Co
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
const locationsGroupedById = this.#groupBreakpointLocationsById(breakpointLocations);
|
|
303
|
-
const locationIdsByLineId = this.#getLocationIdsByLineId(
|
|
303
|
+
const locationIdsByLineId = this.#getLocationIdsByLineId(locationsGroupedById);
|
|
304
304
|
|
|
305
305
|
const [content, selectedUILocation] = await Promise.all([
|
|
306
306
|
this.#getContent(locationsGroupedById),
|
|
@@ -312,9 +312,9 @@ export class BreakpointsSidebarController implements UI.ContextFlavorListener.Co
|
|
|
312
312
|
for (let idx = 0; idx < locationsGroupedById.length; idx++) {
|
|
313
313
|
const locations = locationsGroupedById[idx];
|
|
314
314
|
const fstLocation = locations[0];
|
|
315
|
-
const
|
|
316
|
-
const
|
|
317
|
-
const
|
|
315
|
+
const uiLocation = fstLocation.breakpoint.getClosestResolvedLocation() || fstLocation.uiLocation;
|
|
316
|
+
const sourceURL = uiLocation.uiSourceCode.url();
|
|
317
|
+
const scriptId = uiLocation.uiSourceCode.canonicalScriptId();
|
|
318
318
|
|
|
319
319
|
const isHit = selectedUILocation !== null &&
|
|
320
320
|
locations.some(location => location.uiLocation.id() === selectedUILocation.id());
|
|
@@ -334,8 +334,8 @@ export class BreakpointsSidebarController implements UI.ContextFlavorListener.Co
|
|
|
334
334
|
}
|
|
335
335
|
const expanded = !this.#collapsedFiles.has(sourceURL);
|
|
336
336
|
|
|
337
|
-
const status: BreakpointStatus = this.#getBreakpointState(
|
|
338
|
-
const {type, hoverText} = this.#getBreakpointTypeAndDetails(
|
|
337
|
+
const status: BreakpointStatus = this.#getBreakpointState(fstLocation.breakpoint);
|
|
338
|
+
const {type, hoverText} = this.#getBreakpointTypeAndDetails(fstLocation.breakpoint);
|
|
339
339
|
const item = {
|
|
340
340
|
id: fstLocation.breakpoint.breakpointStorageId(),
|
|
341
341
|
location: locationText,
|
|
@@ -403,15 +403,13 @@ export class BreakpointsSidebarController implements UI.ContextFlavorListener.Co
|
|
|
403
403
|
this.#collapsedFilesSettings.set(Array.from(this.#collapsedFiles.values()));
|
|
404
404
|
}
|
|
405
405
|
|
|
406
|
-
#getBreakpointTypeAndDetails(
|
|
406
|
+
#getBreakpointTypeAndDetails(breakpoint: Breakpoints.BreakpointManager.Breakpoint):
|
|
407
407
|
{type: SDK.DebuggerModel.BreakpointType, hoverText?: string} {
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
if (!breakpoint?.condition()) {
|
|
408
|
+
const condition = breakpoint.condition();
|
|
409
|
+
if (!condition) {
|
|
411
410
|
return {type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT};
|
|
412
411
|
}
|
|
413
412
|
|
|
414
|
-
const condition = breakpoint.condition();
|
|
415
413
|
if (breakpoint.isLogpoint()) {
|
|
416
414
|
return {type: SDK.DebuggerModel.BreakpointType.LOGPOINT, hoverText: condition};
|
|
417
415
|
}
|
|
@@ -456,49 +454,32 @@ export class BreakpointsSidebarController implements UI.ContextFlavorListener.Co
|
|
|
456
454
|
|
|
457
455
|
#groupBreakpointLocationsById(breakpointLocations: Breakpoints.BreakpointManager.BreakpointLocation[]):
|
|
458
456
|
Breakpoints.BreakpointManager.BreakpointLocation[][] {
|
|
459
|
-
const map =
|
|
460
|
-
|
|
461
|
-
const uiLocation = breakpointLocation.uiLocation;
|
|
462
|
-
map.set(uiLocation.id(), breakpointLocation);
|
|
463
|
-
}
|
|
464
|
-
const arr: Breakpoints.BreakpointManager.BreakpointLocation[][] = [];
|
|
465
|
-
for (const id of map.keysArray()) {
|
|
466
|
-
const locations = Array.from(map.get(id));
|
|
467
|
-
if (locations.length) {
|
|
468
|
-
arr.push(locations);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
return arr;
|
|
457
|
+
const map = Map.groupBy(breakpointLocations, loc => loc.breakpoint.breakpointStorageId());
|
|
458
|
+
return Array.from(map.values());
|
|
472
459
|
}
|
|
473
460
|
|
|
474
|
-
#getLocationIdsByLineId(
|
|
461
|
+
#getLocationIdsByLineId(locationsGroupedById: Breakpoints.BreakpointManager.BreakpointLocation[][]):
|
|
475
462
|
Platform.MapUtilities.Multimap<string, string> {
|
|
476
463
|
const result = new Platform.MapUtilities.Multimap<string, string>();
|
|
477
464
|
|
|
478
|
-
for (const
|
|
479
|
-
const
|
|
480
|
-
|
|
465
|
+
for (const locations of locationsGroupedById) {
|
|
466
|
+
const breakpoint = locations[0].breakpoint;
|
|
467
|
+
const uiLocation = breakpoint.getClosestResolvedLocation() || locations[0].uiLocation;
|
|
468
|
+
result.set(uiLocation.lineId(), breakpoint.breakpointStorageId());
|
|
481
469
|
}
|
|
482
|
-
|
|
483
470
|
return result;
|
|
484
471
|
}
|
|
485
472
|
|
|
486
|
-
#getBreakpointState(
|
|
487
|
-
|
|
488
|
-
const hasDisabled = locations.some(location => !location.breakpoint.enabled());
|
|
489
|
-
let status: BreakpointStatus;
|
|
490
|
-
if (hasEnabled) {
|
|
491
|
-
status = hasDisabled ? BreakpointStatus.INDETERMINATE : BreakpointStatus.ENABLED;
|
|
492
|
-
} else {
|
|
493
|
-
status = BreakpointStatus.DISABLED;
|
|
494
|
-
}
|
|
495
|
-
return status;
|
|
473
|
+
#getBreakpointState(breakpoint: Breakpoints.BreakpointManager.Breakpoint): BreakpointStatus {
|
|
474
|
+
return breakpoint.enabled() ? BreakpointStatus.ENABLED : BreakpointStatus.DISABLED;
|
|
496
475
|
}
|
|
497
476
|
|
|
498
|
-
#getContent(
|
|
477
|
+
#getContent(locationsGroupedById: Breakpoints.BreakpointManager.BreakpointLocation[][]):
|
|
499
478
|
Promise<TextUtils.ContentData.ContentData[]> {
|
|
500
|
-
return Promise.all(
|
|
501
|
-
const
|
|
479
|
+
return Promise.all(locationsGroupedById.map(async locations => {
|
|
480
|
+
const fstLocation = locations[0];
|
|
481
|
+
const uiLocation = fstLocation.breakpoint.getClosestResolvedLocation() || fstLocation.uiLocation;
|
|
482
|
+
const contentData = await uiLocation.uiSourceCode.requestContentData({cachedWasmOnly: true});
|
|
502
483
|
return TextUtils.ContentData.ContentData.contentDataOrEmpty(contentData);
|
|
503
484
|
}));
|
|
504
485
|
}
|
|
@@ -1179,14 +1179,21 @@ export class DebuggerPlugin extends Plugin {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
const {editor} = this;
|
|
1181
1181
|
const breakpointLocations = this.breakpointManager.breakpointLocationsForUISourceCode(this.uiSourceCode);
|
|
1182
|
-
|
|
1182
|
+
|
|
1183
|
+
// Group by breakpoint to de-duplicate
|
|
1184
|
+
const uniqueBreakpoints = Map.groupBy(breakpointLocations, loc => loc.breakpoint);
|
|
1185
|
+
|
|
1186
|
+
const result = [];
|
|
1187
|
+
for (const [breakpoint, locations] of uniqueBreakpoints) {
|
|
1188
|
+
const closestUILoc = breakpoint.getClosestResolvedLocation() || locations[0].uiLocation;
|
|
1183
1189
|
const editorLocation =
|
|
1184
|
-
this.transformer.uiLocationToEditorLocation(
|
|
1185
|
-
|
|
1190
|
+
this.transformer.uiLocationToEditorLocation(closestUILoc.lineNumber, closestUILoc.columnNumber);
|
|
1191
|
+
result.push({
|
|
1186
1192
|
position: editor.toOffset(editorLocation),
|
|
1187
1193
|
breakpoint,
|
|
1188
|
-
};
|
|
1189
|
-
}
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
return result;
|
|
1190
1197
|
}
|
|
1191
1198
|
|
|
1192
1199
|
private lineBreakpoints(line: CodeMirror.Line): readonly Breakpoints.BreakpointManager.Breakpoint[] {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2021 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
4
|
|
|
6
5
|
/*
|
|
7
6
|
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
|
|
@@ -31,13 +30,14 @@
|
|
|
31
30
|
|
|
32
31
|
import type * as Common from '../../core/common/common.js';
|
|
33
32
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
34
|
-
import * as SDK from '../../core/sdk/sdk.js';
|
|
33
|
+
import type * as SDK from '../../core/sdk/sdk.js';
|
|
35
34
|
import * as Protocol from '../../generated/protocol.js';
|
|
36
35
|
import * as SourceMapScopes from '../../models/source_map_scopes/source_map_scopes.js';
|
|
37
36
|
import * as StackTrace from '../../models/stack_trace/stack_trace.js';
|
|
38
37
|
import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
|
|
39
38
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
40
39
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
40
|
+
import {html, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
|
|
41
41
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
42
42
|
|
|
43
43
|
import scopeChainSidebarPaneStyles from './scopeChainSidebarPane.css.js';
|
|
@@ -69,32 +69,119 @@ const str_ = i18n.i18n.registerUIStrings('panels/sources/ScopeChainSidebarPane.t
|
|
|
69
69
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
70
70
|
let scopeChainSidebarPaneInstance: ScopeChainSidebarPane;
|
|
71
71
|
|
|
72
|
+
interface ViewInput {
|
|
73
|
+
linkifier: Components.Linkifier.Linkifier;
|
|
74
|
+
isPaused: boolean;
|
|
75
|
+
scopeChain: Array<{
|
|
76
|
+
scope: SDK.DebuggerModel.ScopeChainEntry,
|
|
77
|
+
objectTree: ObjectUI.ObjectPropertiesSection.ObjectTree,
|
|
78
|
+
}>|null;
|
|
79
|
+
}
|
|
80
|
+
type View = (input: ViewInput, output: object, target: HTMLElement) => void;
|
|
81
|
+
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
82
|
+
const createScopeSectionTreeElement =
|
|
83
|
+
(scope: SDK.DebuggerModel.ScopeChainEntry,
|
|
84
|
+
objectTree: ObjectUI.ObjectPropertiesSection.ObjectTree): TemplateResult => {
|
|
85
|
+
let emptyPlaceholder: Common.UIString.LocalizedString|null = null;
|
|
86
|
+
if (scope.type() === Protocol.Debugger.ScopeType.Local ||
|
|
87
|
+
scope.type() === Protocol.Debugger.ScopeType.Closure) {
|
|
88
|
+
emptyPlaceholder = i18nString(UIStrings.noVariables);
|
|
89
|
+
}
|
|
90
|
+
const icon = scope.icon();
|
|
91
|
+
const {title, subtitle} = scopeTitle(scope);
|
|
92
|
+
const section = new ObjectUI.ObjectPropertiesSection.RootElement(objectTree, input.linkifier, emptyPlaceholder);
|
|
93
|
+
section.listItemElement.classList.add('scope-chain-sidebar-pane-section');
|
|
94
|
+
section.listItemElement.setAttribute('aria-label', title);
|
|
95
|
+
|
|
96
|
+
const titleNode = document.createDocumentFragment();
|
|
97
|
+
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
98
|
+
render(
|
|
99
|
+
html`<div class='scope-chain-sidebar-pane-section-header tree-element-title'>${
|
|
100
|
+
icon ? html`<img class=scope-chain-sidebar-pane-section-icon src=${icon}>` : nothing}
|
|
101
|
+
<div class=scope-chain-sidebar-pane-section-subtitle>${subtitle}</div>
|
|
102
|
+
<div class=scope-chain-sidebar-pane-section-title>${title}</div>
|
|
103
|
+
</div>`,
|
|
104
|
+
titleNode);
|
|
105
|
+
section.title = titleNode;
|
|
106
|
+
|
|
107
|
+
if (scope === input.scopeChain?.[0]?.scope) {
|
|
108
|
+
section.select(/* omitFocus */ true);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return html`<devtools-tree-wrapper .treeElement=${section}></devtools-tree-wrapper>`;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
render(
|
|
115
|
+
// clang-format off
|
|
116
|
+
html`
|
|
117
|
+
<style>${scopeChainSidebarPaneStyles}</style>
|
|
118
|
+
${input.scopeChain ? html`
|
|
119
|
+
<devtools-tree autofocus hide-overflow show-selection-on-keyboard-focus .template=${
|
|
120
|
+
html`<ul role=tree class="source-code object-properties-section">
|
|
121
|
+
<style>${ObjectUI.ObjectPropertiesSection.objectValueStyles}</style>
|
|
122
|
+
<style>${ObjectUI.ObjectPropertiesSection.objectPropertiesSectionStyles}</style>
|
|
123
|
+
<style>${scopeChainSidebarPaneStyles}</style>
|
|
124
|
+
${input.scopeChain?.map(({scope, objectTree}) => createScopeSectionTreeElement(scope, objectTree)) ?? nothing}
|
|
125
|
+
</ul>`}>
|
|
126
|
+
</devtools-tree>` : html`
|
|
127
|
+
<div class=gray-info-message tabindex=-1>${
|
|
128
|
+
input.isPaused ? i18nString(UIStrings.loading) : i18nString(UIStrings.notPaused)}</div>`}
|
|
129
|
+
`,
|
|
130
|
+
// clang-format on
|
|
131
|
+
target);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
function scopeTitle(scope: SDK.DebuggerModel.ScopeChainEntry): {title: string, subtitle: string|null} {
|
|
135
|
+
let title = scope.typeName();
|
|
136
|
+
if (scope.type() === Protocol.Debugger.ScopeType.Closure) {
|
|
137
|
+
const scopeName = scope.name();
|
|
138
|
+
if (scopeName) {
|
|
139
|
+
title = i18nString(UIStrings.closureS, {PH1: UI.UIUtils.beautifyFunctionName(scopeName)});
|
|
140
|
+
} else {
|
|
141
|
+
title = i18nString(UIStrings.closure);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
let subtitle: string|null = scope.description();
|
|
145
|
+
if (!title || title === subtitle) {
|
|
146
|
+
subtitle = null;
|
|
147
|
+
}
|
|
148
|
+
return {title, subtitle};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function scopeKey(scope: SDK.DebuggerModel.ScopeChainEntry): string {
|
|
152
|
+
let title = scope.typeName();
|
|
153
|
+
if (scope.type() === Protocol.Debugger.ScopeType.Closure) {
|
|
154
|
+
const scopeName = scope.name();
|
|
155
|
+
if (scopeName) {
|
|
156
|
+
title = `Closure: ${UI.UIUtils.beautifyFunctionName(scopeName)}`;
|
|
157
|
+
} else {
|
|
158
|
+
title = 'Closure';
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
let subtitle: string|null = scope.description();
|
|
162
|
+
if (!title || title === subtitle) {
|
|
163
|
+
subtitle = null;
|
|
164
|
+
}
|
|
165
|
+
return title + (subtitle ? ':' + subtitle : '');
|
|
166
|
+
}
|
|
72
167
|
export class ScopeChainSidebarPane extends UI.Widget.VBox implements UI.ContextFlavorListener.ContextFlavorListener {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
private readonly linkifier: Components.Linkifier.Linkifier;
|
|
76
|
-
private infoElement: HTMLDivElement;
|
|
168
|
+
readonly #linkifier: Components.Linkifier.Linkifier;
|
|
169
|
+
#expansionTrackers = new Map<string, ObjectUI.ObjectPropertiesSection.ObjectTreeExpansionTracker>();
|
|
77
170
|
#scopeChainModel: SourceMapScopes.ScopeChainModel.ScopeChainModel|null = null;
|
|
171
|
+
#scopeChain:
|
|
172
|
+
Array<{scope: SDK.DebuggerModel.ScopeChainEntry, objectTree: ObjectUI.ObjectPropertiesSection.ObjectTree}>|null =
|
|
173
|
+
null;
|
|
174
|
+
#view: View;
|
|
78
175
|
|
|
79
|
-
|
|
80
|
-
super({
|
|
176
|
+
constructor(target?: HTMLElement, view = DEFAULT_VIEW) {
|
|
177
|
+
super(target, {
|
|
81
178
|
jslog: `${VisualLogging.section('sources.scope-chain')}`,
|
|
82
179
|
useShadowDom: true,
|
|
83
180
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.treeOutline = new ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline();
|
|
87
|
-
this.treeOutline.registerRequiredCSS(scopeChainSidebarPaneStyles);
|
|
88
|
-
this.treeOutline.setHideOverflow(true);
|
|
89
|
-
|
|
90
|
-
this.treeOutline.setShowSelectionOnKeyboardFocus(/* show */ true);
|
|
91
|
-
this.expandController =
|
|
92
|
-
new ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeExpandController(this.treeOutline);
|
|
93
|
-
this.linkifier = new Components.Linkifier.Linkifier();
|
|
94
|
-
this.infoElement = document.createElement('div');
|
|
95
|
-
this.infoElement.className = 'gray-info-message';
|
|
96
|
-
this.infoElement.tabIndex = -1;
|
|
181
|
+
|
|
182
|
+
this.#linkifier = new Components.Linkifier.Linkifier();
|
|
97
183
|
this.flavorChanged(UI.Context.Context.instance().flavor(StackTrace.StackTrace.DebuggableFrameFlavor));
|
|
184
|
+
this.#view = view;
|
|
98
185
|
}
|
|
99
186
|
|
|
100
187
|
static instance(): ScopeChainSidebarPane {
|
|
@@ -104,116 +191,92 @@ export class ScopeChainSidebarPane extends UI.Widget.VBox implements UI.ContextF
|
|
|
104
191
|
return scopeChainSidebarPaneInstance;
|
|
105
192
|
}
|
|
106
193
|
|
|
107
|
-
|
|
108
|
-
|
|
194
|
+
/**
|
|
195
|
+
* @deprecated Required for legacy web tests via DebuggerTestRunner.js
|
|
196
|
+
*/
|
|
197
|
+
get treeOutline(): ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline|null {
|
|
198
|
+
const devtoolsTree = this.contentElement.querySelector('devtools-tree');
|
|
199
|
+
if (devtoolsTree) {
|
|
200
|
+
return (devtoolsTree as UI.TreeOutline.TreeViewElement).getInternalTreeOutlineForTest() as
|
|
201
|
+
ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline;
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
109
204
|
}
|
|
110
205
|
|
|
111
206
|
flavorChanged(callFrame: StackTrace.StackTrace.DebuggableFrameFlavor|null): void {
|
|
112
207
|
this.#scopeChainModel?.dispose();
|
|
113
208
|
this.#scopeChainModel = null;
|
|
209
|
+
this.#scopeChain = null;
|
|
114
210
|
|
|
115
|
-
this
|
|
116
|
-
this.contentElement.removeChildren();
|
|
117
|
-
this.contentElement.appendChild(this.infoElement);
|
|
211
|
+
this.#linkifier.reset();
|
|
118
212
|
|
|
119
213
|
if (callFrame) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
this);
|
|
128
|
-
} else {
|
|
129
|
-
this.infoElement.textContent = i18nString(UIStrings.notPaused);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
override focus(): void {
|
|
134
|
-
if (this.hasFocus()) {
|
|
135
|
-
return;
|
|
214
|
+
const scopeChainModel = new SourceMapScopes.ScopeChainModel.ScopeChainModel(callFrame.sdkFrame);
|
|
215
|
+
this.#scopeChainModel = scopeChainModel;
|
|
216
|
+
this.#scopeChainModel.addEventListener(SourceMapScopes.ScopeChainModel.Events.SCOPE_CHAIN_UPDATED, event => {
|
|
217
|
+
if (this.#scopeChainModel === scopeChainModel) {
|
|
218
|
+
this.#buildScopeChain(event.data);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
136
221
|
}
|
|
137
222
|
|
|
138
|
-
|
|
139
|
-
this.treeOutline.forceSelect();
|
|
140
|
-
}
|
|
223
|
+
this.requestUpdate();
|
|
141
224
|
}
|
|
142
225
|
|
|
143
|
-
|
|
144
|
-
|
|
226
|
+
override performUpdate(): void {
|
|
227
|
+
this.#view(
|
|
228
|
+
{
|
|
229
|
+
linkifier: this.#linkifier,
|
|
230
|
+
isPaused: Boolean(this.#scopeChainModel),
|
|
231
|
+
scopeChain: this.#scopeChain,
|
|
232
|
+
},
|
|
233
|
+
{}, this.contentElement);
|
|
234
|
+
}
|
|
145
235
|
|
|
146
|
-
|
|
236
|
+
#buildScopeChain({scopeChain}: SourceMapScopes.ScopeChainModel.ScopeChain): void {
|
|
237
|
+
const oldExpansionTrackers = this.#expansionTrackers;
|
|
238
|
+
this.#expansionTrackers = new Map();
|
|
239
|
+
this.#scopeChain = [];
|
|
147
240
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
241
|
+
for (const scope of scopeChain) {
|
|
242
|
+
const key = scopeKey(scope);
|
|
243
|
+
let expansionTracker = this.#expansionTrackers.get(key);
|
|
244
|
+
if (!expansionTracker) {
|
|
245
|
+
expansionTracker =
|
|
246
|
+
oldExpansionTrackers.get(key) ?? new ObjectUI.ObjectPropertiesSection.ObjectTreeExpansionTracker();
|
|
247
|
+
this.#expansionTrackers.set(key, expansionTracker);
|
|
154
248
|
}
|
|
155
249
|
|
|
156
|
-
const
|
|
250
|
+
const objectTree = new ObjectUI.ObjectPropertiesSection.ObjectTree(scope.object(), {
|
|
251
|
+
propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.ALL,
|
|
252
|
+
readOnly: false,
|
|
253
|
+
expansionTracker,
|
|
254
|
+
});
|
|
255
|
+
void expansionTracker.apply(objectTree);
|
|
256
|
+
objectTree.addExtraProperties(...scope.extraProperties());
|
|
157
257
|
if (scope.type() === Protocol.Debugger.ScopeType.Global) {
|
|
158
|
-
|
|
159
|
-
} else if (!foundLocalScope || scope.type() === Protocol.Debugger.ScopeType.Local) {
|
|
160
|
-
section.expand();
|
|
258
|
+
objectTree.expanded = false;
|
|
161
259
|
}
|
|
162
260
|
|
|
163
|
-
this.
|
|
164
|
-
if (i === 0) {
|
|
165
|
-
section.select(/* omitFocus */ true);
|
|
166
|
-
}
|
|
261
|
+
this.#scopeChain.push({scope, objectTree});
|
|
167
262
|
}
|
|
168
|
-
this.sidebarPaneUpdatedForTest();
|
|
169
|
-
}
|
|
170
263
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
let title = scope.typeName();
|
|
179
|
-
if (scope.type() === Protocol.Debugger.ScopeType.Closure) {
|
|
180
|
-
const scopeName = scope.name();
|
|
181
|
-
if (scopeName) {
|
|
182
|
-
title = i18nString(UIStrings.closureS, {PH1: UI.UIUtils.beautifyFunctionName(scopeName)});
|
|
183
|
-
} else {
|
|
184
|
-
title = i18nString(UIStrings.closure);
|
|
264
|
+
for (const {scope, objectTree} of this.#scopeChain) {
|
|
265
|
+
if (scope.type() !== Protocol.Debugger.ScopeType.Global) {
|
|
266
|
+
objectTree.expanded = true;
|
|
267
|
+
}
|
|
268
|
+
if (scope.type() === Protocol.Debugger.ScopeType.Local) {
|
|
269
|
+
break;
|
|
185
270
|
}
|
|
186
271
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
const icon = scope.icon();
|
|
192
|
-
|
|
193
|
-
const titleElement = document.createElement('div');
|
|
194
|
-
titleElement.classList.add('scope-chain-sidebar-pane-section-header');
|
|
195
|
-
titleElement.classList.add('tree-element-title');
|
|
196
|
-
if (icon) {
|
|
197
|
-
const iconElement = document.createElement('img');
|
|
198
|
-
iconElement.classList.add('scope-chain-sidebar-pane-section-icon');
|
|
199
|
-
iconElement.src = icon;
|
|
200
|
-
titleElement.appendChild(iconElement);
|
|
201
|
-
}
|
|
202
|
-
titleElement.createChild('div', 'scope-chain-sidebar-pane-section-subtitle').textContent = subtitle;
|
|
203
|
-
titleElement.createChild('div', 'scope-chain-sidebar-pane-section-title').textContent = title;
|
|
204
|
-
|
|
205
|
-
const root = new ObjectUI.ObjectPropertiesSection.ObjectTree(
|
|
206
|
-
scope.object(), {propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.ALL, readOnly: false});
|
|
207
|
-
root.addExtraProperties(...scope.extraProperties());
|
|
208
|
-
const section = new ObjectUI.ObjectPropertiesSection.RootElement(root, this.linkifier, emptyPlaceholder);
|
|
209
|
-
section.title = titleElement;
|
|
210
|
-
section.listItemElement.classList.add('scope-chain-sidebar-pane-section');
|
|
211
|
-
section.listItemElement.setAttribute('aria-label', title);
|
|
212
|
-
this.expandController.watchSection(title + (subtitle ? ':' + subtitle : ''), section);
|
|
213
|
-
|
|
214
|
-
return section;
|
|
272
|
+
|
|
273
|
+
this.requestUpdate();
|
|
274
|
+
void this.updateComplete.then(() => this.sidebarPaneUpdatedForTest());
|
|
215
275
|
}
|
|
216
276
|
|
|
277
|
+
/**
|
|
278
|
+
* @deprecated Hook for legacy web tests
|
|
279
|
+
*/
|
|
217
280
|
sidebarPaneUpdatedForTest(): void {
|
|
218
281
|
}
|
|
219
282
|
}
|
|
@@ -192,6 +192,7 @@ export class IgnoreListSetting extends UI.Widget.Widget {
|
|
|
192
192
|
Common.Settings.Settings.instance()
|
|
193
193
|
.moduleSetting('enable-ignore-listing')
|
|
194
194
|
.addChangeListener(this.requestUpdate.bind(this));
|
|
195
|
+
this.requestUpdate();
|
|
195
196
|
}
|
|
196
197
|
|
|
197
198
|
#getSkipStackFramesPatternSetting(): Common.Settings.RegExpSetting {
|
|
@@ -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:
|
|
4
|
+
Revision: d56b17376efe8dc18fbf38aee20fe155821dd910
|
|
5
5
|
Update Mechanism: Manual (https://crbug.com/428069060)
|
|
6
6
|
License: BSD-3-Clause
|
|
7
7
|
License File: LICENSE
|
|
@@ -462,8 +462,8 @@ f=x});do var h=this._binding.writeSync(a,e,o,r,this._buffer,this._offset,t);whil
|
|
|
462
462
|
r=[];for(let[t,o]of a)i.set(t,e.getSummary(o)),r.push(...o);return i.set(e.summary,e.getSummary(r)),i}static estimateValueByOrigin(a,i){let r=e.estimateIfConnectionWasReused(a),t=e.groupByOrigin(a),o=new Map;for(let[n,d]of t.entries()){let l=[];for(let c of d){let f=c.timing;if(!f)continue;let h=i({request:c,timing:f,connectionReused:r.get(c.requestId)});typeof h<"u"&&(l=l.concat(h))}l.length&&o.set(n,l)}return o}static estimateRTTViaConnectionTiming(a){let{timing:i,connectionReused:r,request:t}=a;if(r)return;let{connectStart:o,sslStart:n,sslEnd:d,connectEnd:l}=i;if(l>=0&&o>=0&&t.protocol.startsWith("h3"))return l-o;if(n>=0&&d>=0&&n!==o)return[l-n,n-o];if(o>=0&&l>=0)return l-o}static estimateRTTViaDownloadTiming(a){let{timing:i,connectionReused:r,request:t}=a;if(r||t.transferSize<=XD||!Number.isFinite(i.receiveHeadersEnd)||i.receiveHeadersEnd<0)return;let n=t.networkEndTime-t.networkRequestTime-i.receiveHeadersEnd,d=Math.log2(t.transferSize/XD);if(!(d>5))return n/d}static estimateRTTViaSendStartTiming(a){
|
|
463
463
|
let{timing:i,connectionReused:r,request:t}=a;if(r||!Number.isFinite(i.sendStart)||i.sendStart<0)return;let o=1;return t.protocol.startsWith("h3")||(o+=1),t.parsedURL.scheme==="https"&&(o+=1),i.sendStart/o}static estimateRTTViaHeadersEndTiming(a){let{timing:i,connectionReused:r,request:t}=a;if(!Number.isFinite(i.receiveHeadersEnd)||i.receiveHeadersEnd<0||!t.resourceType)return;let o=Fee[t.resourceType]||Nee,n=i.receiveHeadersEnd*o,d=1;return r||(d+=1,t.protocol.startsWith("h3")||(d+=1),t.parsedURL.scheme==="https"&&(d+=1)),Math.max((i.receiveHeadersEnd-n)/d,3)}static estimateResponseTimeByOrigin(a,i){return e.estimateValueByOrigin(a,({request:r,timing:t})=>{if(r.serverResponseTime!==void 0)return r.serverResponseTime;if(!Number.isFinite(t.receiveHeadersEnd)||t.receiveHeadersEnd<0||!Number.isFinite(t.sendEnd)||t.sendEnd<0)return;let o=t.receiveHeadersEnd-t.sendEnd,n=r.parsedURL.securityOrigin,d=i.get(n)||i.get(e.summary)||0;return Math.max(o-d,0)})}static canTrustConnectionInformation(a){
|
|
464
464
|
let i=new Map;for(let r of a){let t=i.get(r.connectionId)||!r.connectionReused;i.set(r.connectionId,t)}return i.size<=1?!1:Array.from(i.values()).every(r=>r)}static estimateIfConnectionWasReused(a,i){let{forceCoarseEstimates:r=!1}=i||{};if(!r&&e.canTrustConnectionInformation(a))return new Map(a.map(n=>[n.requestId,!!n.connectionReused]));let t=new Map,o=e.groupByOrigin(a);for(let n of o.values()){let d=n.map(c=>c.networkEndTime).reduce((c,f)=>Math.min(c,f),1/0);for(let c of n)t.set(c.requestId,c.networkRequestTime>=d||c.protocol==="h2");let l=n.reduce((c,f)=>c.networkRequestTime>f.networkRequestTime?f:c);t.set(l.requestId,!1)}return t}static estimateRTTByOrigin(a,i){let{forceCoarseEstimates:r=!1,coarseEstimateMultiplier:t=.3,useDownloadEstimates:o=!0,useSendStartEstimates:n=!0,useHeadersEndEstimates:d=!0}=i||{},l=e.estimateIfConnectionWasReused(a),c=e.groupByOrigin(a),f=new Map;for(let[h,m]of c.entries()){let g=function(x,y=1){for(let E of m){let C=E.timing;if(!C||!E.transferSize)continue;
|
|
465
|
-
let k=x({request:E,timing:C,connectionReused:l.get(E.requestId)});k!==void 0&&(Array.isArray(k)?u.push(...k.map(T=>T*y)):u.push(k*y))}};s(g,"collectEstimates");let u=[];r||g(this.estimateRTTViaConnectionTiming),u.length||(o&&g(this.estimateRTTViaDownloadTiming,t),n&&g(this.estimateRTTViaSendStartTiming,t),d&&g(this.estimateRTTViaHeadersEndTiming,t)),u.length&&f.set(h,u)}
|
|
466
|
-
let t=0,o=0,n=0;return r.forEach(d=>{d.isStart?(t===0&&(o=d.time),t++):(t--,t===0&&(n+=d.time-o))}),i*8/n}static computeRTTAndServerResponseTime(a){let i=new Map;for(let[d,l]of e.estimateRTTByOrigin(a).entries())i.set(d,l.min);let r=Math.min(...Array.from(i.values())),t=e.estimateServerResponseTimeByOrigin(a,{rttByOrigin:i}),o=new Map,n=new Map;for(let[d,l]of t.entries()){let c=i.get(d)||r;o.set(d,c-r),n.set(d,l.median)}return{rtt:r,additionalRttByOrigin:o,serverResponseTimeByOrigin:n}}static analyze(a){let i=e.estimateThroughput(a);return i===null?null:{throughput:i,...e.computeRTTAndServerResponseTime(a)}}static findResourceForUrl(a,i){return a.find(r=>i.startsWith(r.url)&&Vm.equalWithExcludedFragments(r.url,i))}static findLastDocumentForUrl(a,i){let r=a.filter(t=>t.resourceType==="Document"&&!t.failed&&i.startsWith(t.url)&&Vm.equalWithExcludedFragments(t.url,i));return r[r.length-1]}static resolveRedirects(a){for(;a.redirectDestination;)a=a.redirectDestination;return a}}});var ca={};S(ca,{LanternError:()=>J,NetworkAnalyzer:()=>Bt});var dr=_(()=>{p();Q2();KD()});var aa,qm=_(()=>{p();dr();aa=class e{static{s(this,"BaseNode")}static types={NETWORK:"network",CPU:"cpu"};_id;_isMainDocument;dependents;dependencies;constructor(a){this._id=a,this._isMainDocument=!1,this.dependents=[],this.dependencies=[]}get id(){return this._id}get type(){throw new J("Unimplemented")}get startTime(){throw new J("Unimplemented")}get endTime(){throw new J("Unimplemented")}setIsMainDocument(a){this._isMainDocument=a}isMainDocument(){return this._isMainDocument}getDependents(){return this.dependents.slice()}getNumberOfDependents(){return this.dependents.length}getDependencies(){return this.dependencies.slice()}getNumberOfDependencies(){return this.dependencies.length}getRootNode(){let a=this;for(;a.dependencies.length;)a=a.dependencies[0];return a}addDependent(a){a.addDependency(this)}addDependency(a){if(a===this)throw new J("Cannot add dependency on itself");this.dependencies.includes(a)||(a.dependents.push(this),this.dependencies.push(a))}removeDependent(a){a.removeDependency(
|
|
465
|
+
let k=x({request:E,timing:C,connectionReused:l.get(E.requestId)});k!==void 0&&(Array.isArray(k)?u.push(...k.map(T=>T*y)):u.push(k*y))}};s(g,"collectEstimates");let u=[];r||g(this.estimateRTTViaConnectionTiming),u.length||(o&&g(this.estimateRTTViaDownloadTiming,t),n&&g(this.estimateRTTViaSendStartTiming,t),d&&g(this.estimateRTTViaHeadersEndTiming,t)),u.length&&f.set(h,u)};return e.summarize(f)}static estimateServerResponseTimeByOrigin(a,i){let r=i?.rttByOrigin;if(!r){r=new Map;let o=e.estimateRTTByOrigin(a,i);for(let[n,d]of o.entries())r.set(n,d.min)}let t=e.estimateResponseTimeByOrigin(a,r);return e.summarize(t)}static estimateThroughput(a){let i=0,r=a.reduce((d,l)=>(l.parsedURL?.scheme==="data"||l.failed||!l.finished||l.statusCode>300||!l.transferSize||(i+=l.transferSize,d.push({time:l.responseHeadersEndTime/1e3,isStart:!0}),d.push({time:l.networkEndTime/1e3,isStart:!1})),d),[]).sort((d,l)=>d.time-l.time);if(!r.length)return null;
|
|
466
|
+
let t=0,o=0,n=0;return r.forEach(d=>{d.isStart?(t===0&&(o=d.time),t++):(t--,t===0&&(n+=d.time-o))}),i*8/n}static computeRTTAndServerResponseTime(a){let i=new Map;for(let[d,l]of e.estimateRTTByOrigin(a).entries())i.set(d,l.min);let r=i.size?Math.min(...Array.from(i.values())):0,t=e.estimateServerResponseTimeByOrigin(a,{rttByOrigin:i}),o=new Map,n=new Map;for(let[d,l]of t.entries()){let c=i.get(d)||r;o.set(d,c-r),n.set(d,l.median)}return{rtt:r,additionalRttByOrigin:o,serverResponseTimeByOrigin:n}}static analyze(a){let i=e.estimateThroughput(a);return i===null?null:{throughput:i,...e.computeRTTAndServerResponseTime(a)}}static findResourceForUrl(a,i){return a.find(r=>i.startsWith(r.url)&&Vm.equalWithExcludedFragments(r.url,i))}static findLastDocumentForUrl(a,i){let r=a.filter(t=>t.resourceType==="Document"&&!t.failed&&i.startsWith(t.url)&&Vm.equalWithExcludedFragments(t.url,i));return r[r.length-1]}static resolveRedirects(a){for(;a.redirectDestination;)a=a.redirectDestination;return a}}});var ca={};S(ca,{LanternError:()=>J,NetworkAnalyzer:()=>Bt});var dr=_(()=>{p();Q2();KD()});var aa,qm=_(()=>{p();dr();aa=class e{static{s(this,"BaseNode")}static types={NETWORK:"network",CPU:"cpu"};_id;_isMainDocument;dependents;dependencies;constructor(a){this._id=a,this._isMainDocument=!1,this.dependents=[],this.dependencies=[]}get id(){return this._id}get type(){throw new J("Unimplemented")}get startTime(){throw new J("Unimplemented")}get endTime(){throw new J("Unimplemented")}setIsMainDocument(a){this._isMainDocument=a}isMainDocument(){return this._isMainDocument}getDependents(){return this.dependents.slice()}getNumberOfDependents(){return this.dependents.length}getDependencies(){return this.dependencies.slice()}getNumberOfDependencies(){return this.dependencies.length}getRootNode(){let a=this;for(;a.dependencies.length;)a=a.dependencies[0];return a}addDependent(a){a.addDependency(this)}addDependency(a){if(a===this)throw new J("Cannot add dependency on itself");this.dependencies.includes(a)||(a.dependents.push(this),this.dependencies.push(a))}removeDependent(a){a.removeDependency(
|
|
467
467
|
this)}removeDependency(a){if(!this.dependencies.includes(a))return;let i=a.dependents.indexOf(this);a.dependents.splice(i,1),this.dependencies.splice(this.dependencies.indexOf(a),1)}removeAllDependencies(){for(let a of this.dependencies.slice())this.removeDependency(a)}isDependentOn(a){let i=!1;return this.traverse(r=>{i||(i=r===a)},r=>i?[]:r.getDependencies()),i}cloneWithoutRelationships(){let a=new e(this.id);return a.setIsMainDocument(this._isMainDocument),a}cloneWithRelationships(a){let i=this.getRootNode(),r=new Map;i.traverse(o=>{if(!r.has(o.id)){if(a===void 0){r.set(o.id,o.cloneWithoutRelationships());return}a(o)&&o.traverse(n=>r.set(n.id,n.cloneWithoutRelationships()),n=>n.dependencies.filter(d=>!r.has(d.id)))}}),i.traverse(o=>{let n=r.get(o.id);if(n)for(let d of o.dependencies){let l=r.get(d.id);if(!l)throw new J("Dependency somehow not cloned");n.addDependency(l)}});let t=r.get(this.id);if(!t)throw new J("Cloned graph missing node");return t}traverse(a,i){for(let{node:r,traversalPath:t}of this.
|
|
468
468
|
traverseGenerator(i))a(r,t)}*traverseGenerator(a){a||(a=s(t=>t.getDependents(),"getNextNodes"));let i=[[this]],r=new Set([this.id]);for(;i.length;){let t=i.shift(),o=t[0];yield{node:o,traversalPath:t};for(let n of a(o))r.has(n.id)||(r.add(n.id),i.push([n,...t]))}}static findCycle(a,i="both"){if(i==="both")return e.findCycle(a,"dependents")||e.findCycle(a,"dependencies");let r=new Set,t=[],o=[a],n=new Map([[a,0]]);for(;o.length;){let d=o.pop();if(t.includes(d))return t;if(r.has(d))continue;for(;t.length>n.get(d);)t.pop();r.add(d),t.push(d);let l=i==="dependents"?d.dependents:d.dependencies;for(let c of l)o.includes(c)||(o.push(c),n.set(c,t.length))}return null}canDependOn(a){return a.startTime<=this.startTime}}});var xc,eb=_(()=>{p();qm();xc=class e extends aa{static{s(this,"CPUNode")}_event;_childEvents;correctedEndTs;constructor(a,i=[],r){let t=`${a.tid}.${a.ts}`;super(t),this._event=a,this._childEvents=i,this.correctedEndTs=r}get type(){return aa.types.CPU}get startTime(){return this._event.ts}get endTime(){return this.correctedEndTs?this.correctedEndTs:this._event.ts+this._event.dur}get duration(){return this.endTime-this.startTime}get event(){return this._event}get childEvents(){return this._childEvents}didPerformLayout(){return this._childEvents.some(a=>a.name==="Layout")}getEvaluateScriptURLs(){let a=new Set;for(let i of this._childEvents)i.name==="EvaluateScript"&&i.args.data?.url&&a.add(i.args.data.url);return a}cloneWithoutRelationships(){return new e(this._event,this._childEvents,this.correctedEndTs)}}});function YD(e){let a=e.includes(":")?e.slice(0,e.indexOf(":")):e;return jee.includes(a)}var jee,zs,ab=_(()=>{p();qm();jee=["blob","data","intent","file","filesystem","chrome-extension"];s(YD,"isNonNetworkProtocol");zs=class e extends aa{static{s(this,"NetworkNode")}_request;constructor(a){super(a.requestId),this._request=a}get type(){return aa.types.NETWORK}get startTime(){return this._request.rendererStartTime*1e3}get endTime(){return this._request.networkEndTime*1e3}get rawRequest(){return this._request.rawRequest}get request(){return this._request}get initiatorType(){return this._request.initiator.type}get fromDiskCache(){return!!this._request.fromDiskCache}get isNonNetworkProtocol(){return YD(this.request.protocol)||YD(this.request.parsedURL.scheme)}get isConnectionless(){return this.fromDiskCache||this.isNonNetworkProtocol}hasRenderBlockingPriority(){let a=this._request.priority,i=this._request.resourceType==="Script",r=this._request.resourceType==="Document";return a==="VeryHigh"||
|
|
469
469
|
a==="High"&&i||a==="High"&&r}cloneWithoutRelationships(){let a=new e(this._request);return a.setIsMainDocument(this._isMainDocument),a}}});var Gee,Bee,Hee,Uee,Wee,Vee,ib,$D=_(()=>{p();dr();eb();ab();Gee="RunTask",Bee="ThreadControllerImpl::RunTask",Hee="ThreadControllerImpl::DoWork",Uee="TaskQueueManager::ProcessTaskFromWorkQueue",Wee=10,Vee=/^video/,ib=class e{static{s(this,"PageDependencyGraph")}static getNetworkInitiators(a){if(!a.initiator)return[];if(a.initiator.url)return[a.initiator.url];if(a.initiator.type==="script"){let i=new Set,r=a.initiator.stack;for(;r;){let t=r.callFrames||[];for(let o of t)o.url&&i.add(o.url);r=r.parent}return Array.from(i)}return[]}static getNetworkNodeOutput(a){let i=[],r=new Map,t=new Map,o=new Map;return a.forEach(n=>{if(Vee.test(n.mimeType)||n.fromWorker)return;for(;r.has(n.requestId);)n.requestId+=":duplicate";let d=new zs(n);i.push(d);let l=t.get(n.url)||[];if(l.push(d),r.set(n.requestId,d),t.set(n.url,l),n.frameId&&n.resourceType==="Document"&&n.documentURL===n.url){let c=o.has(n.frameId)?null:d;o.set(n.frameId,c)}}),{nodes:i,idToNodeMap:r,urlToNodeMap:t,frameIdToNodeMap:o}}static isScheduleableTask(a){
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Name: Marked
|
|
2
2
|
Short Name: marked
|
|
3
3
|
URL: https://github.com/markedjs/marked
|
|
4
|
-
Version:
|
|
5
|
-
Revision:
|
|
4
|
+
Version: 18.0.4
|
|
5
|
+
Revision: 0a2cd54cbe91911890e4460ae4fd7b9966e05654
|
|
6
6
|
Update Mechanism: Manual
|
|
7
7
|
License: BSD-3-Clause, MIT
|
|
8
8
|
License File: LICENSE
|
|
@@ -14,8 +14,5 @@ Light-weight markdown parser and renderer.
|
|
|
14
14
|
|
|
15
15
|
To update this package, run the following command (replace version number with updated version number):
|
|
16
16
|
```bash
|
|
17
|
-
wget -qO- https://registry.npmjs.org/marked/-/marked-
|
|
17
|
+
wget -qO- https://registry.npmjs.org/marked/-/marked-18.0.4.tgz | tar xzf -
|
|
18
18
|
```
|
|
19
|
-
|
|
20
|
-
Local Modifications:
|
|
21
|
-
- Renamed marked.d.ts to marked.esm.d.ts for TypeScript typechecking.
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
# Marked
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/marked)
|
|
8
|
-
[](https://cdn.jsdelivr.net/npm/marked/marked.min.js)
|
|
9
8
|
[](https://packagephobia.now.sh/result?p=marked)
|
|
10
9
|
[](https://www.npmjs.com/package/marked)
|
|
11
10
|
[](https://github.com/markedjs/marked/actions)
|
|
@@ -18,7 +17,7 @@
|
|
|
18
17
|
|
|
19
18
|
## Demo
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
Check out the [demo page](https://marked.js.org/demo/) to see Marked in action ⛹️
|
|
22
21
|
|
|
23
22
|
## Docs
|
|
24
23
|
|
|
@@ -33,7 +32,7 @@ Also read about:
|
|
|
33
32
|
|
|
34
33
|
**Node.js:** Only [current and LTS](https://nodejs.org/en/about/releases/) Node.js versions are supported. End of life Node.js versions may become incompatible with Marked at any point in time.
|
|
35
34
|
|
|
36
|
-
**Browser:**
|
|
35
|
+
**Browser:** [Baseline Widely Available](https://developer.mozilla.org/en-US/docs/Glossary/Baseline/Compatibility)
|
|
37
36
|
|
|
38
37
|
## Installation
|
|
39
38
|
|
|
@@ -84,7 +83,7 @@ $ marked --help
|
|
|
84
83
|
</head>
|
|
85
84
|
<body>
|
|
86
85
|
<div id="content"></div>
|
|
87
|
-
<script src="https://cdn.jsdelivr.net/npm/marked/marked.
|
|
86
|
+
<script src="https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js"></script>
|
|
88
87
|
<script>
|
|
89
88
|
document.getElementById('content').innerHTML =
|
|
90
89
|
marked.parse('# Marked in the browser\n\nRendered by **marked**.');
|
|
@@ -104,4 +103,5 @@ or import esm module
|
|
|
104
103
|
|
|
105
104
|
## License
|
|
106
105
|
|
|
107
|
-
Copyright (c)
|
|
106
|
+
Copyright (c) 2018+, MarkedJS. (MIT License)
|
|
107
|
+
Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
|