File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
packages/app-backend-core/src Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -661,18 +661,16 @@ function connectBridge () {
661
661
662
662
ctx . bridge . send ( BridgeEvents . TO_FRONT_TITLE , { title : document . title } )
663
663
// Watch page title
664
- if ( typeof MutationObserver !== 'undefined' ) {
664
+ const titleEl = document . querySelector ( 'title' )
665
+ if ( titleEl && typeof MutationObserver !== 'undefined' ) {
665
666
if ( pageTitleObserver ) {
666
667
pageTitleObserver . disconnect ( )
667
668
}
668
669
pageTitleObserver = new MutationObserver ( ( mutations ) => {
669
670
const title = mutations [ 0 ] . target as HTMLTitleElement
670
671
ctx . bridge . send ( BridgeEvents . TO_FRONT_TITLE , { title : title . innerText } )
671
672
} )
672
- pageTitleObserver . observe (
673
- document . querySelector ( 'title' ) ,
674
- { subtree : true , characterData : true , childList : true } ,
675
- )
673
+ pageTitleObserver . observe ( titleEl , { subtree : true , characterData : true , childList : true } )
676
674
}
677
675
}
678
676
You can’t perform that action at this time.
0 commit comments