Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ module.exports = {
}
```

### Options
You can pass the following options to the new Crx call:

| Option | Description |Default |
| ------------- |-------------| -----|
| updateUrl | location of the updates.xml | http://localhost:8000/ |
| updateFilename | name of the updates.xml | updates.xml |
| keyFile | path to the pem file | - |
| outputPath | output path of the .crx file | - |
| contentPath | path of the source file | - |
| name | name of the extension / crx file | - |
| pathSeparator | pathSeparator. Specifies which pathSeparator should be used when composing the updates.xml url file. We can not use the path you are building your extension because in the end the path where you host your extension is important. Use (\\) if you deliver your extension over windows | / |

## License

MIT (http://www.opensource.org/licenses/mit-license.php)
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ function Plugin(options) {
this.crxName = this.options.name + ".crx";
this.crxFile = join(this.outputPath, this.crxName);
this.updateFile = join(this.outputPath, this.options.updateFilename);
this.updateUrl = this.options.updateUrl + "/" + this.options.updateFilename;
const pathSeparator = this.options.pathSeparator || '/';
this.updateUrl = this.options.updateUrl + pathSeparator + this.options.updateFilename;

// initiate crx
this.crx = new ChromeExtension({
privateKey: fs.readFileSync(this.keyFile),
codebase: this.options.updateUrl + '/' + this.crxName
codebase: this.options.updateUrl + pathSeparator + this.crxName
});
}

Expand Down