After further investigation and testing, I’ve realized that my grid crawler is synchronous, so the event loop never got a chance to break to “kill itself” once the tab got closed.
So, it was basically something like this:
while(true) { console.log('noooooo') }
I would recommend NOT executing this in your normal Firefox as it will freeze almost whole browser with no way to stop it.
If you use recursion, the code will usually quickly fail with stack overflow, but if you don’t overflow the stack, it will just kill the browser and you need to restart it.
Eventually I’ve fixed it using a timeout that will stop the crawler (it checks current time).
So… The question remains, how do I stop the infinite script?
I tried to use the task manager to kill the extension process, which helped, however, I could no longer inspect the background script, so not a great workaround.