import { WebApplicationDelegate } from '../../common/web_application_delegate';
export class WebApplicationDelegateTV extends WebApplicationDelegate {
- backgroundExecution: boolean = false;
+ backgroundExecutionLaunchMode: boolean = false;
+ backgroundExecutionMetaData: string = 'false';
inspectorSrc: string = '';
isAlwaysReload: boolean = false;
preloadStatus: string = 'none';
this.preloadStatus = 'none';
}
if (options.launchMode == 'backgroundExecution') {
- console.log('backgroundExecution');
- this.backgroundExecution = true;
+ console.log('launch mode is backgroundExecution');
+ this.backgroundExecutionLaunchMode = true;
} else {
- this.backgroundExecution = false;
+ this.backgroundExecutionLaunchMode = false;
}
this.isAlwaysReload = this.tv.isAlwaysReload();
this.webApplication.multitaskingSupport = this.tv.getMultitaskingSupport();
this.webApplication.defaultBackgroundColor = '#0000';
this.webApplication.defaultTransparent = true;
+ this.backgroundExecutionMetaData = this.tv.getMetadata('http://samsung.com/tv/metadata/background.execution.support');
this.initEventListener();
}
}
}
- backgroundExecutable() {
- return this.backgroundExecution;
+ backgroundExecutableLaunchMode() {
+ return this.backgroundExecutionLaunchMode;
}
isPreloading() {
needInpectorGuide() {
let inspectorEnabledByVconf = this.tv.needUseInspector();
- if (inspectorEnabledByVconf && !this.backgroundExecution) {
+ if (inspectorEnabledByVconf && !this.backgroundExecutionLaunchMode) {
this.inspectorSrc = this.webApplication.contentSrc;
this.webApplication.contentSrc = 'about:blank';
return true;
return false;
}
}
+
+ if ('true' === this.backgroundExecutionMetaData) {
+ console.log(`handle AppControl background exectution app to show`);
+ this.webApplication.mainWindow.show();
+ }
return true;
}
}
private backgroundRunnable() {
- return this.backgroundSupport || this.profileDelegate.backgroundExecutable();
+ return this.backgroundSupport || this.profileDelegate.backgroundExecutableLaunchMode();
}
handleAppControlEvent(appControl: any) {
return;
}
console.log('WebApplication : show');
- if (this.profileDelegate.backgroundExecutable()) {
- console.log('skip showing while backgroundExecution mode');
+ if (this.profileDelegate.backgroundExecutableLaunchMode()) {
+ console.log('skip showing while backgroundExecutionLaunchMode mode');
} else if (!this.mainWindow.isVisible()) {
console.log(`show this.windowList.length : ${this.windowList.length}`);
this.mainWindow.show();