admin管理员组文章数量:1023794
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.
How can I enable/show this popup in electron? It doesn't seem to enable it by default.
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.
How can I enable/show this popup in electron? It doesn't seem to enable it by default.
Share Improve this question asked Jun 14, 2017 at 11:35 orangeorange 5,40513 gold badges54 silver badges73 bronze badges 2- I believe you should receive 'login' event for this case, which you can handle – pergy Commented Jun 14, 2017 at 11:51
- 1 @pergy That is exactly what I needed thanks. If you post it as an answer I will gladly accept it :) – orange Commented Jun 15, 2017 at 8:23
1 Answer
Reset to default 5What 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 callcallback(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.
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.
How can I enable/show this popup in electron? It doesn't seem to enable it by default.
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.
How can I enable/show this popup in electron? It doesn't seem to enable it by default.
Share Improve this question asked Jun 14, 2017 at 11:35 orangeorange 5,40513 gold badges54 silver badges73 bronze badges 2- I believe you should receive 'login' event for this case, which you can handle – pergy Commented Jun 14, 2017 at 11:51
- 1 @pergy That is exactly what I needed thanks. If you post it as an answer I will gladly accept it :) – orange Commented Jun 15, 2017 at 8:23
1 Answer
Reset to default 5What 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 callcallback(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.
本文标签: javascriptHow to enable a pop up for authentication for electronStack Overflow
版权声明:本文标题:javascript - How to enable a pop up for authentication for electron? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745591612a2157921.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论