chrome-devtools-frontend 1.0.1583146 → 1.0.1585664
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 -6
- package/front_end/core/sdk/CSSMatchedStyles.ts +3 -0
- package/front_end/core/sdk/CSSMetadata.ts +3 -0
- 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 +10 -4
- 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_completion/AiCodeCompletion.ts +12 -0
- 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 +13 -36
- package/front_end/panels/ai_assistance/components/ChatInput.ts +73 -95
- package/front_end/panels/ai_assistance/components/ChatView.ts +13 -2
- package/front_end/panels/application/FrameDetailsView.ts +4 -9
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +10 -0
- package/front_end/panels/console/ConsoleView.ts +1 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +19 -12
- package/front_end/panels/elements/ComputedStyleWidget.ts +41 -21
- package/front_end/panels/elements/ElementsPanel.ts +18 -5
- package/front_end/panels/elements/ElementsTreeElement.ts +173 -169
- package/front_end/panels/elements/NodeStackTraceWidget.ts +3 -13
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +69 -0
- package/front_end/panels/elements/computedStyleWidget.css +1 -6
- package/front_end/panels/elements/elements.ts +3 -1
- package/front_end/panels/issues/AffectedResourcesView.ts +1 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +0 -8
- package/front_end/panels/network/RequestConditionsDrawer.ts +138 -112
- package/front_end/panels/network/RequestInitiatorView.ts +2 -10
- package/front_end/panels/settings/SettingsScreen.ts +12 -4
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +6 -9
- package/front_end/panels/sources/CallStackSidebarPane.ts +4 -6
- 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/TimelineUIUtils.ts +2 -6
- 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/AiCodeGenerationParser.ts +29 -7
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +34 -18
- package/front_end/ui/legacy/InspectorView.ts +41 -15
- package/front_end/ui/legacy/UIUtils.ts +30 -6
- 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 +20 -150
- package/front_end/ui/legacy/components/utils/Linkifier.ts +120 -87
- package/front_end/ui/legacy/components/utils/jsUtils.css +0 -9
- package/front_end/ui/legacy/legacy.ts +0 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -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/ui/legacy/Floaty.ts +0 -438
- package/front_end/ui/legacy/floaty.css +0 -77
|
@@ -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, type TemplateResult} 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): TemplateResult {
|
|
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,90 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
638
639
|
return link;
|
|
639
640
|
}
|
|
640
641
|
|
|
641
|
-
private static
|
|
642
|
-
|
|
642
|
+
private static renderLink(text: string|HTMLElement, className: string, options: CreateLinkOptions = {}):
|
|
643
|
+
TemplateResult {
|
|
643
644
|
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);
|
|
645
|
+
const classes: Record<string, boolean> = {
|
|
646
|
+
'devtools-link': true,
|
|
647
|
+
'text-button': !preventClick,
|
|
648
|
+
'link-style': !preventClick,
|
|
649
|
+
'devtools-link-prevent-click': !!preventClick,
|
|
650
|
+
};
|
|
651
|
+
// More than one class name may be passed.
|
|
652
|
+
for (const cls of className.split(' ')) {
|
|
653
|
+
if (cls) {
|
|
654
|
+
classes[cls] = true;
|
|
655
|
+
}
|
|
668
656
|
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
lineNumber: null,
|
|
677
|
-
columnNumber: null,
|
|
678
|
-
inlineFrameIndex: 0,
|
|
679
|
-
revealable: null,
|
|
680
|
-
fallback: null,
|
|
657
|
+
const handler = (event: MouseEvent|KeyboardEvent): void => {
|
|
658
|
+
if (event instanceof KeyboardEvent && event.key !== Platform.KeyboardUtilities.ENTER_KEY && event.key !== ' ') {
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
if (Linkifier.handleClick(event)) {
|
|
662
|
+
event.consume(true);
|
|
663
|
+
}
|
|
681
664
|
};
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
if (event instanceof KeyboardEvent && event.key !== Platform.KeyboardUtilities.ENTER_KEY && event.key !== ' ') {
|
|
665
|
+
const createRef = (): ReturnType<typeof ref> => {
|
|
666
|
+
return ref(link => {
|
|
667
|
+
if (!link) {
|
|
686
668
|
return;
|
|
687
669
|
}
|
|
688
|
-
|
|
689
|
-
|
|
670
|
+
options.onRef?.(link as HTMLElement);
|
|
671
|
+
if (text instanceof HTMLElement) {
|
|
672
|
+
link.appendChild(text);
|
|
673
|
+
} else if (bypassURLTrimming) {
|
|
674
|
+
link.classList.add('devtools-link-styled-trim');
|
|
675
|
+
Linkifier.appendTextWithoutHashes(link, text);
|
|
676
|
+
} else {
|
|
677
|
+
Linkifier.setTrimmedText(link, text, maxLength);
|
|
690
678
|
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
679
|
+
const linkInfo = {
|
|
680
|
+
icon: null,
|
|
681
|
+
enableDecorator: false,
|
|
682
|
+
uiLocation: null,
|
|
683
|
+
liveLocation: null,
|
|
684
|
+
url: options.href || null,
|
|
685
|
+
lineNumber: options.lineNumber ?? null,
|
|
686
|
+
columnNumber: options.columnNumber ?? null,
|
|
687
|
+
inlineFrameIndex: 0,
|
|
688
|
+
revealable: null,
|
|
689
|
+
fallback: null,
|
|
690
|
+
userMetric: options.userMetric,
|
|
691
|
+
};
|
|
692
|
+
infoByAnchor.set(link, linkInfo);
|
|
693
|
+
});
|
|
694
|
+
};
|
|
695
|
+
const jslog = VisualLogging.link(jslogContext).track({click: true});
|
|
696
|
+
// clang-format off
|
|
697
|
+
return preventClick ? html`<span
|
|
698
|
+
class=${classMap(classes)}
|
|
699
|
+
.href=${href}
|
|
700
|
+
title=${ifDefined(title ? title : undefined)}
|
|
701
|
+
jslog=${jslog}
|
|
702
|
+
.tabIndex=${tabStop ? 0 : -1}
|
|
703
|
+
role="link"
|
|
704
|
+
${createRef()}></span>` : html`<button
|
|
705
|
+
@click=${handler}
|
|
706
|
+
@keydown=${handler}
|
|
707
|
+
class=${classMap(classes)}
|
|
708
|
+
.href=${href}
|
|
709
|
+
title=${ifDefined(title ? title : undefined)}
|
|
710
|
+
jslog=${jslog}
|
|
711
|
+
.tabIndex=${tabStop ? 0 : -1}
|
|
712
|
+
role="link"
|
|
713
|
+
${createRef()}></button>`;
|
|
714
|
+
// clang-format on
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* @deprecated use renderLink.
|
|
719
|
+
*/
|
|
720
|
+
private static createLink(text: string|HTMLElement, className: string, options: CreateLinkOptions = {}):
|
|
721
|
+
{link: HTMLElement, linkInfo: LinkInfo} {
|
|
722
|
+
const container = document.createDocumentFragment();
|
|
723
|
+
render(Linkifier.renderLink(text, className, options), container);
|
|
724
|
+
const link = container.firstElementChild as HTMLElement;
|
|
725
|
+
const linkInfo = infoByAnchor.get(link) as LinkInfo;
|
|
699
726
|
return {link, linkInfo};
|
|
700
727
|
}
|
|
701
728
|
|
|
@@ -1128,6 +1155,7 @@ export interface LinkifyURLOptions {
|
|
|
1128
1155
|
userMetric?: Host.UserMetrics.Action;
|
|
1129
1156
|
jslogContext?: string;
|
|
1130
1157
|
omitOrigin?: boolean;
|
|
1158
|
+
onRef?: (el: HTMLElement) => void;
|
|
1131
1159
|
}
|
|
1132
1160
|
|
|
1133
1161
|
export interface LinkifyOptions {
|
|
@@ -1155,10 +1183,15 @@ interface CreateLinkOptions {
|
|
|
1155
1183
|
tabStop?: boolean;
|
|
1156
1184
|
bypassURLTrimming?: boolean;
|
|
1157
1185
|
jslogContext?: string;
|
|
1186
|
+
lineNumber?: number;
|
|
1187
|
+
columnNumber?: number;
|
|
1188
|
+
userMetric?: Host.UserMetrics.Action;
|
|
1189
|
+
onRef?: (el: HTMLElement) => void;
|
|
1158
1190
|
}
|
|
1159
1191
|
|
|
1160
1192
|
interface LinkDisplayOptions {
|
|
1161
1193
|
showColumnNumber: boolean;
|
|
1194
|
+
maxLength: number;
|
|
1162
1195
|
|
|
1163
1196
|
/**
|
|
1164
1197
|
* 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',
|
|
@@ -2495,6 +2496,7 @@ export const knownContextValues = new Set([
|
|
|
2495
2496
|
'main-menu',
|
|
2496
2497
|
'main-selected-tab',
|
|
2497
2498
|
'main-tab-order',
|
|
2499
|
+
'main.chrome-restart-chrome',
|
|
2498
2500
|
'main.debug-reload',
|
|
2499
2501
|
'main.next-tab',
|
|
2500
2502
|
'main.previous-tab',
|
|
@@ -3903,6 +3905,7 @@ export const knownContextValues = new Set([
|
|
|
3903
3905
|
'timeline-show-postmessage-events',
|
|
3904
3906
|
'timeline-show-screenshots',
|
|
3905
3907
|
'timeline-show-settings-toolbar',
|
|
3908
|
+
'timeline-sidebar-opened-at-least-once',
|
|
3906
3909
|
'timeline-status',
|
|
3907
3910
|
'timeline-tree-current-thread',
|
|
3908
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.
|