chrome-devtools-frontend 1.0.1733843 → 1.0.1736236
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/.agents/rules/tests/test-view-and-presenter-isolation.md +4 -4
- package/.agents/rules/ui-and-widgets/ui-declarative-tree-and-prompt-patterns.md +61 -0
- package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +11 -7
- package/.agents/rules/ui-and-widgets/ui-modern-component-and-encapsulation-standards.md +13 -4
- package/.agents/rules/ui-and-widgets/ui-pure-view-and-presenter-separation.md +31 -2
- package/.agents/rules/ui-and-widgets/ui-reactive-widget-update-lifecycle.md +23 -4
- package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +34 -3
- package/.agents/skills/code-review/SKILL.md +27 -0
- package/.agents/skills/devtools-uistrings/SKILL.md +147 -0
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +27 -1
- package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +100 -0
- package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +16 -0
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +13 -2
- package/.agents/skills/ui-widgets/SKILL.md +25 -25
- package/DIR_METADATA +8 -1
- package/docs/cookbook/localization.md +1 -1
- package/docs/ui_engineering.md +24 -0
- package/eslint.config.mjs +0 -1
- package/front_end/application_tokens.css +1 -1
- package/front_end/core/host/AidaClient.ts +147 -202
- package/front_end/core/host/AidaClientTypes.ts +9 -0
- package/front_end/core/host/AidaErrors.ts +416 -0
- package/front_end/core/host/AidaGcaTranslation.ts +11 -0
- package/front_end/core/host/InspectorFrontendHostAPI.ts +9 -2
- package/front_end/core/host/UserMetrics.ts +25 -0
- package/front_end/core/host/UserMetricsEnums.ts +25 -0
- package/front_end/core/host/host.ts +3 -1
- package/front_end/core/i18n/collect-ui-strings.js +20 -0
- package/front_end/core/root/Runtime.ts +12 -0
- package/front_end/core/sdk/CPUThrottlingManager.ts +3 -0
- package/front_end/core/sdk/EnhancedTracesParser.ts +8 -4
- package/front_end/core/sdk/NetworkManager.ts +0 -6
- package/front_end/core/sdk/OverlayModel.ts +0 -6
- package/front_end/core/sdk/PreloadingModel.ts +30 -13
- package/front_end/core/sdk/PrivateVerificationTokensModel.ts +0 -18
- package/front_end/core/sdk/RehydratingConnection.ts +5 -2
- package/front_end/core/sdk/ResourceTreeModel.ts +0 -42
- package/front_end/core/sdk/ScreenCaptureModel.ts +0 -84
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -15
- package/front_end/core/sdk/StorageBucketsModel.ts +0 -15
- package/front_end/devtools_compatibility.js +57 -2
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +4 -2
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +203 -127
- package/front_end/entrypoints/inspector_main/renderingOptions.css +5 -0
- package/front_end/entrypoints/node_app/app/NodeMain.ts +0 -9
- package/front_end/entrypoints/node_app/app/nodeConnectionsPanel.css +0 -22
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.ts +0 -136
- package/front_end/generated/protocol-proxy-api.d.ts +231 -231
- package/front_end/generated/protocol.ts +1 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +4 -1
- package/front_end/models/ai_assistance/ChangeManager.ts +3 -1
- package/front_end/models/ai_assistance/DOMHelpers.ts +118 -3
- package/front_end/models/ai_assistance/ExtensionScope.ts +31 -24
- package/front_end/models/ai_assistance/agents/AiAgent.ts +6 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +13 -13
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +1 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +18 -8
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +2 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +103 -81
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +15 -203
- package/front_end/models/ai_assistance/injected.ts +6 -1
- package/front_end/models/ai_assistance/skills/lighthouse.md +1 -1
- package/front_end/models/ai_assistance/skills/styling.md +8 -10
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +1 -1
- package/front_end/models/ai_assistance/tools/SetElementStyles.ts +288 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +1 -0
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +3 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +64 -16
- package/front_end/models/comment_manager/CD4ABridge.ts +12 -2
- package/front_end/models/comment_manager/CommentManager.ts +24 -4
- package/front_end/models/javascript_metadata/NativeFunctions.ts +41 -1
- package/front_end/models/project_settings/ProjectSettingsModel.ts +1 -1
- package/front_end/models/trace/handlers/FlowsHandler.ts +10 -0
- package/front_end/models/trace/handlers/SamplesHandler.ts +3 -2
- package/front_end/models/trace/handlers/ScriptsHandler.ts +25 -26
- package/front_end/models/trace/helpers/TreeHelpers.ts +4 -0
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -2
- package/front_end/models/trace/types/TraceEvents.ts +21 -22
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +9 -1
- package/front_end/panels/ai_assistance/components/chatInput.css +4 -4
- package/front_end/panels/animation/AnimationTimeline.ts +3 -3
- package/front_end/panels/animation/animationTimeline.css +6 -4
- package/front_end/panels/application/IndexedDBModel.ts +0 -15
- package/front_end/panels/application/appManifestView.css +2 -5
- package/front_end/panels/application/components/backForwardCacheView.css +1 -5
- package/front_end/panels/application/components/serviceWorkerRouterView.css +2 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +7 -0
- package/front_end/panels/comments/CommentsPane.ts +12 -7
- package/front_end/panels/comments/commentsPane.css +16 -2
- package/front_end/panels/common/CommentsOverlayWidget.ts +16 -10
- package/front_end/panels/common/CommentsStatusBarPill.ts +12 -5
- package/front_end/panels/common/commentsOverlay.css +7 -1
- package/front_end/panels/common/commentsStatusBarPill.css +30 -0
- package/front_end/panels/console/consolePrompt.css +0 -12
- package/front_end/panels/console/consoleView.css +2 -2
- package/front_end/panels/developer_resources/developerResourcesView.css +4 -3
- package/front_end/panels/elements/DOMTreeWidget.ts +29 -9
- package/front_end/panels/elements/StylePropertyTreeElement.ts +2 -1
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +12 -5
- package/front_end/panels/elements/components/cssVariableValueView.css +1 -1
- package/front_end/panels/elements/components/elementsBreadcrumbs.css +2 -2
- package/front_end/panels/elements/domTreeWidget.css +6 -1
- package/front_end/panels/elements/elementsPanel.css +0 -6
- package/front_end/panels/elements/layoutPane.css +1 -1
- package/front_end/panels/elements/metricsSidebarPane.css +1 -1
- package/front_end/panels/elements/platformFontsWidget.css +1 -1
- package/front_end/panels/elements/stylesSidebarPane.css +0 -10
- package/front_end/panels/emulation/deviceModeView.css +6 -7
- package/front_end/panels/explain/components/consoleInsight.css +4 -4
- package/front_end/panels/issues/issuesTree.css +1 -26
- package/front_end/panels/lighthouse/lighthouseStartView.css +2 -2
- package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +1 -1
- package/front_end/panels/media/TickingFlameChart.ts +20 -3
- package/front_end/panels/media/playerMessagesView.css +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +24 -5
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +1 -6
- package/front_end/panels/network/networkLogView.css +2 -2
- package/front_end/panels/network/networkTimingTable.css +1 -1
- package/front_end/panels/performance_monitor/performanceMonitor.css +0 -4
- package/front_end/panels/protocol_monitor/JSONEditor.css +1 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +4 -2
- package/front_end/panels/recorder/recorderPanel.css +3 -3
- package/front_end/panels/recorder/recordingListView.css +1 -1
- package/front_end/panels/screencast/screencastView.css +1 -1
- package/front_end/panels/search/searchResultsPane.css +1 -1
- package/front_end/panels/security/SecurityModel.ts +0 -6
- package/front_end/panels/security/SecurityPanel.ts +120 -108
- package/front_end/panels/security/originView.css +1 -1
- package/front_end/panels/sensors/locationsSettingsTab.css +3 -3
- package/front_end/panels/settings/EditFileSystemView.ts +159 -104
- package/front_end/panels/settings/editFileSystemView.css +30 -4
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +0 -52
- package/front_end/panels/settings/settingsScreen.css +0 -7
- package/front_end/panels/sources/CallStackSidebarPane.ts +339 -221
- package/front_end/panels/sources/NavigatorView.ts +95 -8
- package/front_end/panels/sources/ThreadsSidebarPane.ts +8 -4
- package/front_end/panels/sources/breakpointsView.css +1 -3
- package/front_end/panels/sources/callStackSidebarPane.css +4 -0
- package/front_end/panels/sources/components/HeadersView.ts +15 -2
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +0 -1
- package/front_end/panels/timeline/CountersGraph.ts +0 -4
- package/front_end/panels/timeline/TimelineLoader.ts +16 -6
- package/front_end/panels/timeline/TimelinePanel.ts +20 -12
- package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
- package/front_end/panels/timeline/components/DetailsView.ts +2 -1
- package/front_end/panels/timeline/components/cwvMetrics.css +1 -1
- package/front_end/panels/timeline/components/metricCard.css +1 -1
- package/front_end/panels/timeline/components/sidebarAnnotationsTab.css +4 -4
- package/front_end/panels/timeline/timelineFlameChartView.css +1 -1
- package/front_end/panels/webauthn/WebauthnPane.ts +13 -14
- package/front_end/panels/webauthn/webauthnPane.css +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/comments/CommentOverlayManager.ts +34 -18
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +6 -0
- package/front_end/ui/components/input/textInput.css +1 -1
- package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +6 -4
- package/front_end/ui/components/suggestion_input/suggestionInput.css +2 -2
- package/front_end/ui/components/text_editor/AiCodeGenerationTeaser.ts +14 -2
- package/front_end/ui/legacy/DockController.ts +17 -4
- package/front_end/ui/legacy/Treeoutline.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +148 -10
- package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +3 -2
- package/front_end/ui/legacy/components/perf_ui/chartViewport.css +2 -2
- package/front_end/ui/legacy/components/perf_ui/filmStripView.css +2 -2
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +1 -1
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +5 -4
- package/front_end/ui/legacy/components/source_frame/imageView.css +1 -1
- package/front_end/ui/legacy/components/utils/TargetDetachedDialog.ts +0 -3
- package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +1 -14
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +3 -2
- package/front_end/ui/legacy/listWidget.css +0 -18
- package/front_end/ui/legacy/theme_support/ThemeSupport.ts +44 -9
- package/front_end/ui/lit/strip-whitespace.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +3 -3
- package/front_end/generated/Deprecation.ts +0 -471
- package/front_end/panels/accessibility/axBreadcrumbs.css +0 -155
- package/front_end/panels/network/requestHeadersTree.css +0 -226
- package/front_end/panels/recorder/startView.css +0 -38
- package/front_end/panels/security/ipProtectionView.css +0 -141
- package/front_end/ui/legacy/components/inline_editor/animationNameSwatch.css +0 -27
|
@@ -525,6 +525,19 @@ export function renderHighlightedUrl(url: Platform.DevToolsPath.UrlString, secur
|
|
|
525
525
|
</span>`;
|
|
526
526
|
}
|
|
527
527
|
|
|
528
|
+
export function renderCertificateViewerButton(text: string, jslogContext: string, onClick: () => void): TemplateResult {
|
|
529
|
+
return html`
|
|
530
|
+
<devtools-button
|
|
531
|
+
class="origin-button"
|
|
532
|
+
title=${text}
|
|
533
|
+
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
534
|
+
.jslogContext=${jslogContext}
|
|
535
|
+
@click=${(e: Event) => {
|
|
536
|
+
e.consume();
|
|
537
|
+
onClick();
|
|
538
|
+
}}>${text}</devtools-button>`;
|
|
539
|
+
}
|
|
540
|
+
|
|
528
541
|
export interface ViewInput {
|
|
529
542
|
panel: SecurityPanel;
|
|
530
543
|
}
|
|
@@ -576,7 +589,6 @@ export class SecurityPanel extends UI.Panel.Panel implements SDK.TargetManager.S
|
|
|
576
589
|
this.sidebar.element.setAttribute('jslog', `${VisualLogging.pane('sidebar').track({resize: true})}`);
|
|
577
590
|
|
|
578
591
|
this.mainView = new SecurityMainView();
|
|
579
|
-
this.mainView.panel = this;
|
|
580
592
|
this.sidebar.onShowOrigin = (origin: Platform.DevToolsPath.UrlString|null) => {
|
|
581
593
|
if (origin) {
|
|
582
594
|
this.showOrigin(origin);
|
|
@@ -752,11 +764,7 @@ export class SecurityPanel extends UI.Panel.Panel implements SDK.TargetManager.S
|
|
|
752
764
|
this.filterRequestCounts.set(filterKey, currentCount + 1);
|
|
753
765
|
}
|
|
754
766
|
|
|
755
|
-
this.mainView.
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
filterRequestCount(filterKey: string): number {
|
|
759
|
-
return this.filterRequestCounts.get(filterKey) || 0;
|
|
767
|
+
this.mainView.setFilterRequestCounts(new Map(this.filterRequestCounts));
|
|
760
768
|
}
|
|
761
769
|
|
|
762
770
|
modelAdded(securityModel: SecurityModel): void {
|
|
@@ -807,7 +815,7 @@ export class SecurityPanel extends UI.Panel.Panel implements SDK.TargetManager.S
|
|
|
807
815
|
this.filterRequestCounts.clear();
|
|
808
816
|
// After clearing the filtered request counts, refresh the
|
|
809
817
|
// explanations to reflect the new counts.
|
|
810
|
-
this.mainView.
|
|
818
|
+
this.mainView.setFilterRequestCounts(new Map(this.filterRequestCounts));
|
|
811
819
|
|
|
812
820
|
// If we could not find a matching request (as in the case of clicking
|
|
813
821
|
// through an interstitial, see https://crbug.com/669309), set the origin
|
|
@@ -843,14 +851,15 @@ export enum OriginGroup {
|
|
|
843
851
|
}
|
|
844
852
|
|
|
845
853
|
export class SecurityMainView extends UI.Widget.VBox {
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
+
readonly #summarySection: HTMLElement;
|
|
855
|
+
readonly #securityExplanationsMain: HTMLElement;
|
|
856
|
+
readonly #securityExplanationsExtra: HTMLElement;
|
|
857
|
+
readonly #lockSpectrum: Map<Protocol.Security.SecurityState, HTMLElement>;
|
|
858
|
+
#summaryText: HTMLElement;
|
|
859
|
+
#explanations: Array<Protocol.Security.SecurityStateExplanation|SecurityStyleExplanation>|null;
|
|
860
|
+
#securityState: Protocol.Security.SecurityState|null;
|
|
861
|
+
#filterRequestCounts: ReadonlyMap<string, number> = new Map();
|
|
862
|
+
|
|
854
863
|
constructor(element?: HTMLElement) {
|
|
855
864
|
super(element, {jslog: `${VisualLogging.pane('security.main-view')}`});
|
|
856
865
|
this.registerRequiredCSS(lockIconStyles, mainViewStyles);
|
|
@@ -859,21 +868,21 @@ export class SecurityMainView extends UI.Widget.VBox {
|
|
|
859
868
|
|
|
860
869
|
this.contentElement.classList.add('security-main-view');
|
|
861
870
|
|
|
862
|
-
this
|
|
871
|
+
this.#summarySection = this.contentElement.createChild('div', 'security-summary');
|
|
863
872
|
|
|
864
873
|
// Info explanations should appear after all others.
|
|
865
|
-
this
|
|
874
|
+
this.#securityExplanationsMain =
|
|
866
875
|
this.contentElement.createChild('div', 'security-explanation-list security-explanations-main');
|
|
867
|
-
this
|
|
876
|
+
this.#securityExplanationsExtra =
|
|
868
877
|
this.contentElement.createChild('div', 'security-explanation-list security-explanations-extra');
|
|
869
878
|
|
|
870
879
|
// Fill the security summary section.
|
|
871
|
-
const summaryDiv = this
|
|
880
|
+
const summaryDiv = this.#summarySection.createChild('div', 'security-summary-section-title');
|
|
872
881
|
summaryDiv.textContent = i18nString(UIStrings.securityOverview);
|
|
873
882
|
UI.ARIAUtils.markAsHeading(summaryDiv, 1);
|
|
874
883
|
|
|
875
|
-
const lockSpectrum = this
|
|
876
|
-
this
|
|
884
|
+
const lockSpectrum = this.#summarySection.createChild('div', 'lock-spectrum');
|
|
885
|
+
this.#lockSpectrum = new Map([
|
|
877
886
|
[
|
|
878
887
|
Protocol.Security.SecurityState.Secure,
|
|
879
888
|
lockSpectrum.appendChild(
|
|
@@ -890,34 +899,39 @@ export class SecurityMainView extends UI.Widget.VBox {
|
|
|
890
899
|
getSecurityStateIconForOverview(Protocol.Security.SecurityState.Insecure, 'lock-icon lock-icon-insecure')),
|
|
891
900
|
],
|
|
892
901
|
]);
|
|
893
|
-
UI.Tooltip.Tooltip.install(
|
|
894
|
-
|
|
895
|
-
UI.Tooltip.Tooltip.install(
|
|
896
|
-
|
|
897
|
-
UI.Tooltip.Tooltip.install(
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
this
|
|
902
|
+
UI.Tooltip.Tooltip.install(this.#getLockSpectrumDiv(Protocol.Security.SecurityState.Secure),
|
|
903
|
+
i18nString(UIStrings.secure));
|
|
904
|
+
UI.Tooltip.Tooltip.install(this.#getLockSpectrumDiv(Protocol.Security.SecurityState.Neutral),
|
|
905
|
+
i18nString(UIStrings.info));
|
|
906
|
+
UI.Tooltip.Tooltip.install(this.#getLockSpectrumDiv(Protocol.Security.SecurityState.Insecure),
|
|
907
|
+
i18nString(UIStrings.notSecure));
|
|
908
|
+
|
|
909
|
+
this.#summarySection.createChild('div', 'triangle-pointer-container')
|
|
901
910
|
.createChild('div', 'triangle-pointer-wrapper')
|
|
902
911
|
.createChild('div', 'triangle-pointer');
|
|
903
912
|
|
|
904
|
-
this
|
|
905
|
-
UI.ARIAUtils.markAsHeading(this
|
|
913
|
+
this.#summaryText = this.#summarySection.createChild('div', 'security-summary-text');
|
|
914
|
+
UI.ARIAUtils.markAsHeading(this.#summaryText, 2);
|
|
915
|
+
|
|
916
|
+
this.#explanations = null;
|
|
917
|
+
this.#securityState = null;
|
|
918
|
+
}
|
|
906
919
|
|
|
907
|
-
|
|
908
|
-
this
|
|
920
|
+
setFilterRequestCounts(filterRequestCounts: ReadonlyMap<string, number>): void {
|
|
921
|
+
this.#filterRequestCounts = filterRequestCounts;
|
|
922
|
+
this.#refreshExplanations();
|
|
909
923
|
}
|
|
910
924
|
|
|
911
|
-
getLockSpectrumDiv(securityState: Protocol.Security.SecurityState): HTMLElement {
|
|
912
|
-
const element = this
|
|
925
|
+
#getLockSpectrumDiv(securityState: Protocol.Security.SecurityState): HTMLElement {
|
|
926
|
+
const element = this.#lockSpectrum.get(securityState);
|
|
913
927
|
if (!element) {
|
|
914
928
|
throw new Error(`Invalid argument: ${securityState}`);
|
|
915
929
|
}
|
|
916
930
|
return element;
|
|
917
931
|
}
|
|
918
932
|
|
|
919
|
-
|
|
920
|
-
|
|
933
|
+
#addExplanation(parent: Element,
|
|
934
|
+
explanation: Protocol.Security.SecurityStateExplanation|SecurityStyleExplanation): Element {
|
|
921
935
|
const explanationSection = parent.createChild('div', 'security-explanation');
|
|
922
936
|
explanationSection.classList.add('security-explanation-' + explanation.securityState);
|
|
923
937
|
|
|
@@ -954,42 +968,42 @@ export class SecurityMainView extends UI.Widget.VBox {
|
|
|
954
968
|
|
|
955
969
|
updateVisibleSecurityState(visibleSecurityState: PageVisibleSecurityState): void {
|
|
956
970
|
// Remove old state.
|
|
957
|
-
// It's safe to call this even when this
|
|
958
|
-
this
|
|
971
|
+
// It's safe to call this even when this.#securityState is undefined.
|
|
972
|
+
this.#summarySection.classList.remove('security-summary-' + this.#securityState);
|
|
959
973
|
|
|
960
974
|
// Add new state.
|
|
961
|
-
this
|
|
962
|
-
this
|
|
975
|
+
this.#securityState = visibleSecurityState.securityState;
|
|
976
|
+
this.#summarySection.classList.add('security-summary-' + this.#securityState);
|
|
963
977
|
|
|
964
978
|
// Update the color and title of the triangle icon in the lock spectrum to
|
|
965
979
|
// match the security state.
|
|
966
|
-
if (this
|
|
967
|
-
this
|
|
968
|
-
this
|
|
969
|
-
UI.Tooltip.Tooltip.install(
|
|
970
|
-
|
|
971
|
-
} else if (this
|
|
972
|
-
this
|
|
973
|
-
this
|
|
974
|
-
UI.Tooltip.Tooltip.install(
|
|
975
|
-
|
|
980
|
+
if (this.#securityState === Protocol.Security.SecurityState.Insecure) {
|
|
981
|
+
this.#getLockSpectrumDiv(Protocol.Security.SecurityState.Insecure).classList.add('lock-icon-insecure');
|
|
982
|
+
this.#getLockSpectrumDiv(Protocol.Security.SecurityState.Insecure).classList.remove('lock-icon-insecure-broken');
|
|
983
|
+
UI.Tooltip.Tooltip.install(this.#getLockSpectrumDiv(Protocol.Security.SecurityState.Insecure),
|
|
984
|
+
i18nString(UIStrings.notSecure));
|
|
985
|
+
} else if (this.#securityState === Protocol.Security.SecurityState.InsecureBroken) {
|
|
986
|
+
this.#getLockSpectrumDiv(Protocol.Security.SecurityState.Insecure).classList.add('lock-icon-insecure-broken');
|
|
987
|
+
this.#getLockSpectrumDiv(Protocol.Security.SecurityState.Insecure).classList.remove('lock-icon-insecure');
|
|
988
|
+
UI.Tooltip.Tooltip.install(this.#getLockSpectrumDiv(Protocol.Security.SecurityState.Insecure),
|
|
989
|
+
i18nString(UIStrings.notSecureBroken));
|
|
976
990
|
}
|
|
977
991
|
|
|
978
|
-
const {summary, explanations} = this
|
|
992
|
+
const {summary, explanations} = this.#getSecuritySummaryAndExplanations(visibleSecurityState);
|
|
979
993
|
// Use override summary if present, otherwise use base explanation
|
|
980
|
-
this
|
|
994
|
+
this.#summaryText.textContent = summary || SummaryMessages[this.#securityState]();
|
|
981
995
|
|
|
982
|
-
this
|
|
996
|
+
this.#explanations = this.#orderExplanations(explanations);
|
|
983
997
|
|
|
984
|
-
this
|
|
998
|
+
this.#refreshExplanations();
|
|
985
999
|
}
|
|
986
1000
|
|
|
987
|
-
|
|
1001
|
+
#getSecuritySummaryAndExplanations(visibleSecurityState: PageVisibleSecurityState):
|
|
988
1002
|
{summary: (string|undefined), explanations: SecurityStyleExplanation[]} {
|
|
989
1003
|
const {securityState, securityStateIssueIds} = visibleSecurityState;
|
|
990
1004
|
let summary;
|
|
991
1005
|
const explanations: SecurityStyleExplanation[] = [];
|
|
992
|
-
summary = this
|
|
1006
|
+
summary = this.#explainSafetyTipSecurity(visibleSecurityState, summary, explanations);
|
|
993
1007
|
if (securityStateIssueIds.includes('malicious-content')) {
|
|
994
1008
|
summary = i18nString(UIStrings.thisPageIsDangerousFlaggedBy);
|
|
995
1009
|
// Always insert SafeBrowsing explanation at the front.
|
|
@@ -1018,15 +1032,14 @@ export class SecurityMainView extends UI.Widget.VBox {
|
|
|
1018
1032
|
return {summary, explanations};
|
|
1019
1033
|
}
|
|
1020
1034
|
|
|
1021
|
-
this
|
|
1022
|
-
this
|
|
1023
|
-
this
|
|
1035
|
+
this.#explainCertificateSecurity(visibleSecurityState, explanations);
|
|
1036
|
+
this.#explainConnectionSecurity(visibleSecurityState, explanations);
|
|
1037
|
+
this.#explainContentSecurity(visibleSecurityState, explanations);
|
|
1024
1038
|
return {summary, explanations};
|
|
1025
1039
|
}
|
|
1026
1040
|
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
explanations: SecurityStyleExplanation[]): string|undefined {
|
|
1041
|
+
#explainSafetyTipSecurity(visibleSecurityState: PageVisibleSecurityState, summary: string|undefined,
|
|
1042
|
+
explanations: SecurityStyleExplanation[]): string|undefined {
|
|
1030
1043
|
const {securityStateIssueIds, safetyTipInfo} = visibleSecurityState;
|
|
1031
1044
|
const currentExplanations = [];
|
|
1032
1045
|
|
|
@@ -1059,8 +1072,8 @@ export class SecurityMainView extends UI.Widget.VBox {
|
|
|
1059
1072
|
return summary;
|
|
1060
1073
|
}
|
|
1061
1074
|
|
|
1062
|
-
|
|
1063
|
-
|
|
1075
|
+
#explainCertificateSecurity(visibleSecurityState: PageVisibleSecurityState,
|
|
1076
|
+
explanations: SecurityStyleExplanation[]): void {
|
|
1064
1077
|
const {certificateSecurityState, securityStateIssueIds} = visibleSecurityState;
|
|
1065
1078
|
const title = i18nString(UIStrings.certificate);
|
|
1066
1079
|
if (certificateSecurityState?.certificateHasSha1Signature) {
|
|
@@ -1109,8 +1122,8 @@ export class SecurityMainView extends UI.Widget.VBox {
|
|
|
1109
1122
|
}
|
|
1110
1123
|
}
|
|
1111
1124
|
|
|
1112
|
-
|
|
1113
|
-
|
|
1125
|
+
#explainConnectionSecurity(visibleSecurityState: PageVisibleSecurityState,
|
|
1126
|
+
explanations: SecurityStyleExplanation[]): void {
|
|
1114
1127
|
const certificateSecurityState = visibleSecurityState.certificateSecurityState;
|
|
1115
1128
|
if (!certificateSecurityState) {
|
|
1116
1129
|
return;
|
|
@@ -1153,8 +1166,8 @@ export class SecurityMainView extends UI.Widget.VBox {
|
|
|
1153
1166
|
undefined, undefined, recommendations));
|
|
1154
1167
|
}
|
|
1155
1168
|
|
|
1156
|
-
|
|
1157
|
-
|
|
1169
|
+
#explainContentSecurity(visibleSecurityState: PageVisibleSecurityState,
|
|
1170
|
+
explanations: SecurityStyleExplanation[]): void {
|
|
1158
1171
|
// Add the secure explanation unless there is an issue.
|
|
1159
1172
|
let addSecureExplanation = true;
|
|
1160
1173
|
const title = i18nString(UIStrings.resources);
|
|
@@ -1207,7 +1220,7 @@ export class SecurityMainView extends UI.Widget.VBox {
|
|
|
1207
1220
|
}
|
|
1208
1221
|
}
|
|
1209
1222
|
|
|
1210
|
-
|
|
1223
|
+
#orderExplanations(explanations: SecurityStyleExplanation[]): SecurityStyleExplanation[] {
|
|
1211
1224
|
if (explanations.length === 0) {
|
|
1212
1225
|
return explanations;
|
|
1213
1226
|
}
|
|
@@ -1225,33 +1238,36 @@ export class SecurityMainView extends UI.Widget.VBox {
|
|
|
1225
1238
|
}
|
|
1226
1239
|
|
|
1227
1240
|
refreshExplanations(): void {
|
|
1228
|
-
this
|
|
1229
|
-
|
|
1230
|
-
|
|
1241
|
+
this.#refreshExplanations();
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
#refreshExplanations(): void {
|
|
1245
|
+
this.#securityExplanationsMain.removeChildren();
|
|
1246
|
+
this.#securityExplanationsExtra.removeChildren();
|
|
1247
|
+
if (!this.#explanations) {
|
|
1231
1248
|
return;
|
|
1232
1249
|
}
|
|
1233
|
-
for (const explanation of this
|
|
1250
|
+
for (const explanation of this.#explanations) {
|
|
1234
1251
|
if (explanation.securityState === Protocol.Security.SecurityState.Info) {
|
|
1235
|
-
this
|
|
1252
|
+
this.#addExplanation(this.#securityExplanationsExtra, explanation);
|
|
1236
1253
|
} else {
|
|
1237
1254
|
switch (explanation.mixedContentType) {
|
|
1238
1255
|
case Protocol.Security.MixedContentType.Blockable:
|
|
1239
|
-
this
|
|
1240
|
-
|
|
1241
|
-
NetworkForward.UIFilter.MixedContentFilterValues.BLOCK_OVERRIDDEN);
|
|
1256
|
+
this.#addMixedContentExplanation(this.#securityExplanationsMain, explanation,
|
|
1257
|
+
NetworkForward.UIFilter.MixedContentFilterValues.BLOCK_OVERRIDDEN);
|
|
1242
1258
|
break;
|
|
1243
1259
|
case Protocol.Security.MixedContentType.OptionallyBlockable:
|
|
1244
|
-
this
|
|
1245
|
-
|
|
1260
|
+
this.#addMixedContentExplanation(this.#securityExplanationsMain, explanation,
|
|
1261
|
+
NetworkForward.UIFilter.MixedContentFilterValues.DISPLAYED);
|
|
1246
1262
|
break;
|
|
1247
1263
|
default:
|
|
1248
|
-
this
|
|
1264
|
+
this.#addExplanation(this.#securityExplanationsMain, explanation);
|
|
1249
1265
|
break;
|
|
1250
1266
|
}
|
|
1251
1267
|
}
|
|
1252
1268
|
}
|
|
1253
1269
|
|
|
1254
|
-
if (this.
|
|
1270
|
+
if ((this.#filterRequestCounts.get(NetworkForward.UIFilter.MixedContentFilterValues.BLOCKED) ?? 0) > 0) {
|
|
1255
1271
|
const explanation = {
|
|
1256
1272
|
securityState: Protocol.Security.SecurityState.Info,
|
|
1257
1273
|
summary: i18nString(UIStrings.blockedMixedContent),
|
|
@@ -1260,17 +1276,17 @@ export class SecurityMainView extends UI.Widget.VBox {
|
|
|
1260
1276
|
certificate: [],
|
|
1261
1277
|
title: '',
|
|
1262
1278
|
} as Protocol.Security.SecurityStateExplanation;
|
|
1263
|
-
this
|
|
1264
|
-
|
|
1279
|
+
this.#addMixedContentExplanation(this.#securityExplanationsMain, explanation,
|
|
1280
|
+
NetworkForward.UIFilter.MixedContentFilterValues.BLOCKED);
|
|
1265
1281
|
}
|
|
1266
1282
|
}
|
|
1267
1283
|
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
const element = this
|
|
1284
|
+
#addMixedContentExplanation(parent: Element,
|
|
1285
|
+
explanation: Protocol.Security.SecurityStateExplanation|SecurityStyleExplanation,
|
|
1286
|
+
filterKey: string): void {
|
|
1287
|
+
const element = this.#addExplanation(parent, explanation);
|
|
1272
1288
|
|
|
1273
|
-
const filterRequestCount = this.
|
|
1289
|
+
const filterRequestCount = this.#filterRequestCounts.get(filterKey) ?? 0;
|
|
1274
1290
|
if (!filterRequestCount) {
|
|
1275
1291
|
// Network instrumentation might not have been enabled for the page
|
|
1276
1292
|
// load, so the security panel does not necessarily know a count of
|
|
@@ -1287,10 +1303,10 @@ export class SecurityMainView extends UI.Widget.VBox {
|
|
|
1287
1303
|
requestsAnchor.tabIndex = 0;
|
|
1288
1304
|
requestsAnchor.textContent = i18nString(UIStrings.viewDRequestsInNetworkPanel, {n: filterRequestCount});
|
|
1289
1305
|
|
|
1290
|
-
requestsAnchor.addEventListener('click', this
|
|
1306
|
+
requestsAnchor.addEventListener('click', this.#showNetworkFilter.bind(this, filterKey));
|
|
1291
1307
|
}
|
|
1292
1308
|
|
|
1293
|
-
showNetworkFilter(filterKey: string, e: Event): void {
|
|
1309
|
+
#showNetworkFilter(filterKey: string, e: Event): void {
|
|
1294
1310
|
e.consume();
|
|
1295
1311
|
void Common.Revealer.reveal(NetworkForward.UIFilter.UIRequestFilter.filters(
|
|
1296
1312
|
[{filterType: NetworkForward.UIFilter.FilterType.MixedContent, filterValue: filterKey}]));
|
|
@@ -1415,7 +1431,7 @@ function renderConnectionSection(securityDetails: Protocol.Network.SecurityDetai
|
|
|
1415
1431
|
}
|
|
1416
1432
|
|
|
1417
1433
|
function renderTitleSection(origin: Platform.DevToolsPath.UrlString, securityState: Protocol.Security.SecurityState,
|
|
1418
|
-
onRevealInNetwork: (
|
|
1434
|
+
onRevealInNetwork: () => void): TemplateResult {
|
|
1419
1435
|
// clang-format off
|
|
1420
1436
|
return html`
|
|
1421
1437
|
<div class="title-section-header" role="heading" aria-level="1">${i18nString(UIStrings.origin)}</div>
|
|
@@ -1430,7 +1446,10 @@ function renderTitleSection(origin: Platform.DevToolsPath.UrlString, securitySta
|
|
|
1430
1446
|
<devtools-button
|
|
1431
1447
|
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
1432
1448
|
.jslogContext=${'reveal-in-network'}
|
|
1433
|
-
@click=${
|
|
1449
|
+
@click=${(e: Event) => {
|
|
1450
|
+
e.consume();
|
|
1451
|
+
onRevealInNetwork();
|
|
1452
|
+
}}>${i18nString(UIStrings.viewRequestsInNetworkPanel)}</devtools-button>
|
|
1434
1453
|
</div>`;
|
|
1435
1454
|
// clang-format on
|
|
1436
1455
|
}
|
|
@@ -1439,7 +1458,7 @@ interface CertificateSectionInput {
|
|
|
1439
1458
|
securityDetails: Protocol.Network.SecurityDetails;
|
|
1440
1459
|
isSanListTruncated: boolean;
|
|
1441
1460
|
onToggleSanTruncation: () => void;
|
|
1442
|
-
onViewCertificate: (
|
|
1461
|
+
onViewCertificate: () => void;
|
|
1443
1462
|
}
|
|
1444
1463
|
|
|
1445
1464
|
function buildCertificateDetailsRows(input: CertificateSectionInput): DetailsTableRow[] {
|
|
@@ -1462,13 +1481,8 @@ function buildCertificateDetailsRows(input: CertificateSectionInput): DetailsTab
|
|
|
1462
1481
|
{key: i18nString(UIStrings.validUntil), value: new Date(1000 * securityDetails.validTo).toUTCString()},
|
|
1463
1482
|
{key: i18nString(UIStrings.issuer), value: securityDetails.issuer},
|
|
1464
1483
|
{
|
|
1465
|
-
value:
|
|
1466
|
-
|
|
1467
|
-
class="origin-button"
|
|
1468
|
-
title=${certificateButtonText}
|
|
1469
|
-
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
1470
|
-
.jslogContext=${'security.view-certificate-for-origin'}
|
|
1471
|
-
@click=${onViewCertificate}>${certificateButtonText}</devtools-button>`,
|
|
1484
|
+
value: renderCertificateViewerButton(
|
|
1485
|
+
certificateButtonText, 'security.view-certificate-for-origin', onViewCertificate),
|
|
1472
1486
|
},
|
|
1473
1487
|
];
|
|
1474
1488
|
// clang-format on
|
|
@@ -1591,10 +1605,10 @@ export interface SecurityOriginViewInput {
|
|
|
1591
1605
|
loadedFromCache: boolean;
|
|
1592
1606
|
isSanListTruncated: boolean;
|
|
1593
1607
|
isCertificateTransparencyDetailsShown: boolean;
|
|
1594
|
-
onRevealInNetwork: (
|
|
1608
|
+
onRevealInNetwork: () => void;
|
|
1595
1609
|
onToggleSanTruncation: () => void;
|
|
1596
1610
|
onToggleCertificateTransparencyDetails: () => void;
|
|
1597
|
-
onViewCertificate: (
|
|
1611
|
+
onViewCertificate: () => void;
|
|
1598
1612
|
}
|
|
1599
1613
|
|
|
1600
1614
|
export type SecurityOriginViewFunction = (input: SecurityOriginViewInput, output: undefined, target: HTMLElement) =>
|
|
@@ -1608,7 +1622,7 @@ interface SecurityDetailsInput {
|
|
|
1608
1622
|
isCertificateTransparencyDetailsShown: boolean;
|
|
1609
1623
|
onToggleSanTruncation: () => void;
|
|
1610
1624
|
onToggleCertificateTransparencyDetails: () => void;
|
|
1611
|
-
onViewCertificate: (
|
|
1625
|
+
onViewCertificate: () => void;
|
|
1612
1626
|
}
|
|
1613
1627
|
|
|
1614
1628
|
function renderSecurityDetails(input: SecurityDetailsInput): TemplateResult {
|
|
@@ -1705,8 +1719,7 @@ export class SecurityOriginView extends UI.Widget.VBox {
|
|
|
1705
1719
|
this.#renderView();
|
|
1706
1720
|
};
|
|
1707
1721
|
|
|
1708
|
-
#showCertificateViewer = async(
|
|
1709
|
-
event.consume();
|
|
1722
|
+
#showCertificateViewer = async(): Promise<void> => {
|
|
1710
1723
|
const names = await SDK.NetworkManager.MultitargetNetworkManager.instance().getCertificate(this.#origin);
|
|
1711
1724
|
if (names.length > 0) {
|
|
1712
1725
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.showCertificateViewer(names);
|
|
@@ -1739,8 +1752,7 @@ export class SecurityOriginView extends UI.Widget.VBox {
|
|
|
1739
1752
|
undefined, this.contentElement);
|
|
1740
1753
|
}
|
|
1741
1754
|
|
|
1742
|
-
#revealInNetwork = (
|
|
1743
|
-
event.consume();
|
|
1755
|
+
#revealInNetwork = (): void => {
|
|
1744
1756
|
const parsedURL = new Common.ParsedURL.ParsedURL(this.#origin);
|
|
1745
1757
|
void Common.Revealer.reveal(NetworkForward.UIFilter.UIRequestFilter.filters([
|
|
1746
1758
|
{filterType: NetworkForward.UIFilter.FilterType.Domain, filterValue: parsedURL.host},
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
|
|
89
89
|
.security-origin-view .sct-details .details-table .details-table-row:last-child td:last-child {
|
|
90
90
|
border-bottom: var(--sys-size-1) solid var(--sys-color-divider);
|
|
91
|
-
padding-bottom:
|
|
91
|
+
padding-bottom: var(--sys-size-5);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
.security-origin-view .sct-details .details-table:last-child .details-table-row:last-child td:last-child {
|
|
@@ -19,8 +19,8 @@ devtools-list.locations-list,
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.locations-list-item {
|
|
22
|
-
padding:
|
|
23
|
-
height:
|
|
22
|
+
padding: var(--sys-size-2) var(--sys-size-4);
|
|
23
|
+
height: var(--sys-size-12);
|
|
24
24
|
display: flex;
|
|
25
25
|
align-items: center;
|
|
26
26
|
position: relative;
|
|
@@ -51,7 +51,7 @@ devtools-list.locations-list,
|
|
|
51
51
|
.locations-list-separator {
|
|
52
52
|
flex: 0 0 var(--sys-size-1);
|
|
53
53
|
background-color: var(--sys-color-divider);
|
|
54
|
-
height:
|
|
54
|
+
height: var(--sys-size-13);
|
|
55
55
|
margin: 0 var(--sys-size-3);
|
|
56
56
|
}
|
|
57
57
|
|