mirror of
https://github.com/electron/electron.git
synced 2026-01-24 14:57:58 -05:00
Merge pull request #4186 from CharlieHess/webview-load-url
Expose loadURL for the webview tag.
This commit is contained in:
@@ -346,6 +346,7 @@ var registerWebViewElement = function() {
|
||||
// Public-facing API methods.
|
||||
methods = [
|
||||
'getURL',
|
||||
'loadURL',
|
||||
'getTitle',
|
||||
'isLoading',
|
||||
'isWaitingForResponse',
|
||||
|
||||
@@ -171,6 +171,17 @@ webview.addEventListener("dom-ready", function() {
|
||||
});
|
||||
```
|
||||
|
||||
### `<webview>.loadURL(url[, options])`
|
||||
|
||||
* `url` URL
|
||||
* `options` Object (optional), properties:
|
||||
* `httpReferrer` String - A HTTP Referrer url.
|
||||
* `userAgent` String - A user agent originating the request.
|
||||
* `extraHeaders` String - Extra headers separated by "\n"
|
||||
|
||||
Loads the `url` in the webview, the `url` must contain the protocol prefix,
|
||||
e.g. the `http://` or `file://`.
|
||||
|
||||
### `<webview>.getURL()`
|
||||
|
||||
Returns URL of guest page.
|
||||
|
||||
Reference in New Issue
Block a user