webContents: handle POST navigation for new windows

This commit is contained in:
deepak1556 2016-10-10 05:00:38 +05:30 committed by Kevin Sawicki
parent 7cfe1dd0af
commit 0410a184ce
10 changed files with 187 additions and 49 deletions

View file

@ -18,13 +18,17 @@ BrowserWindow.prototype._init = function () {
}
// Make new windows requested by links behave like "window.open"
this.webContents.on('-new-window', (event, url, frameName, disposition, additionalFeatures) => {
this.webContents.on('-new-window', (event, url, frameName,
disposition, additionalFeatures,
postData) => {
const options = {
show: true,
width: 800,
height: 600
}
ipcMain.emit('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_OPEN', event, url, frameName, disposition, options, additionalFeatures)
ipcMain.emit('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_OPEN',
event, url, frameName, disposition,
options, additionalFeatures, postData)
})
this.webContents.on('-web-contents-created', (event, webContents, url,