File tree 1 file changed +14
-3
lines changed 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -378,14 +378,25 @@ class BrowserWindow extends EventEmitter {
378
378
379
379
public setFullScreen ( fullscreen : boolean ) : void {
380
380
if ( fullscreen ) {
381
- document . documentElement . requestFullscreen ( ) ;
381
+ document . documentElement . requestFullscreen ( ) . catch ( ( error ) => {
382
+ logger . error ( error . message ) ;
383
+ } ) ;
382
384
} else {
383
- document . exitFullscreen ( ) ;
385
+ document . exitFullscreen ( ) . catch ( ( error ) => {
386
+ logger . error ( error . message ) ;
387
+ } ) ;
384
388
}
385
389
}
386
390
387
391
public isFullScreen ( ) : boolean {
388
- return document . fullscreenEnabled ;
392
+ // TypeScript doesn't recognize this property.
393
+ // tslint:disable no-any
394
+ if ( typeof ( window as any ) [ "fullScreen" ] !== "undefined" ) {
395
+ return ( window as any ) [ "fullScreen" ] ;
396
+ }
397
+
398
+ // tslint:enable no-any
399
+ return false ;
389
400
}
390
401
391
402
public isFocused ( ) : boolean {
You can’t perform that action at this time.
0 commit comments