diff --git a/native/userchrome/profile/chrome/pwa/content/browser.jsm b/native/userchrome/profile/chrome/pwa/content/browser.jsm index fdb3ea41..35e5259a 100644 --- a/native/userchrome/profile/chrome/pwa/content/browser.jsm +++ b/native/userchrome/profile/chrome/pwa/content/browser.jsm @@ -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 () {