File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -145,20 +145,23 @@ S4EStatusService.prototype =
145
145
this . _window . XULBrowserWindow . watch ( prop , XULBWPropHandler ) ;
146
146
} , this ) ;
147
147
148
- let XULBWHandler = function ( prop , oldval , newval ) {
149
- if ( ! newval )
150
- {
148
+ if ( this . _window . watch ) { // See https://github.com/JustOff/L4E/issues/1
149
+ let XULBWHandler = function ( prop , oldval , newval ) {
150
+ if ( ! newval )
151
+ {
152
+ return newval ;
153
+ }
154
+ CU . reportError ( "XULBrowserWindow changed. Updating S4E bindings." ) ;
155
+ this . _window . setTimeout ( function ( self )
156
+ {
157
+ self . buildBinding ( ) ;
158
+ } , 0 , this ) ;
151
159
return newval ;
152
- }
153
- CU . reportError ( "XULBrowserWindow changed. Updating S4E bindings." ) ;
154
- this . _window . setTimeout ( function ( self )
155
- {
156
- self . buildBinding ( ) ;
157
- } , 0 , this ) ;
158
- return newval ;
159
- } ;
160
+ } ;
161
+
162
+ this . _window . watch ( "XULBrowserWindow" , XULBWHandler ) ;
163
+ }
160
164
161
- this . _window . watch ( "XULBrowserWindow" , XULBWHandler ) ;
162
165
} ,
163
166
164
167
destroy : function ( )
You can’t perform that action at this time.
0 commit comments