Skip to content

Instantly share code, notes, and snippets.

@jnugh
Created August 21, 2016 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnugh/db1be12bf3f12128fd84c8468748dfaf to your computer and use it in GitHub Desktop.
Save jnugh/db1be12bf3f12128fd84c8468748dfaf to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<webview id="testview" src="http://example.org">
</body>
<script>
window.addEventListener('load', () => {
var webview = document.getElementById('testview');
console.log('window load: ', webview.getWebContents()); //undefined
webview.addEventListener('dom-ready', () => {
console.log('webview dom-ready: ', webview.getWebContents()); //Object
});
});
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment