Is it possible that Firefox can reload my background script?
Like restarting it, maybe when resources are low…
After investigating some strange “Uncaught (in promise) Error: An unexpected error occurred” errors I’ve noticed it’s coming from my code for detecting container/private window:
const isPrivate = () => browser.runtime.getBackgroundPage().then(bc => bc === null);
I don’t know why but if you reload background script of any addon (using F5 in the inspect tab or by calling
location.reload() in the background script) then when you execute
browser.runtime.getBackgroundPage(), you get the error.
Now I don’t know if I should report it, since it’s kind of a special case…