Only remove guest from embedder when view id changes

This commit is contained in:
Kevin Sawicki 2016-11-02 15:19:16 -07:00
parent f454cb3408
commit a737732521

View file

@ -162,8 +162,12 @@ const attachGuest = function (embedder, elementInstanceId, guestInstanceId, para
if (guestInstance.elementInstanceId) {
const oldKey = `${guestInstance.embedder.getId()}-${guestInstance.elementInstanceId}`
delete embedderElementsMap[oldKey]
webViewManager.removeGuest(guestInstance.embedder, guestInstanceId)
guestInstance.embedder.send(`ELECTRON_GUEST_VIEW_INTERNAL_DESTROY_GUEST-${guest.viewInstanceId}`)
// Remove guest from embedder if moving across web views
if (guest.viewInstanceId !== params.instanceId) {
webViewManager.removeGuest(guestInstance.embedder, guestInstanceId)
guestInstance.embedder.send(`ELECTRON_GUEST_VIEW_INTERNAL_DESTROY_GUEST-${guest.viewInstanceId}`)
}
}
const webPreferences = {