@@ -13,6 +13,7 @@ import * as UI from '../../ui/legacy/legacy.js';
1313
1414import { CookieControlsTreeElement } from './CookieControlsTreeElement.js' ;
1515import { CookieReportTreeElement } from './CookieReportTreeElement.js' ;
16+ import { IPProtectionTreeElement } from './IPProtectionTreeElement.js' ;
1617import lockIconStyles from './lockIcon.css.js' ;
1718import { OriginTreeElement } from './OriginTreeElement.js' ;
1819import {
@@ -41,6 +42,10 @@ const UIStrings = {
4142 * @description Sidebar element text in the Security panel
4243 */
4344 flagControls : 'Controls' ,
45+ /**
46+ * @description Sidebar element text in the Security panel
47+ */
48+ ipProtection : 'IP Protection' ,
4449 /**
4550 * @description Text in Security Panel of the Security panel
4651 */
@@ -78,6 +83,7 @@ export class SecurityPanelSidebar extends UI.Widget.VBox {
7883 securityOverviewElement : OriginTreeElement ;
7984 readonly #cookieControlsTreeElement: CookieControlsTreeElement | undefined ;
8085 readonly cookieReportTreeElement : CookieReportTreeElement | undefined ;
86+ readonly ipProtectionTreeElement : IPProtectionTreeElement | undefined ;
8187 readonly #elementsByOrigin: Map < string , OriginTreeElement > ;
8288 readonly #mainViewReloadMessage: UI . TreeOutline . TreeElement ;
8389 #mainOrigin: string | null ;
@@ -102,6 +108,11 @@ export class SecurityPanelSidebar extends UI.Widget.VBox {
102108 this . cookieReportTreeElement = new CookieReportTreeElement ( i18nString ( UIStrings . cookieReport ) , 'cookie-report' ) ;
103109 privacyTreeSection . appendChild ( this . cookieReportTreeElement ) ;
104110
111+ if ( Root . Runtime . hostConfig . devToolsIpProtectionPanelInDevTools ?. enabled ) {
112+ this . ipProtectionTreeElement = new IPProtectionTreeElement ( i18nString ( UIStrings . ipProtection ) , 'ip-protection' ) ;
113+ privacyTreeSection . appendChild ( this . ipProtectionTreeElement ) ;
114+ }
115+
105116 // If this if the first time this setting is set, go to the controls tool
106117 if ( this . #securitySidebarLastItemSetting. get ( ) === '' ) {
107118 this . #securitySidebarLastItemSetting. set ( this . #cookieControlsTreeElement. elemId ) ;
@@ -181,6 +192,11 @@ export class SecurityPanelSidebar extends UI.Widget.VBox {
181192 this . #securitySidebarLastItemSetting. get ( ) === this . cookieReportTreeElement . elemId ) {
182193 this . cookieReportTreeElement . select ( ) ;
183194 this . cookieReportTreeElement . showElement ( ) ;
195+ } else if (
196+ this . ipProtectionTreeElement &&
197+ this . #securitySidebarLastItemSetting. get ( ) === this . ipProtectionTreeElement . elemId ) {
198+ this . ipProtectionTreeElement . select ( ) ;
199+ this . ipProtectionTreeElement . showElement ( ) ;
184200 } else {
185201 this . securityOverviewElement . select ( ) ;
186202 this . securityOverviewElement . showElement ( ) ;
0 commit comments