Luke
Luke

Reputation: 5708

Is it possible to package multiple Chrome extensions together?

Does Google allow you to package multiple, separate extensions together, so users can install all of them with only one click?

I haven't been able to find anything on the matter so I am thinking that it is not possible at this point.

I ask because I am in the process of creating useful context menu options, These options naturally fall under a few distinct categories and I would like to avoid the forced nesting that would occur If I were to put everything in a single extension.

If I make 3 separate extensions, then I can make all of them top-level options, thus creating a more convenient user experience. However, I would like to avoid making the users initiate 3 separate downloads if possible.

Upvotes: 2

Views: 2103

Answers (1)

Marco Bonelli
Marco Bonelli

Reputation: 69367

To answer your first question: nope, Google doesn't allow you to package multiple extensions together. Every extension has got its own Chrome Web Store page and ID. The only way Google lets a regular user install it is by downloading it from the store.

On the other hand, you're saying:

I am in the process of creating useful context menu options, These options naturally fall under a few distinct categories [..]. If I make 3 separate extensions, then I can make all of them top-level options, thus creating a more convenient user experience.

Let's clarify this thing a bit. I'm assuming that you already know that Chrome extensions should have a single purpose, and you obviously don't want to go against this logic. By the way, consider the following:

  • Why should you write separate extensions?

    • The different behaviors of every single extension are particularly different from each other. For example one of them stores browsing data, another one translates pages, and another gives a page action only on certain pages to manipulate them.
    • The extensions share the same common super-logic, but differentiate in different sub-logics. For example an extension that lets the user inject code in some pages and another one that lets inject some media, or CSS style.
    • The extensions are all related to the same category of sites/things, but every one of them offers a completely different service to the user. For example some extensions that are all working on shopping sites, but: one of them checks prices against other sites to compare them, another one lets you store articles from different sites to see the total in it's browser action, etc.

  • Why should you write a single extension for multiple purposes?

    • The behaviors of every single extension are similar to each other. For example one of them makes you share links on a certain social network, and another one makes you share photos.
    • Creating more than one extension will not eliminate the need of messaging between them using external messaging.
    • The extensions may be configured by the user to have the exact same behavior, or totally different behaviors. You don't know which user is going to separate and which one is going to connect them.
    • The behavior of the extension can be chosen from the user (in a settings page or at the installation).

These are some basic points that came to my mind thinking of this, and I know this is clearly primarily opinion based, so you may not think of the same things, but that's just to help you figure out how to go on with your extensions.


If you decide to work with different extensions, you could program each one of them to recommend the user to download the other ones (by checking if they're installed or not), or maybe (but I do not recommend you this in any way) force the user to install them altogether (also checking for the missing ones).

Here is an example of how you can check if your extension is installed using chrome.management.get():

var ext2installed = false;

chrome.management.get("<extension2-id>", function(info) {
    if (info) ext2installed = true;
});

Obviously, if you are working with three extensions this may become a bit repetitive, but nothing absurd, you'll just need to add the code for every extension to check if the two other extensions are installed.

Upvotes: 3

Related Questions