msha
msha

Reputation: 163

Automating Google Chrome extension packaging

I'm trying to automate packaging of the Chrome extension on Windows and according to the documentation, it is this command:

[path]\chrome.exe --pack-extension=c:\myext --pack-extension-key=c:\myext.pem --no-message-box

However this command results in a new browser window and no action is performed. I tried other switches like --version or --help but it seems that Chrome is ignoring all of this. Do others have the same issue? What am I doing wrong? I also tried various quoting and with no other browser window open but I haven't been able to make this work.

Update: I'm happy to learn that the new Chrome 8 has fixed this issue.

Upvotes: 1

Views: 3609

Answers (2)

Ritesh M Nayak
Ritesh M Nayak

Reputation: 8063

The answer is present in one of the comments. I am reposting the answer verbatim here:

You can try one of the scripts to pack an extension at https://developer.chrome.com/extensions/crx#scripts – by Na7coldwater

Upvotes: 5

werehamster
werehamster

Reputation: 126

You'll need to close all chrome windows before the command line pack extension command will work.

I raised this bug with the chrome team some time ago (http://code.google.com/p/chromium/issues/detail?id=22901) but it's not quite fixed yet. This can be somewhat frustrating because (as michaelhermannweber pointed out) "Since we're fans of Chrome, obviously Chrome is already open!"

I even tried to use a separate instance of the chrome executable to build the extension, but alas no luck on that front either :( For now, AFAICT you have to do it manually via the pack extension button on the chrome://extensions page.

You might manage to build a script that closes all open chrome windows, builds the extension, and then re-opens chrome. But I doubt that it would be worth it given the number of tab users like to keep open.

Upvotes: 0

Related Questions