'use strict';
-import { app } from 'electron';
+import { app, 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.profileDelegate.canIgnoreSuspend())
return;
private flushData() {
console.log('WebApplication : FlushData');
- this.windowList.forEach((window) => window.webContents.session.flushStorageData());
+ session.defaultSession?.flushStorageData();
}
sendAppControlEvent() {