File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed
native/userchrome/profile/chrome/pwa Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -45,22 +45,17 @@ class ChromeLoader {
4545 static INITIALIZED_PREFERENCES = false ;
4646
4747 constructor ( ) {
48- Services . obs . addObserver ( this , 'chrome-document-global-created' , false ) ;
48+ Services . obs . addObserver ( this , 'chrome-document-global-created' ) ;
4949 }
5050
5151 observe ( window ) {
52- window . ChromeLoader = ChromeLoader ;
53- window . addEventListener ( 'DOMContentLoaded' , this , { once : true } ) ;
52+ window . addEventListener ( 'DOMContentLoaded' , ( ) => {
53+ window . parent . ChromeLoader = ChromeLoader ;
54+ this . onDomContentLoaded ( window ) ;
55+ } , { once : true } ) ;
5456 }
5557
56- handleEvent ( event ) {
57- /**
58- * @type Document
59- * @property {Window } originalTarget
60- */
61- let document = event . originalTarget ;
62-
63- let window = document . defaultView ;
58+ onDomContentLoaded ( window ) {
6459 let location = window . location ;
6560
6661 if ( window . _gBrowser ) window . gBrowser = window . _gBrowser ;
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ function setWindowColors (window, site) {
144144 const styles = createOrGetStyles ( window , INTEGRATION_STATIC_STYLES ) ;
145145
146146 // Set the window background color
147- if ( lazy . xPref . get ( window . ChromeLoader . PREF_SITES_SET_BACKGROUND_COLOR ) && site . manifest . background_color ) {
147+ if ( lazy . xPref . get ( 'firefoxpwa.sitesSetBackgroundColor' ) && site . manifest . background_color ) {
148148 const backgroundColor = site . manifest . background_color . substring ( 0 , 7 ) ;
149149
150150 // Set background color to the browser window
@@ -163,7 +163,7 @@ function setWindowColors (window, site) {
163163 }
164164
165165 // Set the theme (titlebar) background and text colors
166- if ( lazy . xPref . get ( window . ChromeLoader . PREF_SITES_SET_THEME_COLOR ) && site . manifest . theme_color ) {
166+ if ( lazy . xPref . get ( 'firefoxpwa.sitesSetThemeColor' ) && site . manifest . theme_color ) {
167167 // Set the static theme color from the manifest
168168 const colorHex = site . manifest . theme_color . substring ( 0 , 7 ) ;
169169 const colorRGB = colorHex . match ( / ^ # ? ( [ a - f \d ] { 2 } ) ( [ a - f \d ] { 2 } ) ( [ a - f \d ] { 2 } ) $ / i) . slice ( 1 ) . map ( c => parseInt ( c , 16 ) ) ;
You can’t perform that action at this time.
0 commit comments