Anatomy of Browser Extension

Dissecting an Extension

What does an Extension package contains?

An extension consists of a collection of files, packaged for distribution and installation. In this article, we will quickly go through the files that might be present in an extension.

Overview of the Extension package

image.png

manifest.json

This is the only file that must be present in every extension. It contains basic metadata such as its name, version, and permissions it requires. It also provides pointers to other files in the extension.

The manifest can also contain pointers to several other types of files:

  • Background scripts

  • Icons

  • Sidebars, popups, and options pages

  • Content scripts

  • Web-accessible resources

Read more here: developer.mozilla.org/en-US/docs/Mozilla/Ad..

In the upcoming sections, we will explore the architecture and all the different sections and their importance in the extension.