GoogleChrome / GoogleChrome/chrome-extensions-samples
Opening Side Panel with `tabId` parameter opens side panel on all tabs
- Dominant language
- JavaScript
- Stars
- 17.8k
- Forks
- 9k
- Avg merge
- 21h
- Merged PRs (30d)
- 28
Description
⚠️ If you have general Chrome Extensions questions, consider posting to the [Chromium Extensions Group](https://groups.google.com/a/chromium.org/forum/#!forum/chromium-extensions) or [Stack Overflow](https://stackoverflow.com/questions/tagged/google-chrome-extension).
**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'](https://github.com/GoogleChrome/chrome-extensions-samples/blob/main/functional-samples/cookbook.sidepanel-open/script.js)
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. 🌈
Contributor guide
Research direction
Start with functional-samples/cookbook.sidepanel-open/script.js and reproduce the reported behavior using the listed steps. Trace how the sample opens the side panel and compare the observed tab scope with the expected active-tab-only behavior. Done means the sample reliably keeps the side panel limited to the intended tab.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100