From 92c76bac2bc08d19c0f455c9a5db73e7e9070bc1 Mon Sep 17 00:00:00 2001 From: Xue Fuqiao Date: Wed, 4 Mar 2015 20:16:22 +0800 Subject: [PATCH] Update application-packaging.md `BrowserWindow` should be used in browser scripts instead of client scripts. Move it to the "Node API" section. --- docs/tutorial/application-packaging.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/tutorial/application-packaging.md b/docs/tutorial/application-packaging.md index f45fd8b5421f..76439681790a 100644 --- a/docs/tutorial/application-packaging.md +++ b/docs/tutorial/application-packaging.md @@ -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) { ``` -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