Identical .xpi files for Chrome and Firefox

Is it possible to use an identical XPI file with Firefox and Chrome? It almost works, but the Chrome loader complains about the “gecko” item in manifest.json. Add-on still runs, but is not submittable to Google.

Now that Safari is on board with WebExtensions, is anyone working on a cross-browser add-on store that works for all the major browsers?

My Flickr Fixr extension are available in exact identical versions for Firefox, Chrome and the new Chromium based Edge. It is the exact same zip (xpi) file I have uploaded to all add-on stores. Unless Google has changed something within the last two months, I have no problem with applications.gecko item in the manifest.json file:

As for Safari, their addons needs to be packaged in a special way (At least as I understand it!?). And of course you need Apple software to do so. So currently it is not possible to upload exact same version of extension to Safari add-on store.

It’s not always possible to be compatible with the same build (same manifest.json file).
Some API are simply not there, for example "tabHide" permission is not in Chrome.

But you should definitely use one code base for both builds and use something like Webpack (or simple NodeJS script) to bundle correct manifest.json file.

While that is a lovely idea, sadly code signing requirements by the browsers make this a bit hard to pull off as a smooth experience.

I now have the add-on up on Firefox and in the queue in Google land. Identical .zip file. While Chromium gives a warning for the “gecko” parameter in the manifest.json file, it works anyway. Google’s uploader seems happy with it. The file has the Mozilla shim for Chrome compatibility. Amusingly, I get a warning on AMO upload about using a known library, even though that’s what Mozilla suggests.

That’s interesting. I remember Chrome refused to load addon if it had issues with it’s manifest but I guess it applies only to syntax error and not unsupported features :slight_smile:.

But still I’m not sure it works with all keys. For example Firefox seems to be unable to load addon with "incognito": "split" key in manifest that I use for Chrome and it fails with Reading manifest: Error processing incognito: Invalid enumeration value "split".