This commit is contained in:
Robo 2016-02-24 15:41:09 +05:30
parent a734326907
commit 8386baf267
5 changed files with 44 additions and 28 deletions

View file

@ -138,4 +138,15 @@ app.on('ready', function() {
});
event.returnValue = "done";
});
ipcMain.on('executeJavaScript', function(event, code, hasCallback) {
if (hasCallback) {
window.webContents.executeJavaScript(code, (result) => {
window.webContents.send('executeJavaScript-response', result);
});
} else {
window.webContents.executeJavaScript(code);
event.returnValue = "success";
}
});
});