I am working on an Electron Desktop version for Windows for our Angular-WebApp. I implemented biometric authentication via Windows Hello which works nicely. Actually I open the Hello dialog (with nodeRT) when an event gets triggered via Inter-Process Communication (IPC), which tells me, that the page is ready for a login. The page is loaded with window.loadURL(url), so there is no local webcontent.
After a while, without doing anything in the app, the users get logged out automatically. After this, the event "login ready" should get triggered on the login page. Now there are two possibilies:
- The app is still in foreground and has focus. Then the Windows Hello window will open like expected and has focus. The event was triggered as expected.
- If the app is in background, without focus, the Windows Hello window will not open. The event was not triggered.
Is this the expected behavior? Is it possible that there is no IPC when the app is in background? How could I handle this? Maybe I could focus the app again. But I guess this could be disturbing. Any ideas?
I wrote logs which showed that the expected event was not triggered while the app is in background.
I have tested what happens when the main window is minimised and an event calls for the creation and display of a second (child) window.
As expected, the second window will be created and shown.
Therefore, Electron IPC messages can be sent and received by both the main process and render process(es) when the window(s) are minimised. IE: When the application is running in the background.
In the below minimum reproducible example, you can set the timeout delay between when the main window is minimised and the second (
login.html) window is created and shown.main.js(main process)preload.js(main process)As you can see below, I have requested the main window get minimised first just to make sure IPC continues to work when a second IPC message is sent.
And how it works...
index.html(render process)login.html(render process)