Logout In Electron

I want to add logout in my application.

following is my code

function logout() {

var r = confirm(“Do you really want to log out?”);

if ® {

window.location.assign(’ index.html’);



it is ok for now. but i want to add a little more.

i want to close all the child window opened at the same time.

if anyone knows please help

Whenever you open a child window, you create an object. If those objects are assigned to variables that the user session can see, then it’s easy to look them up and send close commands on logout.

thanks for the tip, can you please give an example or something to make things clear…

The Electron documentation covers child window behavior and shows you how to assign and interact with an object that represents a window.

ok thanks bro

what if i am creating a window from another file not main js , then how do i make it to the child of main window and is it possible to close all other window when logged out?