我需要一些帮助来理解如何Event: 'login'
Electron 框架中的功能有效。它是浏览器中常见的密码自动填充/记住密码功能的低级实现吗?我想用它来自动填充网页登录流程中的密码,例如
const electron = require('electron')
const {app,BrowserWindow} = electron
app.on('ready', ()=>{
let win = new BrowserWindow({
width:800,
height:600
})
//This is where I'm confused
app.on('login', (event, webContents, request, authInfo, callback) => {
event.preventDefault();
callback('my_username', 'my_password');
});
//How to implement autofill to https://accounts.google.com?
win.loadURL('https://accounts.google.com')
});
这是其文档中规范的链接 http://electron.atom.io/docs/api/app/#event-login
它不用于自动填充,而是用于基本身份验证。当您收到那些烦人的浏览器提示输入用户名和密码时。
如何显示 HTTP 401 基本身份验证对话框 https://stackoverflow.com/questions/15177325/how-to-display-http-401-basic-authentication-dialog
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)