chrome-devtools-frontend 1.0.1582745 → 1.0.1585538
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/host/InspectorFrontendHostAPI.ts +1 -0
- package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
- package/front_end/core/root/Runtime.ts +12 -11
- package/front_end/core/sdk/CSSMatchedStyles.ts +3 -0
- package/front_end/core/sdk/CSSMetadata.ts +3 -0
- package/front_end/core/sdk/NetworkManager.ts +63 -115
- package/front_end/entrypoint_template.html +1 -5
- package/front_end/entrypoints/main/MainImpl.ts +1 -0
- package/front_end/generated/Deprecation.ts +21 -0
- package/front_end/generated/InspectorBackendCommands.ts +5 -3
- package/front_end/generated/SupportedCSSProperties.js +6 -2
- package/front_end/generated/protocol-mapping.d.ts +2 -1
- package/front_end/generated/protocol-proxy-api.d.ts +2 -1
- package/front_end/generated/protocol.ts +14 -0
- package/front_end/models/ai_assistance/AiConversation.ts +34 -2
- package/front_end/models/ai_assistance/BuiltInAi.ts +1 -2
- package/front_end/models/ai_assistance/agents/AiAgent.ts +3 -10
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +17 -9
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +5 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +16 -8
- package/front_end/models/computed_style/ComputedStyleModel.ts +20 -15
- package/front_end/models/greendev/Prototypes.ts +1 -5
- package/front_end/models/issues_manager/CorsIssue.ts +2 -9
- package/front_end/models/issues_manager/descriptions/corsLocalNetworkAccessPermissionDenied.md +2 -2
- package/front_end/models/javascript_metadata/NativeFunctions.js +20 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +28 -39
- package/front_end/panels/ai_assistance/components/ChatInput.ts +73 -95
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +4 -2
- package/front_end/panels/ai_assistance/components/ChatView.ts +0 -2
- package/front_end/panels/autofill/AutofillView.ts +4 -8
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +37 -8
- package/front_end/panels/console/ConsoleView.ts +1 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +18 -11
- package/front_end/panels/elements/ComputedStyleWidget.ts +80 -48
- package/front_end/panels/elements/ElementStatePaneWidget.ts +1 -1
- package/front_end/panels/elements/ElementsPanel.ts +18 -5
- package/front_end/panels/elements/ElementsTreeElement.ts +459 -435
- package/front_end/panels/elements/EventListenersWidget.ts +2 -4
- package/front_end/panels/elements/NodeStackTraceWidget.ts +1 -3
- package/front_end/panels/elements/PropertiesWidget.ts +1 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +18 -2
- package/front_end/panels/elements/computedStyleWidget.css +25 -0
- package/front_end/panels/issues/AffectedResourcesView.ts +1 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +0 -8
- package/front_end/panels/network/NetworkLogView.ts +64 -105
- package/front_end/panels/network/RequestConditionsDrawer.ts +168 -233
- package/front_end/panels/network/network-meta.ts +4 -27
- package/front_end/panels/settings/SettingsScreen.ts +12 -4
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +6 -9
- package/front_end/panels/sources/CallStackSidebarPane.ts +6 -8
- package/front_end/panels/sources/DebuggerPlugin.ts +2 -1
- package/front_end/panels/sources/GoToLineQuickOpen.ts +0 -4
- package/front_end/panels/sources/OpenFileQuickOpen.ts +0 -4
- package/front_end/panels/sources/OutlineQuickOpen.ts +0 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +3 -1
- package/front_end/panels/sources/sources-meta.ts +9 -6
- package/front_end/panels/timeline/TimelineFlameChartView.ts +0 -12
- package/front_end/panels/timeline/TimelinePanel.ts +35 -15
- package/front_end/panels/timeline/components/Sidebar.ts +21 -0
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -20
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +0 -1
- 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/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +1 -1
- 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 +1 -1
- 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/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/encoding.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/encoding.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/encoding.js.map +1 -1
- 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.js +8 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +1 -1
- 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 +1 -1
- 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/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/encoding.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/encoding.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/encoding.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/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +4 -3
- package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/encoding.ts +5 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +3 -0
- package/front_end/ui/components/linkifier/LinkifierUtils.ts +3 -0
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +8 -0
- package/front_end/ui/components/text_editor/AiCodeGenerationParser.ts +29 -7
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +42 -18
- package/front_end/ui/components/text_editor/config.ts +6 -0
- package/front_end/ui/legacy/InspectorView.ts +41 -15
- package/front_end/ui/legacy/Toolbar.ts +12 -4
- package/front_end/ui/legacy/UIUtils.ts +56 -7
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +4 -3
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +2 -1
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +8 -2
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +8 -8
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +12 -9
- package/front_end/ui/legacy/components/utils/Linkifier.ts +116 -87
- package/front_end/ui/legacy/legacy.ts +0 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +4 -0
- package/mcp/HostBindings.ts +3 -0
- package/package.json +1 -1
- package/front_end/models/issues_manager/descriptions/corsInsecurePrivateNetwork.md +0 -10
- package/front_end/models/issues_manager/descriptions/corsPreflightAllowPrivateNetworkError.md +0 -10
- package/front_end/models/issues_manager/descriptions/corsPrivateNetworkPermissionDenied.md +0 -10
- package/front_end/panels/elements/computedStyleSidebarPane.css +0 -18
- package/front_end/ui/legacy/Floaty.ts +0 -438
- package/front_end/ui/legacy/floaty.css +0 -77
|
@@ -183,11 +183,12 @@ function buildStackTraceRows(
|
|
|
183
183
|
let previousStackFrameWasBreakpointCondition = false;
|
|
184
184
|
for (const frame of fragment.frames) {
|
|
185
185
|
const functionName = UI.UIUtils.beautifyFunctionName(frame.name ?? '');
|
|
186
|
-
const link =
|
|
186
|
+
const link = Linkifier.linkifyStackTraceFrame(frame, {
|
|
187
187
|
showColumnNumber,
|
|
188
188
|
tabStop: Boolean(tabStops),
|
|
189
189
|
inlineFrameIndex: 0,
|
|
190
190
|
revealBreakpoint: previousStackFrameWasBreakpointCondition,
|
|
191
|
+
maxLength: UI.UIUtils.MaxLengthForDisplayedURLsInConsole,
|
|
191
192
|
});
|
|
192
193
|
link.setAttribute('jslog', `${VisualLogging.link('stack-trace').track({click: true})}`);
|
|
193
194
|
link.addEventListener('contextmenu', populateContextMenu.bind(null, link));
|
|
@@ -370,14 +371,16 @@ export class StackTracePreviewContent extends UI.Widget.Widget {
|
|
|
370
371
|
return;
|
|
371
372
|
}
|
|
372
373
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
374
|
+
if (runtimeStackTrace) {
|
|
375
|
+
// TODO(crbug.com/456517732): remove when all usages of runtimeStackTrace are migrated.
|
|
376
|
+
const updateCallback =
|
|
377
|
+
renderStackTraceTable.bind(null, this.#table, this.element, this.#options.expandable ?? false);
|
|
378
|
+
const stackTraceRows = buildStackTraceRowsForLegacyRuntimeStackTrace(
|
|
379
|
+
runtimeStackTrace ?? {callFrames: []}, this.#target ?? null, this.#linkifier, tabStops, updateCallback,
|
|
380
|
+
this.#options.showColumnNumber);
|
|
381
|
+
this.#hasRows = stackTraceRows.length > 0;
|
|
382
|
+
this.#links = renderStackTraceTable(this.#table, this.element, this.#options.expandable ?? false, stackTraceRows);
|
|
383
|
+
}
|
|
381
384
|
}
|
|
382
385
|
|
|
383
386
|
get linkElements(): readonly HTMLElement[] {
|
|
@@ -17,10 +17,12 @@ import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
|
17
17
|
import type * as Trace from '../../../../models/trace/trace.js';
|
|
18
18
|
import * as Workspace from '../../../../models/workspace/workspace.js';
|
|
19
19
|
import * as UIHelpers from '../../../helpers/helpers.js';
|
|
20
|
-
import {html, type LitTemplate, render} from '../../../lit/lit.js';
|
|
20
|
+
import {Directives, html, type LitTemplate, render} from '../../../lit/lit.js';
|
|
21
21
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
22
22
|
import * as UI from '../../legacy.js';
|
|
23
23
|
|
|
24
|
+
const {ref, ifDefined, classMap} = Directives;
|
|
25
|
+
|
|
24
26
|
const UIStrings = {
|
|
25
27
|
/**
|
|
26
28
|
* @description Text in Linkifier
|
|
@@ -228,7 +230,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
228
230
|
sourceURL: Platform.DevToolsPath.UrlString, lineNumber: number|undefined, options?: LinkifyOptions): HTMLElement
|
|
229
231
|
|null {
|
|
230
232
|
let fallbackAnchor: HTMLElement|null = null;
|
|
231
|
-
const linkifyURLOptions
|
|
233
|
+
const linkifyURLOptions = {
|
|
232
234
|
lineNumber,
|
|
233
235
|
maxLength: options?.maxLength ?? this.maxLength,
|
|
234
236
|
columnNumber: options?.columnNumber,
|
|
@@ -239,7 +241,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
239
241
|
userMetric: options?.userMetric,
|
|
240
242
|
jslogContext: options?.jslogContext || 'script-location',
|
|
241
243
|
omitOrigin: options?.omitOrigin,
|
|
242
|
-
};
|
|
244
|
+
} satisfies LinkifyURLOptions;
|
|
243
245
|
const {columnNumber, className = ''} = linkifyURLOptions;
|
|
244
246
|
if (sourceURL) {
|
|
245
247
|
fallbackAnchor = Linkifier.linkifyURL(sourceURL, linkifyURLOptions);
|
|
@@ -280,6 +282,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
280
282
|
|
|
281
283
|
const linkDisplayOptions: LinkDisplayOptions = {
|
|
282
284
|
showColumnNumber: linkifyURLOptions.showColumnNumber ?? false,
|
|
285
|
+
maxLength: linkifyURLOptions.maxLength,
|
|
283
286
|
revealBreakpoint: options?.revealBreakpoint,
|
|
284
287
|
};
|
|
285
288
|
|
|
@@ -344,12 +347,10 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
344
347
|
callFrame.url as Platform.DevToolsPath.UrlString, callFrame.lineNumber, linkifyOptions);
|
|
345
348
|
}
|
|
346
349
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
const linkifyURLOptions: LinkifyURLOptions = {
|
|
350
|
+
static linkifyStackTraceFrame(frame: StackTrace.StackTrace.Frame, options?: LinkifyOptions): HTMLElement {
|
|
351
|
+
const linkifyURLOptions = {
|
|
350
352
|
...options,
|
|
351
353
|
lineNumber: frame.line,
|
|
352
|
-
maxLength: this.maxLength,
|
|
353
354
|
columnNumber: frame.column,
|
|
354
355
|
showColumnNumber: Boolean(options?.showColumnNumber),
|
|
355
356
|
className: options?.className,
|
|
@@ -358,10 +359,10 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
358
359
|
userMetric: options?.userMetric,
|
|
359
360
|
jslogContext: options?.jslogContext || 'script-location',
|
|
360
361
|
omitOrigin: options?.omitOrigin,
|
|
361
|
-
};
|
|
362
|
+
} satisfies LinkifyURLOptions;
|
|
362
363
|
const {className = ''} = linkifyURLOptions;
|
|
363
364
|
const fallbackAnchor = Linkifier.linkifyURL(frame.url as Platform.DevToolsPath.UrlString, linkifyURLOptions);
|
|
364
|
-
if (!
|
|
365
|
+
if (!frame.uiSourceCode) {
|
|
365
366
|
return fallbackAnchor;
|
|
366
367
|
}
|
|
367
368
|
|
|
@@ -371,20 +372,18 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
371
372
|
};
|
|
372
373
|
const {link, linkInfo} = Linkifier.createLink(
|
|
373
374
|
fallbackAnchor?.textContent ? fallbackAnchor.textContent : '', className, createLinkOptions);
|
|
374
|
-
linkInfo.enableDecorator = this.useLinkDecorator;
|
|
375
375
|
linkInfo.fallback = fallbackAnchor;
|
|
376
376
|
linkInfo.userMetric = options?.userMetric;
|
|
377
377
|
|
|
378
378
|
const linkDisplayOptions: LinkDisplayOptions = {
|
|
379
379
|
showColumnNumber: linkifyURLOptions.showColumnNumber ?? false,
|
|
380
|
+
maxLength: linkifyURLOptions.maxLength ?? UI.UIUtils.MaxLengthForDisplayedURLs,
|
|
380
381
|
revealBreakpoint: options?.revealBreakpoint,
|
|
381
382
|
};
|
|
382
383
|
|
|
383
384
|
const uiLocation = frame.uiSourceCode.uiLocation(frame.line, frame.column) ?? null;
|
|
384
|
-
|
|
385
|
+
Linkifier.updateAnchorFromUILocation(link, linkDisplayOptions, uiLocation);
|
|
385
386
|
|
|
386
|
-
const anchors = (this.anchorsByTarget.get(target) as Element[]);
|
|
387
|
-
anchors.push(link);
|
|
388
387
|
return link;
|
|
389
388
|
}
|
|
390
389
|
|
|
@@ -422,7 +421,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
422
421
|
linkInfo.enableDecorator = this.useLinkDecorator;
|
|
423
422
|
linkInfo.fallback = fallbackAnchor;
|
|
424
423
|
|
|
425
|
-
const linkDisplayOptions = {showColumnNumber: false};
|
|
424
|
+
const linkDisplayOptions = {showColumnNumber: false, maxLength: this.maxLength};
|
|
426
425
|
|
|
427
426
|
const updateDelegate = async(liveLocation: Bindings.LiveLocation.LiveLocation): Promise<void> => {
|
|
428
427
|
await this.updateAnchor(link, linkDisplayOptions, liveLocation);
|
|
@@ -453,7 +452,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
453
452
|
return link;
|
|
454
453
|
}
|
|
455
454
|
|
|
456
|
-
const linkDisplayOptions = {showColumnNumber: false};
|
|
455
|
+
const linkDisplayOptions = {showColumnNumber: false, maxLength: this.maxLength};
|
|
457
456
|
|
|
458
457
|
const updateDelegate = async(liveLocation: Bindings.LiveLocation.LiveLocation): Promise<void> => {
|
|
459
458
|
await this.updateAnchor(link, linkDisplayOptions, liveLocation);
|
|
@@ -509,10 +508,10 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
509
508
|
this.#anchorUpdaters.set(anchor, function(this: Linkifier, anchor: HTMLElement) {
|
|
510
509
|
void this.updateAnchor(anchor, options, liveLocation);
|
|
511
510
|
});
|
|
512
|
-
|
|
511
|
+
Linkifier.updateAnchorFromUILocation(anchor, options, uiLocation);
|
|
513
512
|
}
|
|
514
513
|
|
|
515
|
-
private updateAnchorFromUILocation(
|
|
514
|
+
private static updateAnchorFromUILocation(
|
|
516
515
|
anchor: HTMLElement, options: LinkDisplayOptions, uiLocation: Workspace.UISourceCode.UILocation|null): void {
|
|
517
516
|
if (!uiLocation) {
|
|
518
517
|
anchor.classList.add('invalid-link');
|
|
@@ -526,7 +525,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
526
525
|
}
|
|
527
526
|
|
|
528
527
|
const text = uiLocation.linkText(true /* skipTrim */, options.showColumnNumber);
|
|
529
|
-
Linkifier.setTrimmedText(anchor, text,
|
|
528
|
+
Linkifier.setTrimmedText(anchor, text, options.maxLength);
|
|
530
529
|
|
|
531
530
|
let titleText: string = uiLocation.uiSourceCode.url();
|
|
532
531
|
if (uiLocation.uiSourceCode.mimeType() === 'application/wasm') {
|
|
@@ -563,7 +562,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
563
562
|
info.icon = icon;
|
|
564
563
|
}
|
|
565
564
|
|
|
566
|
-
static
|
|
565
|
+
static renderLinkifiedUrl(url: Platform.DevToolsPath.UrlString, options?: LinkifyURLOptions): LitTemplate {
|
|
567
566
|
options = options || {
|
|
568
567
|
showColumnNumber: false,
|
|
569
568
|
inlineFrameIndex: 0,
|
|
@@ -578,16 +577,14 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
578
577
|
const maxLength = options.maxLength || UI.UIUtils.MaxLengthForDisplayedURLs;
|
|
579
578
|
const bypassURLTrimming = options.bypassURLTrimming;
|
|
580
579
|
const omitOrigin = options.omitOrigin;
|
|
581
|
-
if (!url || Common.ParsedURL.schemeIs(url, 'javascript:')) {
|
|
582
|
-
const element = document.createElement('span');
|
|
583
|
-
if (className) {
|
|
584
|
-
element.className = className;
|
|
585
|
-
}
|
|
586
580
|
|
|
587
|
-
|
|
588
|
-
|
|
581
|
+
if (!url || Common.ParsedURL.schemeIs(url, 'javascript:')) {
|
|
582
|
+
// clang-format off
|
|
583
|
+
return html`<span class=${className}>${text || url || i18nString(UIStrings.unknown)}</span>`;
|
|
584
|
+
// clang-format on
|
|
589
585
|
}
|
|
590
586
|
|
|
587
|
+
// FIXME: Bindings.ResourceUtils.displayNameForURL should be called in presenters.
|
|
591
588
|
let linkText = text || Bindings.ResourceUtils.displayNameForURL(url);
|
|
592
589
|
|
|
593
590
|
if (omitOrigin) {
|
|
@@ -612,16 +609,20 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
612
609
|
tabStop: options.tabStop,
|
|
613
610
|
bypassURLTrimming,
|
|
614
611
|
jslogContext: options.jslogContext || 'url',
|
|
612
|
+
lineNumber,
|
|
613
|
+
columnNumber,
|
|
614
|
+
userMetric: options?.userMetric
|
|
615
615
|
};
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
616
|
+
return Linkifier.renderLink(linkText, className, linkOptions);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* @deprecated use renderLinkifiedUrl.
|
|
621
|
+
*/
|
|
622
|
+
static linkifyURL(url: Platform.DevToolsPath.UrlString, options?: LinkifyURLOptions): HTMLElement {
|
|
623
|
+
const container = document.createDocumentFragment();
|
|
624
|
+
render(Linkifier.renderLinkifiedUrl(url, options), container);
|
|
625
|
+
return container.firstElementChild as HTMLElement;
|
|
625
626
|
}
|
|
626
627
|
|
|
627
628
|
static linkifyRevealable(
|
|
@@ -638,64 +639,88 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
638
639
|
return link;
|
|
639
640
|
}
|
|
640
641
|
|
|
641
|
-
private static
|
|
642
|
-
{link: HTMLElement, linkInfo: LinkInfo} {
|
|
642
|
+
private static renderLink(text: string|HTMLElement, className: string, options: CreateLinkOptions = {}): LitTemplate {
|
|
643
643
|
const {maxLength, title, href, preventClick, tabStop, bypassURLTrimming, jslogContext} = options;
|
|
644
|
-
const
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
if (href) {
|
|
656
|
-
// @ts-expect-error
|
|
657
|
-
link.href = href;
|
|
658
|
-
}
|
|
659
|
-
link.setAttribute('jslog', `${VisualLogging.link(jslogContext).track({click: true})}`);
|
|
660
|
-
|
|
661
|
-
if (text instanceof HTMLElement) {
|
|
662
|
-
link.appendChild(text);
|
|
663
|
-
} else if (bypassURLTrimming) {
|
|
664
|
-
link.classList.add('devtools-link-styled-trim');
|
|
665
|
-
Linkifier.appendTextWithoutHashes(link, text);
|
|
666
|
-
} else {
|
|
667
|
-
Linkifier.setTrimmedText(link, text, maxLength);
|
|
644
|
+
const classes: Record<string, boolean> = {
|
|
645
|
+
'devtools-link': true,
|
|
646
|
+
'text-button': !preventClick,
|
|
647
|
+
'link-style': !preventClick,
|
|
648
|
+
'devtools-link-prevent-click': !!preventClick,
|
|
649
|
+
};
|
|
650
|
+
// More than one class name may be passed.
|
|
651
|
+
for (const cls of className.split(' ')) {
|
|
652
|
+
if (cls) {
|
|
653
|
+
classes[cls] = true;
|
|
654
|
+
}
|
|
668
655
|
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
lineNumber: null,
|
|
677
|
-
columnNumber: null,
|
|
678
|
-
inlineFrameIndex: 0,
|
|
679
|
-
revealable: null,
|
|
680
|
-
fallback: null,
|
|
656
|
+
const handler = (event: MouseEvent|KeyboardEvent): void => {
|
|
657
|
+
if (event instanceof KeyboardEvent && event.key !== Platform.KeyboardUtilities.ENTER_KEY && event.key !== ' ') {
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
if (Linkifier.handleClick(event)) {
|
|
661
|
+
event.consume(true);
|
|
662
|
+
}
|
|
681
663
|
};
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
if (event instanceof KeyboardEvent && event.key !== Platform.KeyboardUtilities.ENTER_KEY && event.key !== ' ') {
|
|
664
|
+
const createRef = (): ReturnType<typeof ref> => {
|
|
665
|
+
return ref(link => {
|
|
666
|
+
if (!link) {
|
|
686
667
|
return;
|
|
687
668
|
}
|
|
688
|
-
if (
|
|
689
|
-
|
|
669
|
+
if (text instanceof HTMLElement) {
|
|
670
|
+
link.appendChild(text);
|
|
671
|
+
} else if (bypassURLTrimming) {
|
|
672
|
+
link.classList.add('devtools-link-styled-trim');
|
|
673
|
+
Linkifier.appendTextWithoutHashes(link, text);
|
|
674
|
+
} else {
|
|
675
|
+
Linkifier.setTrimmedText(link, text, maxLength);
|
|
690
676
|
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
677
|
+
const linkInfo = {
|
|
678
|
+
icon: null,
|
|
679
|
+
enableDecorator: false,
|
|
680
|
+
uiLocation: null,
|
|
681
|
+
liveLocation: null,
|
|
682
|
+
url: options.href || null,
|
|
683
|
+
lineNumber: options.lineNumber ?? null,
|
|
684
|
+
columnNumber: options.columnNumber ?? null,
|
|
685
|
+
inlineFrameIndex: 0,
|
|
686
|
+
revealable: null,
|
|
687
|
+
fallback: null,
|
|
688
|
+
userMetric: options.userMetric,
|
|
689
|
+
};
|
|
690
|
+
infoByAnchor.set(link, linkInfo);
|
|
691
|
+
});
|
|
692
|
+
};
|
|
693
|
+
const jslog = VisualLogging.link(jslogContext).track({click: true});
|
|
694
|
+
// clang-format off
|
|
695
|
+
return preventClick ? html`<span
|
|
696
|
+
class=${classMap(classes)}
|
|
697
|
+
.href=${href}
|
|
698
|
+
title=${ifDefined(title ? title : undefined)}
|
|
699
|
+
jslog=${jslog}
|
|
700
|
+
.tabIndex=${tabStop ? 0 : -1}
|
|
701
|
+
role="link"
|
|
702
|
+
${createRef()}></span>` : html`<button
|
|
703
|
+
@click=${handler}
|
|
704
|
+
@keydown=${handler}
|
|
705
|
+
class=${classMap(classes)}
|
|
706
|
+
.href=${href}
|
|
707
|
+
title=${ifDefined(title ? title : undefined)}
|
|
708
|
+
jslog=${jslog}
|
|
709
|
+
.tabIndex=${tabStop ? 0 : -1}
|
|
710
|
+
role="link"
|
|
711
|
+
${createRef()}></button>`;
|
|
712
|
+
// clang-format on
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* @deprecated use renderLink.
|
|
717
|
+
*/
|
|
718
|
+
private static createLink(text: string|HTMLElement, className: string, options: CreateLinkOptions = {}):
|
|
719
|
+
{link: HTMLElement, linkInfo: LinkInfo} {
|
|
720
|
+
const container = document.createDocumentFragment();
|
|
721
|
+
render(Linkifier.renderLink(text, className, options), container);
|
|
722
|
+
const link = container.firstElementChild as HTMLElement;
|
|
723
|
+
const linkInfo = infoByAnchor.get(link) as LinkInfo;
|
|
699
724
|
return {link, linkInfo};
|
|
700
725
|
}
|
|
701
726
|
|
|
@@ -1155,10 +1180,14 @@ interface CreateLinkOptions {
|
|
|
1155
1180
|
tabStop?: boolean;
|
|
1156
1181
|
bypassURLTrimming?: boolean;
|
|
1157
1182
|
jslogContext?: string;
|
|
1183
|
+
lineNumber?: number;
|
|
1184
|
+
columnNumber?: number;
|
|
1185
|
+
userMetric?: Host.UserMetrics.Action;
|
|
1158
1186
|
}
|
|
1159
1187
|
|
|
1160
1188
|
interface LinkDisplayOptions {
|
|
1161
1189
|
showColumnNumber: boolean;
|
|
1190
|
+
maxLength: number;
|
|
1162
1191
|
|
|
1163
1192
|
/**
|
|
1164
1193
|
* If true, we'll check if there is a breakpoint at the UILocation we get
|
|
@@ -15,7 +15,6 @@ import * as DropTarget from './DropTarget.js';
|
|
|
15
15
|
import * as EmptyWidget from './EmptyWidget.js';
|
|
16
16
|
import * as FilterBar from './FilterBar.js';
|
|
17
17
|
import * as FilterSuggestionBuilder from './FilterSuggestionBuilder.js';
|
|
18
|
-
import * as Floaty from './Floaty.js';
|
|
19
18
|
import * as ForwardedInputEventHandler from './ForwardedInputEventHandler.js';
|
|
20
19
|
import * as Fragment from './Fragment.js';
|
|
21
20
|
import * as GlassPane from './GlassPane.js';
|
|
@@ -67,7 +66,6 @@ export {
|
|
|
67
66
|
EmptyWidget,
|
|
68
67
|
FilterBar,
|
|
69
68
|
FilterSuggestionBuilder,
|
|
70
|
-
Floaty,
|
|
71
69
|
ForwardedInputEventHandler,
|
|
72
70
|
Fragment,
|
|
73
71
|
GlassPane,
|
|
@@ -842,6 +842,7 @@ export const knownContextValues = new Set([
|
|
|
842
842
|
'columns',
|
|
843
843
|
'combined-diff-view.copy',
|
|
844
844
|
'comic-sans-ms',
|
|
845
|
+
'command',
|
|
845
846
|
'command-editor',
|
|
846
847
|
'command-input',
|
|
847
848
|
'commit',
|
|
@@ -1271,6 +1272,7 @@ export const knownContextValues = new Set([
|
|
|
1271
1272
|
'device-bound-sessions-empty',
|
|
1272
1273
|
'device-bound-sessions-preserve-log',
|
|
1273
1274
|
'device-bound-sessions-request',
|
|
1275
|
+
'device-bound-sessions-root',
|
|
1274
1276
|
'device-fold',
|
|
1275
1277
|
'device-frame-enable',
|
|
1276
1278
|
'device-mode',
|
|
@@ -2494,6 +2496,7 @@ export const knownContextValues = new Set([
|
|
|
2494
2496
|
'main-menu',
|
|
2495
2497
|
'main-selected-tab',
|
|
2496
2498
|
'main-tab-order',
|
|
2499
|
+
'main.chrome-restart-chrome',
|
|
2497
2500
|
'main.debug-reload',
|
|
2498
2501
|
'main.next-tab',
|
|
2499
2502
|
'main.previous-tab',
|
|
@@ -3902,6 +3905,7 @@ export const knownContextValues = new Set([
|
|
|
3902
3905
|
'timeline-show-postmessage-events',
|
|
3903
3906
|
'timeline-show-screenshots',
|
|
3904
3907
|
'timeline-show-settings-toolbar',
|
|
3908
|
+
'timeline-sidebar-opened-at-least-once',
|
|
3905
3909
|
'timeline-status',
|
|
3906
3910
|
'timeline-tree-current-thread',
|
|
3907
3911
|
'timeline-tree-group-by',
|
package/mcp/HostBindings.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Ensure private network requests are made from secure contexts
|
|
2
|
-
|
|
3
|
-
A site requested a resource from a network that it could only access because of its users' privileged network position.
|
|
4
|
-
These requests expose devices and servers to the internet, increasing the risk of a cross-site request forgery (CSRF) attack, and/or information leakage.
|
|
5
|
-
|
|
6
|
-
To mitigate these risks, Chrome deprecates requests to non-public subresources when initiated from non-secure contexts. See the [feature status](PNASecureContextRestrictionFeatureStatus).
|
|
7
|
-
|
|
8
|
-
To fix this issue, migrate the website that needs to access local resources to HTTPS. If the target resource is not served on localhost, it must also be served on HTTPS to avoid mixed-content issues.
|
|
9
|
-
|
|
10
|
-
Administrators can make use of the `InsecurePrivateNetworkRequestsAllowed` and `InsecurePrivateNetworkRequestsAllowedForUrls` enterprise policies to temporarily disable this restriction on all or certain websites.
|
package/front_end/models/issues_manager/descriptions/corsPreflightAllowPrivateNetworkError.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Ensure private network requests are only made to resources that allow them
|
|
2
|
-
|
|
3
|
-
A site requested a resource from a network that it could only access because of its users' privileged network position.
|
|
4
|
-
These requests expose devices and servers to the internet, increasing the risk of a cross-site request forgery (CSRF) attack, and/or information leakage.
|
|
5
|
-
|
|
6
|
-
To mitigate these risks, Chrome will require non-public subresources to opt-into being accessed with a preflight request and will start blocking them in Chrome 130 (October 2024).
|
|
7
|
-
|
|
8
|
-
To fix this issue, ensure that response to the [preflight request](issueCorsPreflightRequest) for the private network resource has the `Access-Control-Allow-Private-Network` header set to `true`.
|
|
9
|
-
|
|
10
|
-
Administrators can make use of the `InsecurePrivateNetworkRequestsAllowed` and `InsecurePrivateNetworkRequestsAllowedForUrls` enterprise policies to temporarily disable this restriction on all or certain websites.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Ensure that private network requests made from secure context to plaintext resources can gain access based on user permission
|
|
2
|
-
|
|
3
|
-
A site requested a resource from a network that it could only access because of its users' privileged network position.
|
|
4
|
-
These requests expose devices and servers to the internet, increasing the risk of a cross-site request forgery (CSRF) attack and/or information leakage.
|
|
5
|
-
|
|
6
|
-
To mitigate these risks, Chrome deprecates requests to non-public subresources when initiated from non-secure contexts. See the [feature status](PNASecureContextRestrictionFeatureStatus).
|
|
7
|
-
|
|
8
|
-
Setting a `targetAddressSpace` fetch option to `private` or `local` allows secure contexts to fetch private network resources over HTTP, which is normally forbidden by mixed-content checks. The target server must respond affirmatively to a preflight request, and the user must grant explicit permission.
|
|
9
|
-
|
|
10
|
-
Make sure that the response to the [preflight request](issueCorsPreflightRequest) for the private network resource has the `Private-Network-Access-Id` and `Private-Network-Access-Name` header properly set. `Private-Network-Access-Id` should be the device's MAC address and `Private-Network-Access-Name` should be a human-friendly device name.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2015 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
|
-
.styles-sidebar-pane-toolbar {
|
|
8
|
-
border-bottom: 1px solid var(--sys-color-divider);
|
|
9
|
-
flex-shrink: 0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.styles-sidebar-computed-style-widget {
|
|
13
|
-
min-height: auto;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.styles-pane-toolbar {
|
|
17
|
-
width: 100%;
|
|
18
|
-
}
|