constructor(webApplication: WebApplication) {
this.webApplication = webApplication;
}
- initialize(options: RuntimeOption) { }
+
backgroundExecutable() { return false; }
beforeQuit() { }
+ canIgnoreSuspend() { return false; }
clearCache() { }
clearSuface(webContents: any) { }
handleAppControlEvent(appControl: any) { return true; }
handleProxyInfo(authInfo: any, callback: any) { return false; }
+ initialize(options: RuntimeOption) { }
+ isPreloading() { return false; }
needInpectorGuide() { return false; }
needReload(src: string) {
let originalUrl = this.webApplication.mainWindow.webContents.getURL();
return false;
}
needShowTimer() { return true; }
- isPreloading() { return false; }
onDidFinishLoad() { }
profileName() { return 'common' }
show() { }
isAlwaysReload: boolean = false;
preloadStatus: string = 'none';
runningStatus: string = 'none';
+ launchMode: string = 'none';
tv: any = (wrt.tv as NativeWRTjs.TVExtension);
constructor(webApplication: WebApplication) {
}
initialize(options: RuntimeOption) {
+ this.launchMode = options.launchMode;
if (options.launchMode == 'backgroundAtStartup') {
console.log('backgroundAtStartup');
this.preloadStatus = 'preload';
}
private suspendByStatus() {
+ if (this.launchMode == 'runningAsBackground') {
+ console.log('WebApplication : runningAsBackground suspend is skipped!');
+ return;
+ }
if (this.preloadStatus === 'preload' ||
this.runningStatus === 'behind') {
console.log('WebApplication : suspendByStatus');
}
isPreloading() {
- if (this.preloadStatus == 'preload') {
- console.log('preloading show is skipped!');
+ if (this.preloadStatus == 'preload' || this.launchMode == 'runningAsBackground') {
+ console.log(`preloadStatus is ${this.preloadStatus} or ${this.launchMode}, show is skipped`);
return true;
}
return false;
this.preloadStatus = 'none';
}
+ canIgnoreSuspend() {
+ if (this.launchMode == 'runningAsForeground' ||
+ this.launchMode == 'runningAsBackground') {
+ console.log('WebApplication : view_suspend & multitasking feature is skipped!');
+ return true;
+ }
+ return false;
+ }
+
beforeQuit() {
this.inspectorSrc = '';
this.tv.cancelDialogs(this.webApplication.mainWindow.webContents);
}
handleAppControlEvent(appControl: any) {
- let launchMode = appControl.getData('http://samsung.com/appcontrol/data/launch_mode');
- this.handlePreloadState(launchMode);
+ this.launchMode = appControl.getData('http://samsung.com/appcontrol/data/launch_mode');
+ this.handlePreloadState(this.launchMode);
+
+ if (this.launchMode === 'runningAsBackground') {
+ this.webApplication.suspended = false;
+ this.webApplication.windowList.forEach((window) => window.setEnabled(true));
+ this.webApplication.windowList[this.webApplication.windowList.length - 1].hide();
+ this.webApplication.sendAppControlEvent();
+ return false;
+ } else if (this.launchMode === 'runningAsForeground') {
+ this.webApplication.resume();
+ this.webApplication.sendAppControlEvent();
+ return false;
+ }
let skipReload = appControl.getData('SkipReload');
if (skipReload == 'Yes') {