[VD] Remove interceptFileProtocol feature on wrtjs 82/257582/6 submit/tizen/20210429.160020
authorDongHyun Song <dh81.song@samsung.com>
Wed, 28 Apr 2021 00:49:26 +0000 (09:49 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Wed, 28 Apr 2021 23:56:33 +0000 (23:56 +0000)
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 <dh81.song@samsung.com>
wrt_app/src/tv/web_application_tv.ts

index d58a8d5..d0a88a2 100644 (file)
 
 '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}`);