});
}
console.log('mainWindow id : ' + this.mainWindow.id);
+ this.pendingID = 0;
+ this.pendingCallbacks = new Map();
this.handleEvents(winopt);
this.firstRendered = false;
this.backgroundSupport = wrt.getBackgroundSupport();
self.suspend();
}
});
+ wrt.on('permission-response', function(event, id, result) {
+ let callback = self.pendingCallbacks.get(id);
+ if (typeof callback === 'function') {
+ console.log('calling permission response callback');
+ callback(result);
+ self.pendingCallbacks.delete(id);
+ }
+ });
+ app.on('certificate-error', function(event, webContents, url, error, certificate, callback) {
+ console.log('A certificate error has occurred');
+ event.preventDefault();
+ if (certificate.data) {
+ const id = ++self.pendingID;
+ self.pendingCallbacks.set(id, callback);
+ wrt.handleCertificateError(id, webContents, certificate.data, url);
+ } else {
+ console.log('Certificate could not be opened');
+ callback(false);
+ }
+ });
}
suspend() {
console.log('WebApplication : suspend');