From b084bc6203fe076e072468d2c40c01127231e8f5 Mon Sep 17 00:00:00 2001 From: DongHyun Song Date: Wed, 28 Apr 2021 09:49:26 +0900 Subject: [PATCH] [VD] Remove interceptFileProtocol feature on wrtjs This feature will be handled on native side. Related patch: https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/257519/ Change-Id: I6b73b4e444140c0d9faf82d699d85f322d535dda Signed-off-by: DongHyun Song --- wrt_app/src/tv/web_application_tv.ts | 38 ------------------------------------ 1 file changed, 38 deletions(-) diff --git a/wrt_app/src/tv/web_application_tv.ts b/wrt_app/src/tv/web_application_tv.ts index d58a8d5..d0a88a2 100644 --- a/wrt_app/src/tv/web_application_tv.ts +++ b/wrt_app/src/tv/web_application_tv.ts @@ -16,13 +16,11 @@ 'use strict'; -import { protocol } from 'electron'; import { wrt } from '../../browser/wrt'; import { WebApplication } from '../web_application'; import { WebApplicationDelegate } from '../../common/web_application_delegate'; export class WebApplicationDelegateTV extends WebApplicationDelegate { - accessiblePath?: string[]; backgroundExecution: boolean = false; inspectorSrc: string = ''; isAlwaysReload: boolean = false; @@ -48,49 +46,13 @@ export class WebApplicationDelegateTV extends WebApplicationDelegate { this.backgroundExecution = false; } this.isAlwaysReload = this.tv.isAlwaysReload(); - this.accessiblePath = this.tv.getAccessiblePath(); - this.webApplication.multitaskingSupport = this.tv.getMultitaskingSupport(); this.webApplication.defaultBackgroundColor = '#0000'; this.webApplication.defaultTransparent = true; - this.initAccessiblePath(); this.initEventListener(); } - private initAccessiblePath() { - if (this.accessiblePath) { - console.log(`accessiblePath: ${this.accessiblePath}`); - protocol.interceptFileProtocol('file', (request: any, callback: any) => { - if (request.url) { - let parsed_info = new URL(request.url); - let access_path = parsed_info.host + decodeURI(parsed_info.pathname); - console.log(`check path: : ${access_path}`); - for (let path of (this.accessiblePath as string[])) { - if (access_path.startsWith(path)) { - callback(access_path); - return; - } - } - if (access_path.indexOf("/shared/res/") > -1) { - callback(access_path); - return; - } - else { - console.log(`invalid accesspath: ${access_path}`); - (callback as any)(403); - } - } else { - console.log('request url is empty'); - (callback as any)(403); - } - }, (error: Error) => { - if (error) - console.log(`error : ${error}`); - }); - } - } - initEventListener() { wrt.on('app-status-changed', (event: any, status: string) => { console.log(`runningStatus: ${status}, ${this.webApplication.loadFinished}`); -- 2.7.4