Implement BrowserPluginGuestDelegate::CreateNewGuestWindow for nativeWindowOpen
This commit is contained in:
parent
a16cd0bd03
commit
7baf472c0f
4 changed files with 34 additions and 1 deletions
|
@ -36,8 +36,9 @@ BrowserWindow.prototype._init = function () {
|
|||
frameName) => {
|
||||
v8Util.setHiddenValue(webContents, 'url-framename', {url, frameName})
|
||||
})
|
||||
|
||||
// Create a new browser window for the native implementation of
|
||||
// "window.open"(sandbox mode only)
|
||||
// "window.open", used in sandbox and nativeWindowOpen mode
|
||||
this.webContents.on('-add-new-contents', (event, webContents, disposition,
|
||||
userGesture, left, top, width,
|
||||
height) => {
|
||||
|
|
|
@ -116,6 +116,20 @@ const createGuest = function (embedder, params) {
|
|||
guest.allowPopups = params.allowpopups
|
||||
})
|
||||
|
||||
guest.on('-add-new-contents', (...args) => {
|
||||
const embedder = getEmbedder(guestInstanceId)
|
||||
if (embedder != null) {
|
||||
embedder.emit('-add-new-contents', ...args)
|
||||
}
|
||||
})
|
||||
|
||||
guest.on('-web-contents-created', (...args) => {
|
||||
const embedder = getEmbedder(guestInstanceId)
|
||||
if (embedder != null) {
|
||||
embedder.emit('-web-contents-created', ...args)
|
||||
}
|
||||
})
|
||||
|
||||
const sendToEmbedder = (channel, ...args) => {
|
||||
const embedder = getEmbedder(guestInstanceId)
|
||||
if (embedder != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue