Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support vendor-specific manifest.json #416

Merged
merged 4 commits into from
Mar 12, 2018
Merged

Conversation

lidel
Copy link
Member

@lidel lidel commented Mar 8, 2018

Background

As noted in #398 Firefox supports additional WebExtension APIs, but Chrome throws an error if we include them in manifest.json.

TL;DR this PR will make it possible to provide additional features per vendor in a safe way.

Changes

Manifest is Assembled During Build

This change splits manifest into common and vendor-specific files:

add-on/
├── manifest.common.json       # manifest base that is optionally extended for vendor-specific builds
├── manifest.firefox.json
├── manifest.firefox-beta.json
└── manifest.json              # generated during build

Behaviour of npm run build does not change, but there are new commands in bundle:* namespace that enable developer to quickly switch manifest between different targets and (re)create a valid bundle for a specific vendor.

Build Creates Multiple Bundles

Right now we have two targets enabled by default.
A generic one for Chrome and Brave and firefox for Firefox:

build
├── generic
│   └── ipfs_companion-2.2.0.zip
└── firefox
    └── ipfs_companion-2.2.0.zip

lidel added 4 commits March 8, 2018 16:08
As noted in #398
Firefox supports additional WebExtension APIs, but Chrome throws
an error on them.

This change splits manifest into common and vendor-specific files
and creates a dedicated bundle for each.
Fixes warnings about unknown keys under Chrome
@lidel lidel self-assigned this Mar 8, 2018
@lidel lidel requested review from alanshaw and olizilla March 8, 2018 17:03
@lidel lidel changed the title Create separate bundle for Firefox Support vendor-specific manifest.json Mar 8, 2018
@lidel
Copy link
Member Author

lidel commented Mar 12, 2018

I am merging this to unlock #398.

@lidel lidel merged commit d7435d4 into master Mar 12, 2018
@lidel lidel deleted the feat/custom-build-targets branch March 12, 2018 12:41
@alanshaw
Copy link
Member

Apologies I didn't get a chance to look at this last week. I just had a quick glance and it looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants