Emit attach params as well in event
This commit is contained in:
parent
792f3c3030
commit
8b0d3a2567
2 changed files with 5 additions and 2 deletions
|
@ -511,8 +511,11 @@ Returns:
|
|||
* `webPreferences` Object - The web preferences that will be used by the guest
|
||||
page. This object can be modified to adjust the preferences for the guest
|
||||
page.
|
||||
* `params` Object - The other `<webview>` parameters such as the `src` URL.
|
||||
This object can be modified to adjust the parameters of the guest page.
|
||||
|
||||
Calling `event.preventDefault()` will destroy the guest page.
|
||||
Emitted when a `<webview>`'s web contents is being attached to this web
|
||||
contents. Calling `event.preventDefault()` will destroy the guest page.
|
||||
|
||||
### Instance Methods
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ const attachGuest = function (event, elementInstanceId, guestInstanceId, params)
|
|||
webPreferences.preloadURL = params.preload
|
||||
}
|
||||
|
||||
event.sender.emit('will-attach-webview', event, guest, webPreferences)
|
||||
event.sender.emit('will-attach-webview', event, guest, webPreferences, params)
|
||||
if (event.defaultPrevented) {
|
||||
if (guest.viewInstanceId == null) guest.viewInstanceId = params.instanceId
|
||||
destroyGuest(embedder, guestInstanceId)
|
||||
|
|
Loading…
Reference in a new issue