inspectorEnabledByVconf = false;
constructor() {
- app.on('before-quit', (event) => {
+ app.on('before-quit', (event: any) => {
console.log('before-quit');
- this.webApplication?.quit();
+ this.webApplication?.beforeQuit();
});
- app.on('will-quit', (event) => {
+
+ app.on('will-quit', (event: any) => {
console.log('will-quit');
addonManager.deactivateAll();
});
- app.on('quit', (event) => {
+
+ app.on('quit', (event: any) => {
console.log('quit');
if (this.webApplication) {
- this.webApplication.finalize();
+ this.webApplication.quit();
this.webApplication = undefined;
}
});
+
app.on('browser-window-created', () => {
console.log('browser-window-created');
if (!this.isLaunched) {
this.isLaunched = true;
}
});
+
app.on('window-all-closed', () => {
console.log('window-all-closed');
app.quit();
});
- app.on('web-contents-created', (event, webContents) => {
+
+ app.on('web-contents-created', (event: any, webContents: any) => {
console.log('web-contents-created');
- webContents.on('before-input-event', (event, input) => {
+ webContents.on('before-input-event', (event: any, input: any) => {
if (this.isLaunched && this.webApplication)
this.handleKeyEvents(input.key);
});
});
- app.once('ready', (event) => {
+
+ app.once('ready', (event: any) => {
console.log('ready');
let addonAvailable = addonManager.build();
console.log("addonBuild : " + addonAvailable);
}
wrt.tv?.importCertificate('');
});
- wrt.on('app-control', (event, appControl) => {
+
+ wrt.on('app-control', (event: any, appControl: any) => {
console.log('app-control');
let loadInfo = appControl.getLoadInfo();
let src = loadInfo.getSrc();
}
this.launchInspector(appControl);
});
+
wrt.on('suspend', () => {
console.log('suspend');
this.webApplication?.suspend();
});
+
wrt.on('resume', () => {
console.log('resume');
this.webApplication?.resume();
});
+
wrt.on('low-memory', () => {
console.log('low-memory');
this.webApplication?.lowMemory();
});
- wrt.on('message', (event, type, params) => {
+
+ wrt.on('message', (event: any, type: string, params: string[]) => {
console.log('message type(' + type + ') params : ' + params);
const app_id = params[0];
if (type === 'startService') {
event.preventDefault();
}
});
+
wrt.on('ambient-tick', () => {
this.webApplication?.ambientTick();
});
- wrt.on('ambient-changed', (event, ambient_mode) => {
+
+ wrt.on('ambient-changed', (event: any, ambient_mode: boolean) => {
console.log('ambient-changed , ambient_mode:' + ambient_mode);
this.webApplication?.ambientChanged(ambient_mode);
});
- wrt.on('addon-installed', (event, path) => {
+
+ wrt.on('addon-installed', (event: any, path: string) => {
console.log('addon-installed at ' + path);
addonManager.checkAddon(path);
});
- wrt.on('addon-uninstalled', (event, id) => {
+
+ wrt.on('addon-uninstalled', (event: any, id: string) => {
console.log('addon-unistalled named ' + id);
});
- wrt.on('wgt-checking-done', (event) => {
+
+ wrt.on('wgt-checking-done', (event: any) => {
console.log('wgt-checking-done');
addonManager.updateDB();
});
}
private setupEventListener(options: RuntimeOption) {
- app.on('browser-window-created', (event, window) => {
+ app.on('browser-window-created', (event: any, window: any) => {
if (this.windowList.length > 0)
this.windowList[this.windowList.length - 1].hide();
this.windowList.push(window);
this.windowList[this.windowList.length - 1].show();
});
});
- app.on('web-contents-created', (event, webContents) => {
+
+ app.on('web-contents-created', (event: any, webContents: any) => {
webContents.on('crashed', function() {
console.error('webContents crashed');
app.exit(100);
});
- webContents.session.setPermissionRequestHandler((webContents, permission, callback) => {
+
+ webContents.session.setPermissionRequestHandler((webContents: any, permission: string, callback: any) => {
console.log(`handlePermissionRequests for ${permission}`);
if (permission === 'notifications') {
if (!this.notificationPermissionMap)
}
});
});
- app.on('certificate-error', (event, webContents, url, error, certificate, callback) => {
+
+ app.on('certificate-error', (event: any, webContents: any, url: string, error: string, certificate: any, callback: any) => {
console.log('A certificate error has occurred');
event.preventDefault();
if (certificate.data) {
callback(false);
}
});
- app.on('login', (event, webContents, request, authInfo, callback) => {
+
+ app.on('login', (event: any, webContents: any, request: any, authInfo: any, callback: any) => {
console.log(`Login info is required, isproxy: ${authInfo.isProxy}`);
event.preventDefault();
let usrname = '';
wrt.handleAuthRequest(id, webContents);
}
});
+
if (this.accessiblePath) {
console.log(`accessiblePath: ${this.accessiblePath}`);
- protocol.interceptFileProtocol('file', (request, callback) => {
+ protocol.interceptFileProtocol('file', (request: any, callback: any) => {
if (request.url) {
let parsed_info = new URL(request.url);
let access_path = parsed_info.host + decodeURI(parsed_info.pathname);
console.log('request url is empty');
(callback as any)(403);
}
- }, (error) => {
+ }, (error: Error) => {
console.log(error);
});
}
- wrt.on('permission-response', (event, id, result) => {
+
+ wrt.on('permission-response', (event: any, id: number, result: boolean) => {
console.log(`permission-response for ${id} is ${result}`);
let callback = this.pendingCallbacks.get(id);
if (typeof callback === 'function') {
this.pendingCallbacks.delete(id);
}
});
- wrt.on('auth-response', (event, id, submit, user, password) => {
+
+ wrt.on('auth-response', (event: any, id: number, submit: boolean, user: string, password: string) => {
let callback = this.pendingCallbacks.get(id);
if (typeof callback === 'function') {
console.log('calling auth response callback');
this.pendingCallbacks.delete(id);
}
});
- wrt.on('app-status-changed', (event, status) => {
+
+ wrt.on('app-status-changed', (event: any, status: string) => {
console.log(`runningStatus: ${status}, ${this.loadFinished}`);
if (!wrt.tv)
return;
}
this.show();
});
+
this.mainWindow.webContents.on('did-start-loading', () => {
console.log('webContents did-start-loading');
this.loadFinished = false;
});
+
this.mainWindow.webContents.on('did-finish-load', () => {
console.log('webContents did-finish-load');
this.loadFinished = true;
this.windowList[this.windowList.length - 1].show();
}
- finalize() {
- console.log('WebApplication : finalize');
+ quit() {
+ console.log('WebApplication : quit');
this.flushData();
this.windowList.forEach((window) => window.removeAllListeners());
this.inQuit = false;
this.suspend();
}
- quit() {
- console.log('WebApplication : quit');
+ beforeQuit() {
+ console.log('WebApplication : beforeQuit');
addonManager.emit('lcQuit', this.mainWindow.id);
if (wrt.tv) {
this.inspectorSrc = '';