]> khamidou — GitHub mirrors - electron.git/commitdiff
Expose loadURL for the webview tag.
authorCharlie Hess <charlie@slack-corp.com>
Thu, 21 Jan 2016 21:31:35 +0000 (13:31 -0800)
committerCharlie Hess <charlie@slack-corp.com>
Thu, 21 Jan 2016 21:31:35 +0000 (13:31 -0800)
atom/renderer/lib/web-view/web-view.js
docs/api/web-view-tag.md

index 1daf66e55aa388bcb9ce419b8032e1ac812893b4..8029824329fcd327e8a56b4a6209a3b287555c8e 100644 (file)
@@ -350,6 +350,7 @@ var registerWebViewElement = function() {
   // Public-facing API methods.
   methods = [
     'getURL',
+    'loadURL',
     'getTitle',
     'isLoading',
     'isWaitingForResponse',
index b3d94b85f7157d2faf425ada486ec4a858b42e63..c6fef87fc35e1755f2a06ac9f59885765a274a47 100644 (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()`
 
 Returns URL of guest page.