chrome-extensions-samples icon indicating copy to clipboard operation
chrome-extensions-samples copied to clipboard

Opening Side Panel with `tabId` parameter opens side panel on all tabs

Open belthaZornv opened this issue 1 year ago • 1 comments

⚠️ If you have general Chrome Extensions questions, consider posting to the Chromium Extensions Group or Stack Overflow.

Describe the bug

I'm using:

https://github.com/GoogleChrome/chrome-extensions-samples/blob/main/functional-samples/cookbook.sidepanel-open/script.js

But the sidepanel stays open for all the tabs.

To Reproduce Steps to reproduce the behavior, or file the issue is found in:

  1. Go to 'cookbook'
  2. Copy and paste the code to your code (background script)
  3. Install and open sidePanel -> sidePanel on all tabs.

Expected behavior

SidePanel only open for the active tab

Screenshots If applicable, add screenshots to help explain your problem.

Notes Anything additional here. 🌈

belthaZornv avatar Jun 10 '24 12:06 belthaZornv

Bringing attention to this – using chrome.sidePanel.open({ tabId: sender.tab.id }); still seems to open the tab-specific side panel on the intended tab, but also opens the global tab defined in the "default_path": in manifest.json everywhere else.

munr0 avatar Oct 14 '24 06:10 munr0