win.show();
```
-You can also create a window without Chrome by using
+You can also create a window without chrome by using
[Frameless Window](frameless-window.md) API.
## Class: BrowserWindow
// Unlike usual browsers, in which a string should be returned and the user is
// prompted to confirm the page unload, Electron gives developers more options.
- // Returning an empty string or false will prevent the unloading.
+ // Returning an empty string or `false` will prevent the unloading.
// You can also use the dialog API to let the user confirm closing the application.
e.returnValue = false;
};
var BrowserWindow = require('browser-window');
// In this example `win` is our instance
-var win = new BroswerWindow({width: 800, height: 1500});
+var win = new BrowserWindow({ width: 800, height: 600 });
```
### `win.setThumbarButtons(buttons)`
-`buttons` Array od `button` Objects:
+`buttons` Array of `button` Objects:
`button` Object, properties:
Strings:
* `enabled` - The button is active and available to the user.
* `disabled` - The button is disabled. It is present, but has a visual
- state that indicates that it will not respond to user action.
+ state indicating it will not respond to user action.
* `dismissonclick` - When the button is clicked, the taskbar button's
flyout closes immediately.
* `nobackground` - Do not draw a button border, use only the image.
```javascript
var BrowserWindow = require('browser-window');
-var win = new BroswerWindow({width: 800, height: 1500});
+var win = new BrowserWindow({width: 800, height: 1500});
win.loadUrl("http://github.com");
var webContents = win.webContents
* `httpReferrer` String - A HTTP Referrer url
* `userAgent` String - A user agent originating the request
-Loads the `url` in the window, the `url` must contains the protocol prefix,
+Loads the `url` in the window, the `url` must contain the protocol prefix,
e.g. the `http://` or `file://`.
### `webContents.getUrl()`
var currentUrl = win.webContents.getUrl();
```
-Returns URL of current web page.
+Returns URL of the current web page.
### `webContents.getTitle()`
-Returns the title of web page.
+Returns the title of the current web page.
### `webContents.isLoading()`
### `webContents.isWaitingForResponse()`
-Returns whether web page is waiting for a first-response for the main resource
+Returns whether the web page is waiting for a first-response for the main resource
of the page.
### `webContents.stop()`
### `webContents.reload()`
-Reloads current page.
+Reloads the current web page.
### `webContents.reloadIgnoringCache()`
### `webContents.canGoBack()`
-Returns whether the web page can go back.
+Returns whether the browser can go back to previous web page.
### `webContents.canGoForward()`
-Returns whether the web page can go forward.
+Returns whether the browser can go forward to next web page.
### `webContents.canGoToOffset(offset)`
### `webContents.goBack()`
-Makes the web page go back.
+Makes the browser go back a web page.
### `webContents.goForward()`
-Makes the web page go forward.
+Makes the browser go forward a web page.
### `webContents.goToIndex(index)`
* `index` Integer
-Navigates to the specified absolute index.
+Navigates browser to the specified absolute web page index.
### `webContents.goToOffset(offset)`
### `webContents.getUserAgent()`
-Returns a `String` represents the user agent for this page.
+Returns a `String` representing the user agent for this page.
### `webContents.insertCSS(css)`
* `css` String
-Injects CSS into this page.
+Injects CSS into the current web page.
### `webContents.executeJavaScript(code[, userGesture])`
Evaluates `code` in page.
-In browser some HTML APIs like `requestFullScreen` can only be invoked if it
-is started by user gesture, by specifying `userGesture` to `true` developers
-can ignore this limitation.
+In the browser window some HTML APIs like `requestFullScreen` can only be invoked by a gesture from the user. Setting `userGesture` to `true` will remove this limitation.
### `webContents.setAudioMuted(muted)`
+ `muted` Boolean
-Set the page muted.
+Mute the audio on the current web page.
### `webContents.isAudioMuted()`
* `callback` Function
-Checks if any serviceworker is registered and returns boolean as
+Checks if any ServiceWorker is registered and returns a boolean as
response to `callback`.
### `webContents.unregisterServiceWorker(callback)`
* `callback` Function
-Unregisters any serviceworker if present and returns boolean as
-response to `callback` when the JS promise is fullfilled or false
+Unregisters any ServiceWorker if present and returns a boolean as
+response to `callback` when the JS promise is fulfilled or false
when the JS promise is rejected.
### `webContents.print([options])`
`webContents.print({silent: false, printBackground: false})`.
**Note:** On Windows, the print API relies on `pdf.dll`. If your application
-doesn't need print feature, you can safely remove `pdf.dll` in saving binary
+doesn't need the print feature, you can safely remove `pdf.dll` to reduce binary
size.
### `webContents.printToPDF(options, callback)`
Prints window's web page as PDF with Chromium's preview printing custom
settings.
-By default, an empty `options` will be regarded as
-`{marginsType:0, printBackgrounds:false, printSelectionOnly:false,
- landscape:false}`.
+By default, an empty `options` will be regarded as:
+
+```javascript
+{
+ marginsType:0,
+ printBackgrounds:false,
+ printSelectionOnly:false,
+ landscape:false
+}
+```
```javascript
var BrowserWindow = require('browser-window');