Closed seansfkelley closed 4 years ago
This can't be fixed fully. When the popup closes, all the objects in the context are marked as dead, and any attempt to use them will throw an error in the console.
The request will complete, but callbacks will fail to execute. Given that the popup wants to know when the request completes so it can examine the response, there's no way we can make this work without polling.
Any solution to make this work will require shipping off much of the work to the background task through a message. If the popup didn't care about the response, this would be trivial. Since it does, we either need to implement polling, or make it not care.
j/k, this can be fixed because sendMessage
is allowed to return a promise for whatever the handler of the message responds with. Fixed in bb1b740badaea989a7baef8321464c6a54c7e753.
Most commonly: deleting a downloaded or just-finished task.