How to enable a pop up for authentication for electron?

后端 未结 1 582
北荒
北荒 2021-01-21 05:30

I am creating an electron app that accesses a url. And when navigated to the URL the user clicks on a button and are redirected to a URL that displays this pop up in Chrome.

相关标签:
1条回答
  • 2021-01-21 06:08

    What you see on the picture is that Chrome opens a popup for handle authentication event.

    However, Electron doesn't make such popup by default, as it stated in the documentation of 'login' event

    The default behavior is to cancel all authentications, to override this you should prevent the default behavior with event.preventDefault() and call callback(username, password) with the credentials.

    This means, you should handle 'login' event of your webContents manually and open a popup window by yourself or do whatever you want.

    0 讨论(0)
提交回复
热议问题