disclaimer: This document is more about my personal understanding about Chrome Extension. Please feel free to correct me by opening an issue if you see anything wrong.
Content scripts are files that run in the context of web pages.
As a screenshot below, the right sidebar and annotation popup window are created by Content Scripts
.
In saltynote extension, the Content Scripts
will not interact with saltynote service directly. Instead, it will send different types of messages to Background Scripts
, then Background Scripts
will send corresponding requests to service, and pass service response to Content Scripts
through messages.
Background Scripts
are used to handle browser events. In saltynote extension, it will:
Content Scripts
Options Page
works simply as general web page embedded in extension.
It is used to allow users to customise the behavior of an extension by providing an options page
,
but in saltynote extension, we use it as a dashboard, where users can view all theirs page annotations, and manage them.