update executeJavaScript() API following Electron 0.36.10

This commit is contained in:
rhysd
2016-03-06 18:32:09 +09:00
parent bcd5761826
commit 7f4a8573fa
2 changed files with 6 additions and 2 deletions
@@ -106,6 +106,10 @@ app.on('ready', () => {
mainWindow.printToPDF({}, (err, data) => {});
mainWindow.webContents.printToPDF({}, (err, data) => {});
mainWindow.webContents.executeJavaScript('return true;');
mainWindow.webContents.executeJavaScript('return true;', true);
mainWindow.webContents.executeJavaScript('return true;', true, (result: boolean) => console.log(result));
});
// Locale
+2 -2
View File
@@ -636,7 +636,7 @@ declare module Electron {
* Evaluates code in page.
* @param code Code to evaluate.
*/
executeJavaScript(code: string): void;
executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void;
/**
* Executes Edit -> Undo command in page.
*/
@@ -1592,7 +1592,7 @@ declare module Electron {
* invoked by a gesture from the user. Setting `userGesture` to `true` will remove
* this limitation.
*/
executeJavaScript(code: string, userGesture?: boolean): void;
executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void;
}
// Type definitions for main process