Extensions are packaged as signed zip files
with the file extension "crx"
(for example, myextension.crx
).
Each extension has its own unique key pair.
The public key is used as the unique identifier for the extension.
The private key is kept private
and used to sign each version of the extension.
To package an extension:
--pack-extension
option
to specify the path to the extension's folder:
chrome.exe --pack-extension=ext-folder-path
The packager creates two files:
a .crx
file,
which is the actual extension that can be installed,
and a .pem
file,
which contains the private key.
Do not lose the private key!
Keep the .pem
file secret and in a safe place.
You'll need it later if you want to do any of the following:
If the extension is successfully packaged, you'll see a dialog like this
that tells you where to find
the .crx
and .pem
files:
If chrome.exe
isn't already in your path,
you need to specify the complete path to it.
Here's how:
To create an updated version of your extension:
manifest.json
.--pack-extension
and --pack-extension-key
options.
The value of the key option should be the path to
the already generated .pem
file for this extension.
chrome.exe --pack-extension=ext-folder-path --pack-extension-key=ext-key-path
If the updated extension is successfully packaged, you'll see a dialog like this:
--no-message-box
command line flag to suppress the dialog. This is useful if you're packing extensions in non-interactive scripts.