On this particular Page
Do not neglect to
const electricity = window.require('electricity');
const { power } = electricity;
Application.js (or any other page)
const returnToPreviousPage = async () => {
// Transmitting asynchronous message
power.send('goBackHomeBoi', 'Please Send Me Some Data')
// Dealing with incoming asynchronous message
power.on('WentBack', (event, data) => {
console.log(data)
})
}
subsequently, you may include a button on the page which's onClick
is linked to this function.
base.js (electric main)
// Handling events for incoming asynchronous messages
powerMain.on('goBackHomeBoi', async (event, arg) => {
watt.webContents.goBack()
event.sender.send('WentBack', 'Success')
})