@@ -393,7 +393,7 @@ class PageTarget {
393393 this . _videoRecordingInfo = undefined ;
394394 this . _screencastRecordingInfo = undefined ;
395395 this . _dialogs = new Map ( ) ;
396- this . forcedColors = 'no-override ' ;
396+ this . forcedColors = 'none ' ;
397397 this . disableCache = false ;
398398 this . mediumOverride = '' ;
399399 this . crossProcessCookie = {
@@ -635,7 +635,8 @@ class PageTarget {
635635 }
636636
637637 updateForcedColorsOverride ( browsingContext = undefined ) {
638- ( browsingContext || this . _linkedBrowser . browsingContext ) . forcedColorsOverride = ( this . forcedColors !== 'no-override' ? this . forcedColors : this . _browserContext . forcedColors ) || 'no-override' ;
638+ const isActive = this . forcedColors === 'active' || this . _browserContext . forcedColors === 'active' ;
639+ ( browsingContext || this . _linkedBrowser . browsingContext ) . forcedColorsOverride = isActive ? 'active' : 'none' ;
639640 }
640641
641642 async setInterceptFileChooserDialog ( enabled ) {
@@ -858,8 +859,8 @@ function fromProtocolReducedMotion(reducedMotion) {
858859function fromProtocolForcedColors ( forcedColors ) {
859860 if ( forcedColors === 'active' || forcedColors === 'none' )
860861 return forcedColors ;
861- if ( forcedColors === null )
862- return undefined ;
862+ if ( ! forcedColors )
863+ return 'none' ;
863864 throw new Error ( 'Unknown forced colors: ' + forcedColors ) ;
864865}
865866
@@ -893,7 +894,7 @@ class BrowserContext {
893894 this . forceOffline = false ;
894895 this . disableCache = false ;
895896 this . colorScheme = 'none' ;
896- this . forcedColors = 'no-override ' ;
897+ this . forcedColors = 'none ' ;
897898 this . reducedMotion = 'none' ;
898899 this . videoRecordingOptions = undefined ;
899900 this . crossProcessCookie = {
0 commit comments