How to return from webContents.executeJavaScript


#1

So basically I need to execute this piece of JS code on the Web Page, then if it returns true, I to see the re turn in app.js so I can run some other code.

bootbox.confirm({
	title: "Update GurbaniNow?",
	message: "A New GurbaniNow Release is Available!",
	buttons: {
		confirm: {
			label: '<i class="fa fa-check"></i> Update'
		},
		cancel: {
			label: '<i class="fa fa-times"></i> Later'
		}
	},
	callback: function (result) {
		if (result == 'true') {
			autoUpdater.quitAndInstall();
		}
	}
});

As you can see, I can’t really run autoUpdater.quitAndInstall(); in the Web Page, so, I need to make bootbox run in the webpage, and then the return be sent to app.js so I can run the update.

I have looked at ipc, but have no clue with my n00b skills how to make that work.