Files
amysteamdev 6f2e616494 [SidePanel API] Add sidePanel.open() cookbook (#983)
* 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
2023-07-18 10:36:40 -06:00

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

  1. Clone this repository.
  2. Load this directory in Chrome as an unpacked extension.

Test with a context menu

  1. Navigate to any page, like example.com.
  2. Right-click on any word.
  3. Choose the context menu "Open side panel".

Test in an extension page

  1. The extension page will open when you install the extension.
  2. Click on the "Open side panel" button.

Test by clicking on an injected element

  1. Navigate to google.com.
  2. Scroll to the very bottom of the page.
  3. Click on the "Open side panel" button.