improve doc for loadURL
This commit is contained in:
parent
488fe53276
commit
d9901e62b6
2 changed files with 9 additions and 2 deletions
|
@ -14,7 +14,11 @@ win.on('closed', () => {
|
||||||
win = null
|
win = null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Load a remote URL
|
||||||
win.loadURL('https://github.com')
|
win.loadURL('https://github.com')
|
||||||
|
|
||||||
|
// Or load a local HTML file
|
||||||
|
win.loadURL(`file://${__dirname}/app/index.html`)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Frameless window
|
## Frameless window
|
||||||
|
@ -946,6 +950,9 @@ Same as `webContents.capturePage([rect, ]callback)`.
|
||||||
|
|
||||||
Same as `webContents.loadURL(url[, options])`.
|
Same as `webContents.loadURL(url[, options])`.
|
||||||
|
|
||||||
|
The `url` can be a remote address (e.g. `http://`) or a path to a local
|
||||||
|
HTML file using the `file://` protocol.
|
||||||
|
|
||||||
#### `win.reload()`
|
#### `win.reload()`
|
||||||
|
|
||||||
Same as `webContents.reload`.
|
Same as `webContents.reload`.
|
||||||
|
|
|
@ -493,7 +493,7 @@ win.loadURL('http://github.com')
|
||||||
* `userAgent` String - A user agent originating the request.
|
* `userAgent` String - A user agent originating the request.
|
||||||
* `extraHeaders` String - Extra headers separated by "\n"
|
* `extraHeaders` String - Extra headers separated by "\n"
|
||||||
|
|
||||||
Loads the `url` in the window, the `url` must contain the protocol prefix,
|
Loads the `url` in the window. The `url` must contain the protocol prefix,
|
||||||
e.g. the `http://` or `file://`. If the load should bypass http cache then
|
e.g. the `http://` or `file://`. If the load should bypass http cache then
|
||||||
use the `pragma` header to achieve it.
|
use the `pragma` header to achieve it.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue