Merge pull request #1202 from xfq/patch-2
Update application-packaging.md
This commit is contained in:
commit
52d596e576
1 changed files with 8 additions and 8 deletions
|
@ -67,6 +67,14 @@ Use a module from the archive:
|
|||
require('/path/to/example.asar/dir/module.js');
|
||||
```
|
||||
|
||||
You can also display a web page in an `asar` archive with `BrowserWindow`:
|
||||
|
||||
```javascript
|
||||
var BrowserWindow = require('browser-window');
|
||||
var win = new BrowserWindow({width: 800, height: 600});
|
||||
win.loadUrl('file:///path/to/example.asar/static/index.html');
|
||||
```
|
||||
|
||||
### Web API
|
||||
|
||||
In a web page, files in archive can be requested with the `file:` protocol. Like
|
||||
|
@ -83,14 +91,6 @@ $.get('file:///path/to/example.asar/file.txt', function(data) {
|
|||
</script>
|
||||
```
|
||||
|
||||
You can also display a web page in an `asar` archive with `BrowserWindow`:
|
||||
|
||||
```javascript
|
||||
var BrowserWindow = require('browser-window');
|
||||
var win = new BrowserWindow({width: 800, height: 600});
|
||||
win.loadUrl('file:///path/to/example.asar/static/index.html');
|
||||
```
|
||||
|
||||
### Treating `asar` archive as normal file
|
||||
|
||||
For some cases like verifying the `asar` archive's checksum, we need to read the
|
||||
|
|
Loading…
Reference in a new issue