SimGus / chrome-extension-v3-starter

🚀 Minimal Chrome extension template using manifest v3 🚀
MIT License
345 stars 225 forks source link
addon chrome chrome-extension chromium extension

Chrome Extension v3 Starter

A minimal template of a Chrome v3 addon

This repository contains a minimal Chrome/Chromium extension that uses the newest version of the manifest (v3).

You can use it as a basis to develop an extension. It can also give you more insights about how to turn a v2 extension to v3.

In other words, this is a working, installable v3 extension example meant for you to jumpstart the development of your own extension.

Installation

Q&A

Does this work only on Chrome or on other web browsers as well?

At the moment, this works on every chromium-based web browser that supports v3 extensions. Therefore, you should be able to install this extension on any of the following browsers (as long as they are up-to-date):

So it doesn't work on Firefox or Safari?

No, Firefox uses a different extension format. That being said, it is usually not too hard to port extensions from Chrome to Firefox. Read their porting documentation for more information.

Safari uses yet another extension format and porting is usually harder. You can find more information here.

Does this work on Chrome for Android/iOS?

Chrome for mobile doesn't currently support extensions.

I don't need a popup tool for my extension! Can I remove it?

Yes, simply delete the popup folder and remove the default_popup property from the manifest.

I changed some code in the extension, but my changes aren't taken into account!

For most of the changes you make, you will need to reload your extension for the changes to be applied. To do that, go to the chrome://extensions page and click the reload button of your extension. Note that most of the changes you will make to the settings page or the popup don't require reloading the extension.

Can I follow a tutorial about a v2 extension with this?

Most of what you will find in those tutorials still holds with v3.

However, a few things (notably best practices) have changed. You should read the official migration page (v2 to v3) before following such a tutorial.

When I make an erroneous change in my service worker, the extension doesn't load! How can I debug a service worker?

Using the debugger if your service worker is not loaded is not possible.

However, if you want to test some piece of code before putting it in your service worker, you can:

Note that in this console, you have access to anything your service worker has access to, including its variables, functions and chrome APIs.

How do I uninstall this extension from my browser?

I want to push my changes to my own repo, how do I do this?

External resources