fix: manually manage WebContents of webview when it is detached

This commit is contained in:
Cheng Zhao 2018-09-07 15:41:48 +09:00
parent 8e963f10ef
commit 92e094c5f6
5 changed files with 38 additions and 10 deletions

View file

@ -94,6 +94,9 @@ module.exports = {
createGuestSync: function (params) {
return ipcRenderer.sendSync('ELECTRON_GUEST_VIEW_MANAGER_CREATE_GUEST_SYNC', params)
},
destroyGuest: function (guestInstanceId) {
ipcRenderer.send('ELECTRON_GUEST_VIEW_MANAGER_DESTROY_GUEST', guestInstanceId)
},
attachGuest: function (elementInstanceId, guestInstanceId, params, contentWindow) {
const embedderFrameId = webFrame.getWebFrameId(contentWindow)
if (embedderFrameId < 0) { // this error should not happen.