add spec
This commit is contained in:
parent
a734326907
commit
8386baf267
5 changed files with 44 additions and 28 deletions
|
@ -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";
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue