]> khamidou — GitHub mirrors - electron.git/commitdiff
adds 'before using methods' example
authorSam Eaton <sameaton11@gmail.com>
Thu, 11 Jun 2015 01:24:36 +0000 (19:24 -0600)
committerSam Eaton <sameaton11@gmail.com>
Thu, 11 Jun 2015 01:24:36 +0000 (19:24 -0600)
The document does not inform that the webview element has to be loaded
before using the element's methods. It is not clear.

docs/api/web-view-tag.md

index 705014cf6a18b37381d1be21cfb3262af61aa2bd..210b15f9e8b4d346f339440d73f4139ab6dcbab9 100644 (file)
@@ -130,6 +130,14 @@ If "on", the guest page will have web security disabled.
 
 ## Methods
 
+The webview element must be loaded before using the methods.  
+**Example**
+```javascript
+webview.addEventListener("dom-ready", function(){
+  webview.openDevTools();
+});
+```
+
 ### `<webview>`.getUrl()
 
 Returns URL of guest page.