Describe the bug
A clear and concise description of what the bug is.
In src/background.js the handler for tabs.onUpdated event attachScript is added and removed without consideration for case of multiple simultanious DevTools instaces.
To Reproduce
Steps to reproduce the behavior:
Open tab 1 made with Svelte, open Svelte DevTools
Open tab 2 example.com (or any other site), open Svelte DevTools, close Svelte DevTools
Go to tab 1 and refresh page in any way (via F5 or CTRL+F5 shortcut, reload button, or Svelte DevTools)
Notice that tad 1 Svelte DevTools window still shows "Not working? Did you..." message.
Expected behavior
Tab 1 Svelte DevTools should work and not show "Not working? Did you..." message.
Environment
Browser with version Chrome 91
Devtools version 3.0.0
Svelte version 1.3.0
Additional context
This issue is caused by improper port disconnect handling logic in background. It removes tabs.onUpdated event listener when tab 2 DevTools are closed at step 2, even though this listener is still needed for tab 1 DevTools at step 3 and 4.
This bug can be easily fixed by taking into account number of open ports, e.g. by adding an extra counter or just checking toolsPorts.size. I won't file a PR for this because I'm changing background logic in a larger way which will fix this bug.
Describe the bug A clear and concise description of what the bug is.
In
src/background.js
the handler fortabs.onUpdated
eventattachScript
is added and removed without consideration for case of multiple simultanious DevTools instaces.To Reproduce Steps to reproduce the behavior:
example.com
(or any other site), open Svelte DevTools, close Svelte DevToolsExpected behavior Tab 1 Svelte DevTools should work and not show "Not working? Did you..." message.
Environment
Additional context This issue is caused by improper port disconnect handling logic in background. It removes
tabs.onUpdated
event listener when tab 2 DevTools are closed at step 2, even though this listener is still needed for tab 1 DevTools at step 3 and 4. This bug can be easily fixed by taking into account number of open ports, e.g. by adding an extra counter or just checkingtoolsPorts.size
. I won't file a PR for this because I'm changing background logic in a larger way which will fix this bug.