webview: api to get webcontents and associated host webcontents
This commit is contained in:
parent
537ead8917
commit
6fcc197db8
7 changed files with 46 additions and 5 deletions
|
@ -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', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue