How to create chrome crx file programmatically (preferably in java)?

Silent Warrior picture Silent Warrior · Jul 7, 2010 · Viewed 19.4k times · Source

I want to create chrome extension crx file programatically (not using chrome.exe, because it opens new chrome window). So what are the alternatives for same ? My preference is java, but if its possible in other language then also I am okay.

Answer

Mohamed Mansour picture Mohamed Mansour · Oct 11, 2010

As kylehuff stated, there are external tools that you could use. But you can always use the command line from Google Chrome to do that which is cross platform (Linux / Windows / Mac).

chrome.exe --pack-extension=[extension_path] --pack-extension-key=[extension_key]

--pack-extension is:

Package an extension to a .crx installable file from a given directory.

--pack-extension-key is:

Optional PEM private key is to use in signing packaged .crx.

The above does not run Google Chrome, it is just command line packing using Chromium's core crx algorithm that they use internally.