'use strict';
-import { app, protocol } from 'electron';
+import { app, protocol, session } from 'electron';
import { wrt } from '../browser/wrt';
import * as WRTWebContents from '../browser/wrt_web_contents';
import { WRTWindow } from '../browser/wrt_window';
console.log('WebApplication : suspend');
addonManager.emit('lcSuspend', this.mainWindow.id);
this.suspended = true;
- this.windowList[this.windowList.length - 1].hide();
+ if (this.windowList.length > 0)
+ this.windowList[this.windowList.length - 1].hide();
this.flushData();
if (!this.backgroundRunnable()) {
if (!this.multitaskingSupport) {
private flushData() {
console.log('WebApplication : FlushData');
- this.windowList.forEach((window) => window.webContents.session.flushStorageData());
+ session.defaultSession?.flushStorageData();
}
sendAppControlEvent() {