diff --git a/README.md b/README.md index f282b66..5a7fa57 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/index.js b/index.js index 7ca0958..5f1231e 100644 --- a/index.js +++ b/index.js @@ -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 }); }