sveltejs / svelte-devtools

A browser extension to inspect Svelte application by extending your browser devtools capabilities
https://chromewebstore.google.com/detail/svelte-devtools/kfidecgcdjjfpeckbblhmfkhmlgecoff
MIT License
1.42k stars 78 forks source link

fix: prevent premature port disconnection #159

Closed ignatiusmb closed 9 months ago

ignatiusmb commented 9 months ago

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.