diff --git a/lib/browser/guest-view-manager.js b/lib/browser/guest-view-manager.js index 9eb81b89ae2..f1a460271b4 100644 --- a/lib/browser/guest-view-manager.js +++ b/lib/browser/guest-view-manager.js @@ -206,7 +206,7 @@ const attachGuest = function (event, elementInstanceId, guestInstanceId, params) webPreferences.preloadURL = params.preload } - event.sender.emit('will-attach-webview', event, webPreferences, params) + embedder.emit('will-attach-webview', event, webPreferences, params) if (event.defaultPrevented) { if (guest.viewInstanceId == null) guest.viewInstanceId = params.instanceId destroyGuest(embedder, guestInstanceId)