chore: remove promisification deprecation callbacks (#17907)

* chore: remove promisification deprecation callbacks

* update docs

* fix smoke test

* fix executejs issue

* cleanup leftovers

* fix webContents.executeJavaScript tests

* cleanup WebContents.prototype.takeHeapSnapshot

* fix "sets arbitrary webContents as devtools" test

* fix executeJavaScriptInFrame related tests
This commit is contained in:
Shelley Vohr 2019-04-30 07:08:33 -07:00 committed by John Kleinschmidt
parent fdf5f838f4
commit d87b3ead76
44 changed files with 94 additions and 1418 deletions

View file

@ -217,18 +217,8 @@ app.on('ready', function () {
event.returnValue = null
})
ipcMain.on('executeJavaScript', function (event, code, hasCallback) {
let promise
if (hasCallback) {
promise = window.webContents.executeJavaScript(code, (result) => {
window.webContents.send('executeJavaScript-response', result)
})
} else {
promise = window.webContents.executeJavaScript(code)
}
promise.then((result) => {
ipcMain.on('executeJavaScript', function (event, code) {
window.webContents.executeJavaScript(code).then((result) => {
window.webContents.send('executeJavaScript-promise-response', result)
}).catch((error) => {
window.webContents.send('executeJavaScript-promise-error', error)
@ -237,10 +227,6 @@ app.on('ready', function () {
window.webContents.send('executeJavaScript-promise-error-name', error.name)
}
})
if (!hasCallback) {
event.returnValue = 'success'
}
})
})