Merge pull request #4186 from CharlieHess/webview-load-url

Expose loadURL for the webview tag.
This commit is contained in:
Cheng Zhao 2016-01-21 14:53:32 -07:00
commit 56e8ddbdaf
2 changed files with 12 additions and 0 deletions

View file

@ -346,6 +346,7 @@ var registerWebViewElement = function() {
// Public-facing API methods. // Public-facing API methods.
methods = [ methods = [
'getURL', 'getURL',
'loadURL',
'getTitle', 'getTitle',
'isLoading', 'isLoading',
'isWaitingForResponse', 'isWaitingForResponse',

View file

@ -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()` ### `<webview>.getURL()`
Returns URL of guest page. Returns URL of guest page.