Chrome Extension Building Tools
Tools to help compile a Chrome extension from a userscript
.user.js) into a chrome extension (
js2crx.py is mainly designed as a command line application. It includes a template Windows batch script
build.bat which can be easily edited to auto-build a project. Simply edit the
EDIT_THIS parts in it.
Arguments are passed into
js2crx.py using short (
-v) or verbose (
--version) flags. Executing
js2crx.py --usage will list the available flags, their aliases, and a short description. Reading
build.bat also helps.
js2crx.py should also be able to be imported as a library and executed in a similar manner to the command line version. This is untested/undocumented, but there's no real reason why it shouldn't work. If this functionality is required, reading through
main should give some insight.
Typical userscript files contain a metadata block at the top of the file. To specify additional info for building the
.crx file, an additional
==ChromeExtension== metadata block should follow it. For example:
The following tags are allowed:
==UserScript==block contains any @require tags.
.user.jsscript) to an additional resource file.
==UserScript==block contains any @resource tags.
update.xmlfile generated by
extension.crxfile generated by