self.pendingCallbacks.delete(id);
}
});
+ wrt.on('auth-response', function(event, id, submit, user, passwd) {
+ let callback = self.pendingCallbacks.get(id);
+ if (typeof callback === 'function') {
+ console.log('calling auth response callback');
+ if (submit) {
+ callback(user, passwd);
+ } else {
+ callback();
+ }
+ self.pendingCallbacks.delete(id);
+ }
+ });
app.on('certificate-error', function(event, webContents, url, error, certificate, callback) {
console.log('A certificate error has occurred');
event.preventDefault();
const ses = webContents.session;
ses.setPermissionRequestHandler(handlePermissionRequests);
});
+ app.on('login', function(event, webContents, request, authInfo, callback) {
+ console.log('Login info is required');
+ event.preventDefault();
+ const id = ++self.pendingID;
+ console.log(`Raising a login info request with id: ${id}`);
+ self.pendingCallbacks.set(id, callback);
+ wrt.handleAuthRequest(id, webContents);
+ });
}
suspend() {
console.log('WebApplication : suspend');