mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-27 13:29:34 +07:00
* Init commit * Add sidepanel open cookbook * Add minimum chrome version * Add 116 on readme * Add extension page Add content script * Tweak * Tweak 2 * ¯\_(ツ)_/¯ * Update readme * Update readme * Change sample name in Readme * Bold Chrome 116 for emphasis * Typo fix
1.1 KiB
1.1 KiB
Opening the side panel through a user interaction
This example demonstrates using chrome.sidePanel.open() to open a global side panel through a context menu click and a tab-specific side panel by clicking a button in an extension page or a button click injected by a content script. This feature will be available starting Chrome 116.
Running this extension
- Clone this repository.
- Load this directory in Chrome as an unpacked extension.
Test with a context menu
- Navigate to any page, like example.com.
- Right-click on any word.
- Choose the context menu "Open side panel".
Test in an extension page
- The extension page will open when you install the extension.
- Click on the "Open side panel" button.
Test by clicking on an injected element
- Navigate to google.com.
- Scroll to the very bottom of the page.
- Click on the "Open side panel" button.