Skip to content

Commit

Permalink
Prevent error when changing the search mode
Browse files Browse the repository at this point in the history
  • Loading branch information
filips123 committed Sep 13, 2024
1 parent 0b06be2 commit 5ecc20f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions native/userchrome/profile/chrome/pwa/content/browser.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,16 @@ class PwaBrowser {
// Also un-focus the URL bar in case it is focused for some reason
document.getElementById('urlbar').removeAttribute('focused');

// Restore the original toolbar visibility
window.toolbar.visible = originalToolbarVisibility;

// Prevent error when changing search mode when `searchModeSwitcher` is undefined
Object.defineProperty(window.gURLBar, 'searchMode', {
set: function (searchMode) {
this.setSearchMode(searchMode, this.window.gBrowser.selectedBrowser);
this.searchModeSwitcher?.onSearchModeChanged();
},
});
}

setDisplayModeStandalone () {
Expand Down

0 comments on commit 5ecc20f

Please sign in to comment.