@@ -97,10 +97,10 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
9797 target . registerOverlayDispatcher ( this ) ;
9898 this . overlayAgent = target . overlayAgent ( ) ;
9999
100+ const settings = this . target ( ) . targetManager ( ) . settings ;
100101 this . #debuggerModel = target . model ( DebuggerModel ) ;
101102 if ( this . #debuggerModel) {
102- Common . Settings . Settings . instance ( )
103- . moduleSetting ( 'disable-paused-state-overlay' )
103+ settings . moduleSetting ( 'disable-paused-state-overlay' )
104104 . addChangeListener ( this . updatePausedInDebuggerMessage , this ) ;
105105 this . #debuggerModel. addEventListener (
106106 DebuggerModelEvents . DebuggerPaused , this . updatePausedInDebuggerMessage , this ) ;
@@ -114,21 +114,19 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
114114 this . #defaultHighlighter = new DefaultHighlighter ( this ) ;
115115 this . #highlighter = this . #defaultHighlighter;
116116
117- this . #showPaintRectsSetting = Common . Settings . Settings . instance ( ) . moduleSetting < boolean > ( 'show-paint-rects' ) ;
118- this . #showLayoutShiftRegionsSetting =
119- Common . Settings . Settings . instance ( ) . moduleSetting < boolean > ( 'show-layout-shift-regions' ) ;
120- this . #showAdHighlightsSetting = Common . Settings . Settings . instance ( ) . moduleSetting < boolean > ( 'show-ad-highlights' ) ;
121- this . #showDebugBordersSetting = Common . Settings . Settings . instance ( ) . moduleSetting < boolean > ( 'show-debug-borders' ) ;
122- this . #showFPSCounterSetting = Common . Settings . Settings . instance ( ) . moduleSetting < boolean > ( 'show-fps-counter' ) ;
123- this . #showScrollBottleneckRectsSetting =
124- Common . Settings . Settings . instance ( ) . moduleSetting < boolean > ( 'show-scroll-bottleneck-rects' ) ;
117+ this . #showPaintRectsSetting = settings . moduleSetting < boolean > ( 'show-paint-rects' ) ;
118+ this . #showLayoutShiftRegionsSetting = settings . moduleSetting < boolean > ( 'show-layout-shift-regions' ) ;
119+ this . #showAdHighlightsSetting = settings . moduleSetting < boolean > ( 'show-ad-highlights' ) ;
120+ this . #showDebugBordersSetting = settings . moduleSetting < boolean > ( 'show-debug-borders' ) ;
121+ this . #showFPSCounterSetting = settings . moduleSetting < boolean > ( 'show-fps-counter' ) ;
122+ this . #showScrollBottleneckRectsSetting = settings . moduleSetting < boolean > ( 'show-scroll-bottleneck-rects' ) ;
125123
126124 if ( ! target . suspended ( ) ) {
127125 void this . overlayAgent . invoke_enable ( ) ;
128126 void this . wireAgentToSettings ( ) ;
129127 }
130128
131- this . #persistentHighlighter = new OverlayPersistentHighlighter ( this , {
129+ this . #persistentHighlighter = new OverlayPersistentHighlighter ( this , settings , {
132130 onGridOverlayStateChanged : ( { nodeId, enabled} ) => {
133131 this . #domModel. nodeForId ( nodeId ) ?. dispatchEventToListeners ( DOMNodeEvents . GRID_OVERLAY_STATE_CHANGED , { enabled} ) ;
134132 this . dispatchEventToListeners ( Events . PERSISTENT_GRID_OVERLAY_STATE_CHANGED , { nodeId, enabled} ) ;
@@ -291,8 +289,9 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
291289 if ( this . target ( ) . suspended ( ) ) {
292290 return ;
293291 }
292+ const settings = this . target ( ) . targetManager ( ) . settings ;
294293 const message = this . #debuggerModel && this . #debuggerModel. isPaused ( ) &&
295- ! Common . Settings . Settings . instance ( ) . moduleSetting ( 'disable-paused-state-overlay' ) . get ( ) ?
294+ ! settings . moduleSetting ( 'disable-paused-state-overlay' ) . get ( ) ?
296295 i18nString ( UIStrings . pausedInDebugger ) :
297296 undefined ;
298297 void this . overlayAgent . invoke_setPausedInDebuggerMessage ( { message} ) ;
@@ -524,7 +523,8 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
524523
525524 private buildHighlightConfig ( mode : string | undefined = 'all' , showDetailedToolip : boolean | undefined = false ) :
526525 Protocol . Overlay . HighlightConfig {
527- const showRulers = Common . Settings . Settings . instance ( ) . moduleSetting ( 'show-metrics-rulers' ) . get ( ) ;
526+ const settings = this . target ( ) . targetManager ( ) . settings ;
527+ const showRulers = settings . moduleSetting ( 'show-metrics-rulers' ) . get ( ) ;
528528 const highlightConfig : Protocol . Overlay . HighlightConfig = {
529529 showInfo : mode === 'all' || mode === 'container-outline' ,
530530 showRulers,
0 commit comments