3
我想了解一下Electron Framework中的Event: 'login'
功能如何工作。瀏覽器中常見的密碼自動填充/記住密碼功能的低級別實現?我想用它來在網頁的登錄流程中自動填充密碼,例如如何在Electron Framework中使用登錄事件?
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')
});
Here is the link to the specification in their docs