webextensions-examples icon indicating copy to clipboard operation
webextensions-examples copied to clipboard

Example of generating a manifest for both Firefox and Chrome

Open kumar303 opened this issue 8 years ago • 5 comments
trafficstars

A key point of the WebExtensions API is building cross-platform extensions. However, the manifest is one file that differs significantly between Firefox and Chrome so it's inevitable that you'll need to ship a separate manifest for each.

It would be great to provide an example of this, perhaps one similar to this method of using webpack to copy a platform specific manifest. The downside to this method is that many details are duplicated between each manifest. A better approach would be to render a manifest using a template. I think webpack would support that.

kumar303 avatar Sep 25 '17 16:09 kumar303

@kumar303 Sure? look at this https://developer.mozilla.org/de/Add-ons/WebExtensions/manifest.json for "webextensions api" ! or am I wrong?

However, the manifest is one file that differs significantly between Firefox and Chrome so it's inevitable that you'll need to ship a separate manifest for each.

SerkanSipahi avatar Oct 21 '17 17:10 SerkanSipahi

Well, they don't differ significantly but as I recall there are certain things you could put in a Firefox manifest that will throw errors (or at least warnings) in Chrome. One example is the gecko ID.

kumar303 avatar Oct 21 '17 19:10 kumar303

@kumar303 which properties (manifest.json) for firefox are mandatory? is there any resources?

SerkanSipahi avatar Oct 21 '17 20:10 SerkanSipahi

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json https://developer.chrome.com/extensions/manifest

yfdyh000 avatar Oct 22 '17 01:10 yfdyh000

@yfdyh000 i saw this tables (https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json) but overlooked the differs. Thank you :)

SerkanSipahi avatar Oct 22 '17 10:10 SerkanSipahi

No activity within the last three years, closing.

rebloor avatar Jul 30 '23 23:07 rebloor