:Gijs pointed us this logged error in Bug 1647059 comment 5 (see BrowserConsole screenshot from Bug 1647059 comment 4). The exception is raised by `Services.wm.getMostRecentNonPBWindow` when there is no browser window open, which can happen on macOS when all browser window have been closed (also confirmed by trying to call it manually from the BrowserToolbox after I closed all browser windows for that Firefox instance). On the contrary `Services.wm.getMostRecentWindow` does just return null in that case. This error is unrelated to Bug 1647059, but it seems to still be a legit bug from a WebExtensions API perspective, e.g. uBlock does trigger this error by calling `browser.tabs.query` when the window has been closed and so the API call fails with the generic "An unexpected error occurred" error instead of just returning an empty list of tabs as result of the `tabs.query` API call.
Bug 1654243 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
:Gijs pointed us this logged error in Bug 1647059 comment 5 (see BrowserConsole screenshot from Bug 1647059 comment 4). The exception is raised by `Services.wm.getMostRecentNonPBWindow` when there is no browser window open, which can happen on macOS when all browser window have been closed (also confirmed by trying to call it manually from the BrowserToolbox after I closed all browser windows for that Firefox instance). From a quick look to nsWindowMediator.cpp I guess [it does throw that error from here](https://searchfox.org/mozilla-central/rev/9b282b34b5aa0f836beb735656c55efb2cc4c617/xpfe/appshell/nsWindowMediator.cpp#269-271). On the contrary `Services.wm.getMostRecentWindow` does just return null in that case. This error is unrelated to Bug 1647059, but it seems to still be a legit bug from a WebExtensions API perspective, e.g. uBlock does trigger this error by calling `browser.tabs.query` when the window has been closed and so the API call fails with the generic "An unexpected error occurred" error instead of just returning an empty list of tabs as result of the `tabs.query` API call.