Modal window



is there a way how to create a modal window? I mean a modal window using BrowserWindow, not with a dialog element.

Thank you!

Modal window with postponed show allows interaction with a parent window

Is there something wrong with using a dialog? Maybe, depending on what you’re using for visuals, you can use a javascript modal?

Only other option that quickly comes to mind would be to create a new window, then whenever the window that triggered the heavy modal window got focus to set focus to the heavy “modal” window. Dunno how that’d be UX-wise.


I do have the same request in my project. I wanna create a custom dialog which use my own html layout. I finally solve this problem by creating an alway-on-top BrowserWindow, when this window show up, it will send ipc message to all opened windows, those windows who received the ipc message will add a mask cover the whole body and swallow mouse events over it, even more you can handle the mouse event (such as blink the whole window to hint user it is deactived).


Yeah, this is the only way how to do it.

Thank you!


Can yo give me example code?