Quick answer
A side panel is an extension page shown beside the current tab. Declare side_panel.default_path and the sidePanel permission, then choose how the user opens it. It is a good surface for a persistent comparison or inspector because clicking the page does not dismiss it like a popup.
The panel is not the web page. It cannot read that page’s DOM through its own document; use content-script results or an appropriately authorized injection. Choose global or tab-specific panel behavior explicitly, and label results with the document they came from.
Practical implementation steps
- Package
panel.html, its scripts, and styles; the API is available from Chrome 114, while programmaticopen()requires Chrome 116. Set the compatibility floor for the specific APIs you actually use. - For a toolbar-controlled panel, configure
openPanelOnActionClick. Avoid simultaneously promising popup behavior on that same action; choose one clear primary surface. - For conditional availability, use
setOptionswith a tab identifier andenabled. If you inspect URLs to decide availability, request only the corresponding access needed for those sensitive tab properties. ThesidePanelpermission alone does not grant arbitrary page access. - Decide what happens when the active tab changes. A global panel may still show a previous result; a tab-specific panel may have an independent instance. Keep tab and document identity with each result and show a stale or unavailable state on navigation.
- Keep durable preferences in extension storage, transient selection in the panel, and document-specific DOM handles in the content script. Closing a panel can destroy its view; reopening should restore only data whose identity still matches.
A font inspector can benefit from persistent controls while the user moves around the page, but Font Picker’s product record does not establish that its current UI uses the Side Panel API. Use it as an interaction example, not as a claimed implementation precedent.
Implementation example
A minimal global panel can use Chrome’s built-in action behavior. Place the second block in the declared worker; it does not require reading a tab URL.
{
"manifest_version": 3,
"name": "Persistent inspector",
"version": "1.0.0",
"minimum_chrome_version": "114",
"permissions": ["sidePanel"],
"action": { "default_title": "Open inspector" },
"side_panel": { "default_path": "panel.html" },
"background": { "service_worker": "worker.js" }
}
chrome.runtime.onInstalled.addListener(() => {
chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true })
.catch(console.error);
});
If you instead call chrome.sidePanel.open({ tabId }), do it in direct response to a supported user gesture and use the relevant browser floor. Do not delay opening behind arbitrary network work and expect the gesture to remain valid. That call opens a surface; it is not permission to inspect the tab’s content.
Tradeoffs and alternatives
A global panel simplifies shared controls but needs explicit source identity for results. A tab-specific panel isolates tab workflows but increases state and cleanup obligations. A full extension tab offers more width for a large report; a popup remains convenient for a short command.
Do not add a side panel merely to make a small extension look larger. Its benefit should be an interaction that persists alongside the page. Test narrow available widths and translated labels rather than assuming a desktop viewport.
Common mistakes
- Calling
open()without a qualifying user gesture. - Confusing panel DOM with the inspected website DOM.
- Showing a previous tab’s result as current after navigation.
- Requesting broad host access simply because the panel exists.
- Assuming panel visibility guarantees a worker’s permanent lifetime.
Production checklist
- Browser minimum covers every panel API used.
- Opening behavior has one clear user gesture.
- Results include tab/document identity and stale-state handling.
- Reopening and switching tabs reconstruct the intended state.
- Narrow layout and keyboard use remain practical.
FAQ
Does sidePanel grant access to websites?
No. Page operations still require their own injection strategy and authorization.
Can I use a panel and popup in one product?
Yes, for distinct tasks, but explain how each opens and avoid ambiguous toolbar behavior.
When is the panel the right choice?
When users need to inspect or compare results while continuing to interact with a page. Start with that workflow, then select global or per-tab scope from its identity requirements.
Primary sources
Related guides and examples
Need this implemented in a real product?
Browser tools with a clear purpose, focused permissions, and a maintainable Manifest V3 architecture.