How to create a Chrome Extensions






What are the prerequisites to building a chrome extension?

A Chrome extension is essentially a web page.
If you are familiar with common web technologies – such as HTML, CSS, JavaScript – you are able to build a chrome extension as well.

Your Chrome extension can use all the APIs that a browser provides (such as JSON, or XMLHttpRequest). It can interact with any web page or server using content scripts or cross-origin XHR. Extensions can also interact with browser features, such as browser tabs.

However, building a Chrome extension is not only a matter of technical knowledge but requires meeting Google’s quality standards. Similar to iOS design and quality guidelines, a Chrome extension must meet the “Extension Quality Guidelines”.

File structure and architecture of a Chrome extension

Extension files are zipped into a single .cry package which the user downloads and installs. Such an extension package must consist of the following files:
  • A manifest file
  • One or multiple HTML files
  • Any other file which your extension needs (e.g. images, JavaScript file)

The Manifest File

Every single Chrome extension must have a JSON-formatted manifest file, named manifest.json.

This manifest file provides all necessary information about your Chrome extension, such as versioning, permissions, and other useful meta information. The file must be placed in the root folder of your chrome extension.
According to Google, every manifest file must contain the following information:

{
"manifest_version": "2.1",
"name": "My Extension",
"version": "versionString",
}

How to test your Chrome extension

Once you’re finished with the actual development work of your Chrome extensions, you need to make sure to properly test it.
And luckily testing your new extension is pretty straight-forward. Once you’ve activated the “developer mode” of your chrome extension settings (accessible with chrome://extensions), you are good to go.
 



Comments