chrome-extensions-samples/functional-samples/cookbook.sidepanel-open
Oliver Dunk d2296fac85
Update dependencies (#1096)
Updates a nunber of dependencies in a single PR. These were
suggested by dependabot but updating them individually would
mean the reposistory would be in a broken state until everything
had merged.

I'm not personally a huge fan of lowercasing doctype, but
Prettier has taken an opinionated stance here and there is not a
way to disable it:

https://github.com/prettier/prettier/issues/15096
2024-02-20 12:53:23 +01:00
..
images [SidePanel API] Add sidePanel.open() cookbook (#983) 2023-07-18 10:36:40 -06:00
README.md [SidePanel API] Add sidePanel.open() cookbook (#983) 2023-07-18 10:36:40 -06:00
content-script.js [SidePanel API] Add sidePanel.open() cookbook (#983) 2023-07-18 10:36:40 -06:00
manifest.json Update description fields for all samples (#994) 2023-08-17 18:19:42 +01:00
page.html Update dependencies (#1096) 2024-02-20 12:53:23 +01:00
script.js [SidePanel API] Add sidePanel.open() cookbook (#983) 2023-07-18 10:36:40 -06:00
service-worker.js [SidePanel API] Add sidePanel.open() cookbook (#983) 2023-07-18 10:36:40 -06:00
sidepanel-global.html Update dependencies (#1096) 2024-02-20 12:53:23 +01:00
sidepanel-tab.html Update dependencies (#1096) 2024-02-20 12:53:23 +01:00

README.md

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.