Seems like we still need to prevent or handle port disconnection more gracefully, when the tab or extension isn't used for a while, the service worker goes offline/inactive and the extension becomes unusable as it tries to post a message but could not, along with the following error
Uncaught Error: Attempting to use a disconnected port object
We're able to "reset" the extension state when it is disconnected by attaching a listener from the onDisconnect property, but the 'reload' button would still not work because it's tries to send a message to reload the tab.
Seems like we still need to prevent or handle port disconnection more gracefully, when the tab or extension isn't used for a while, the service worker goes offline/inactive and the extension becomes unusable as it tries to post a message but could not, along with the following error
We're able to "reset" the extension state when it is disconnected by attaching a listener from the
onDisconnect
property, but the 'reload' button would still not work because it's tries to send a message to reload the tab.