When app call tizen.application.exit() directly, WRT will get "before_quit"
firstly, then set webapplciaton to null(_this.webApplication = null;), then
when WRT get "suspend" event, bcz webapplication is null, WRT will not flush
cookie / local storage.
Change-Id: I14304af991f583da2b985f31f8f8a35c207327c3
Signed-off-by: liwei <wei90727.li@samsung.com>
}
this.suspended = true;
this.windowList[this.windowList.length - 1].hide();
- if (wrt.tv) {
- wrt.tv.flushCookie();
- this.windowList.forEach((window) => window.webContents.session.flushStorageData());
- }
+ flushData();
if (!this.backgroundRunnable()) {
if (!this.multitaskingSupport) {
// FIXME : terminate app after visibilitychange event handling
this.inspectorSrc = '';
wrt.tv.cancelDialogs(this.mainWindow.webContents);
}
+ flushData();
if (this.debugPort) {
console.log('stop inspector server');
this.debugPort = 0;
console.log('WebApplication : quit - Invalid event emitter');
}
}
+ flushData() {
+ console.log('WebApplication : FlushData');
+ if (wrt.tv) {
+ wrt.tv.flushCookie();
+ this.windowList.forEach((window) => window.webContents.session.flushStorageData());
+ }
+ }
sendAppControlEvent() {
const kAppControlEventScript =
'(function(){' +