growthbook / devtools

GrowthBook DevTools extension for Chrome
MIT License
5 stars 5 forks source link

GrowthBook DevTools behaves unexpectedly with multiple tabs running the GrowthBook SDK #42

Closed bttf closed 11 months ago

bttf commented 12 months ago

Problem: Currently, if a user has multiple tabs open with each tab running an instance of the GrowthBook JS SDK, the GrowthBook DevTools extension will behave unexpectedly. This is due to the DevTools extension indiscriminately selecting the first tab it finds to communicate with.

DevTools extension upon opening (syncs with current tab's GrowthBook SDK)

Screenshot 2023-10-13 at 4 31 36 PM

DevTools extension upon opening a 2nd tab with it's own GrowthBook SDK (extension syncs with recently opened tab)

Screenshot 2023-10-13 at 4 32 07 PM

**Proposed solution**: Ensure messages are contained between tab and content script and background script target the inspected window.

**Implementation:**

  1. See example solution provided by contributor

Related bug #39