File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 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 {
378378
379379 public setFullScreen ( fullscreen : boolean ) : void {
380380 if ( fullscreen ) {
381- document . documentElement . requestFullscreen ( ) ;
381+ document . documentElement . requestFullscreen ( ) . catch ( ( error ) => {
382+ logger . error ( error . message ) ;
383+ } ) ;
382384 } else {
383- document . exitFullscreen ( ) ;
385+ document . exitFullscreen ( ) . catch ( ( error ) => {
386+ logger . error ( error . message ) ;
387+ } ) ;
384388 }
385389 }
386390
387391 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 ;
389400 }
390401
391402 public isFocused ( ) : boolean {
You can’t perform that action at this time.
0 commit comments