webview: api to get webcontents and associated host webcontents

This commit is contained in:
Robo 2016-02-17 14:22:19 +05:30
parent 537ead8917
commit 6fcc197db8
7 changed files with 46 additions and 5 deletions

View file

@ -388,7 +388,7 @@ var registerWebViewElement = function() {
'downloadURL',
'inspectServiceWorker',
'print',
'printToPDF'
'printToPDF',
];
nonblockMethods = [
'executeJavaScript',
@ -430,6 +430,12 @@ var registerWebViewElement = function() {
proto[m] = createNonBlockHandler(m);
}
// WebContents associated with this webview.
proto.getWebContents = function() {
var internal = v8Util.getHiddenValue(this, 'internal');
return internal.webContents;
};
// Deprecated.
deprecate.rename(proto, 'getUrl', 'getURL');
window.WebView = webFrame.registerEmbedderCustomElement('webview', {