Skip to content

A chrome extension to send sidepanel information to content script

Notifications You must be signed in to change notification settings

edmonomer/playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

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.

About

A chrome extension to send sidepanel information to content script

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published