Skip to content

feat: add support for CRXv3 #98

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

Merged
merged 7 commits into from
Mar 29, 2019
Merged

Conversation

ahwayakchih
Copy link
Collaborator

This adds --format-version option that defaults to 2, but can be set to 3.
Current (72.0.3626.109 here) versions of Chromium generate CRX files in v3 format. V2 is still supported, but who knows for how long.

Ideally, v2 code would also be extracted to separate crx2.js file, but i did not want to mess too much around original code. Just let me know if you think that's a good idea (it would break API, because generateSignature would become private/hidden from outside, as in v3).

I also added --verbose option locally (for both keygen and build commands), but since your ESLint setup forbids using console.log, i removed it from this pull request.

This adds dependency on pbf module. I added pre-generated crx3.js.pb (changed extension name to hide it from linter and tests ;). If you would like to import original crx3.proto file instead, and automatically rebuild crx3.js.pb whenever proto file changes, let me know, but that would probably require some kinda of build task to add to this project).

I did not try to use this in a browser. I only tested generating CRX packages using node.js v11.10.0.

@ahwayakchih
Copy link
Collaborator Author

Updated package with latest master. npm audit shows that 1 vulnurability is from archiver module, and 13 from github-changes (as mentioned in #97).

@ahwayakchih
Copy link
Collaborator Author

@oncletom any chance this (with or without additional changes), or something like this could be merged :)?

@arkon
Copy link
Collaborator

arkon commented Mar 13, 2019

Any update on this, now that Chrome 73 has landed in stable and requires the CRX3 format?

@ramin25
Copy link

ramin25 commented Mar 20, 2019

Bump. Latest chrome does indeed require v3. Any update on this?

@hborawski
Copy link

Also looking for an update on this, I use this package with my automated releases so this PR is pretty critical for me!

@ansoni-san
Copy link

ansoni-san commented Mar 22, 2019

This tool is useless without v3 support. What's blocking it?

I'd offer my help if necessary.

@ahwayakchih
Copy link
Collaborator Author

In meantime i created https://github.com/ahwayakchih/crx3, maybe it can be useful for others too while we wait for update to this module.

@oncletom please check it - hopefully changes can be integrated into this module in the future. I wrote it so all data is streamed and whole ZIP file does not have to be kept in RAM.

@thom4parisot
Copy link
Owner

This tool is useless without v3 support. What's blocking it?

@ansoni-san Thanks for the "useless". I'm moving between places and working to pay my bills and eventually get some free time to work on unpaid projects like this one. That's the blocker. Do you feel better with this answer?

I'm grateful for @ahwayakchih code proposal and for you all to discuss the outcome of this missing feature. I'm sorry for not responding and keeping all of you in the dark.

Copy link
Collaborator

@arkon arkon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good to me. I'm assuming the logic borrowed from Chromium is fine. ¯\_(ツ)_/¯

Copy link
Owner

@thom4parisot thom4parisot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thank you so much for this piece of work and for being patient 🙂

Commander module:
- does not allow setting defaults,
- does not call custom parsing function on optional parameters,
- does not seem to provide a way to set values manually (like: `program.myOptionValue = 3`).

Which means we don't have a clean way to be sure that `program.crxVersion` defaults to 3 :(.
@ahwayakchih ahwayakchih merged commit ddc2e90 into thom4parisot:master Mar 29, 2019
@ahwayakchih
Copy link
Collaborator Author

@oncletom no worries :).

@arkon @oncletom thanks!

ahwayakchih added a commit to ahwayakchih/crx that referenced this pull request Mar 29, 2019
@ahwayakchih ahwayakchih deleted the crx3 branch March 29, 2019 08:10
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.

6 participants