Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.55 KB

readme.md

File metadata and controls

25 lines (20 loc) · 1.55 KB

Site-specific side panel and contentscript communication example

This example demonstrates how to display the side panel only on google.com using the Side Panel API and Storage API and Notification API. It allows users to open the side panel by clicking on the action icon which is site-specific.

Functions of this extension

  1. Pass textarea by row to content page textboxes by one button via storage.local and chrome.tabs.sendMessage.
  2. Contentscript include conditional examining data to take different action
  3. Contentscript send message to service worker to trigger notification when complete via chrome.runtime.sendMessage.
sequenceDiagram
Sidepanel Textarea->+Content Page: chrome.tabs.sendMessage 
Note right of Sidepanel Textarea: Storage.local
Content Page--> -Service Worker: chrome.runtime.sendMessage
Note right of Content Page: Complete!<br/>Trigger notification
Loading

Running this extension

  1. Clone this repository.
  2. Load this directory in Chrome as an unpacked extension.
  3. Pin the extension.
  4. Go to https://www.google.com.
  5. Click on the action icon to open the side panel.