@@ -706,14 +706,20 @@ class Frame extends ImmutableComponent {
706
706
this . props . onCloseFrame ( this . frame )
707
707
} )
708
708
this . webview . addEventListener ( 'page-favicon-updated' , ( e ) => {
709
- if ( e . favicons && e . favicons . length > 0 ) {
709
+ // TODO(Anthony): more general solution on muon to prevent weview event
710
+ // from emitting after tab closed
711
+ if ( e . favicons && e . favicons . length > 0 && this . frame ) {
710
712
imageUtil . getWorkingImageUrl ( e . favicons [ 0 ] , ( imageFound ) => {
711
713
windowActions . setFavicon ( this . frame , imageFound ? e . favicons [ 0 ] : null )
712
714
} )
713
715
}
714
716
} )
715
717
this . webview . addEventListener ( 'page-title-updated' , ( { title} ) => {
716
- windowActions . setFrameTitle ( this . frame , title )
718
+ // TODO(Anthony): more general solution on muon to prevent weview event
719
+ // from emitting after tab closed
720
+ if ( this . frame ) {
721
+ windowActions . setFrameTitle ( this . frame , title )
722
+ }
717
723
} )
718
724
this . webview . addEventListener ( 'show-autofill-settings' , ( e ) => {
719
725
windowActions . newFrame ( { location : 'about:autofill' } , true )
@@ -722,9 +728,13 @@ class Frame extends ImmutableComponent {
722
728
contextMenus . onShowAutofillMenu ( e . suggestions , e . rect , this . frame )
723
729
} )
724
730
this . webview . addEventListener ( 'hide-autofill-popup' , ( e ) => {
725
- let webContents = this . webview . getWebContents ( )
726
- if ( webContents && webContents . isFocused ( ) ) {
727
- windowActions . autofillPopupHidden ( this . props . tabId )
731
+ // TODO(Anthony): more general solution on muon to prevent weview event
732
+ // from emitting after tab closed
733
+ if ( this . frame ) {
734
+ let webContents = this . webview . getWebContents ( )
735
+ if ( webContents && webContents . isFocused ( ) ) {
736
+ windowActions . autofillPopupHidden ( this . props . tabId )
737
+ }
728
738
}
729
739
} )
730
740
this . webview . addEventListener ( 'ipc-message' , ( e ) => {
0 commit comments