From c0ff46b5e4bbbe0d926dc6e4ddacb57729f86d22 Mon Sep 17 00:00:00 2001 From: liwei Date: Thu, 13 Jun 2019 16:43:09 +0800 Subject: [PATCH] [VD] Support RWI feature 1. When set vconf "db/rwi/inspected_appid" to appid or __AUL_DEBUG__ is 1, RWI feature will be started. (i.e. vconftool set -t string db/rwi/inspected_appid "zLNL5kc4kl.emanual" -f -g 5000 aul_test launch zLNL5kc4kl.emanual __AUL_DEBUG__ 1) 2. Support popup to show port number when appid is set to vconf. Native side link: https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/207831/ Change-Id: Id7d640b1fd690cce9695fe4c552be7fbe7ed5c90 Signed-off-by: liwei --- wrt_app/src/runtime.js | 18 +++++++++++++++--- wrt_app/src/web_application.js | 6 ++++++ 2 files changed, 21 insertions(+), 3 deletions(-) mode change 100755 => 100644 wrt_app/src/runtime.js mode change 100755 => 100644 wrt_app/src/web_application.js diff --git a/wrt_app/src/runtime.js b/wrt_app/src/runtime.js old mode 100755 new mode 100644 index 8fcdcf1c..d7daa36d --- a/wrt_app/src/runtime.js +++ b/wrt_app/src/runtime.js @@ -30,6 +30,7 @@ class Runtime { this.extensionManager = null; this.isLaunched = false; this.debug_mode = false; + this.need_inspector = false; var _this = this; app.on('before-quit', function(event) { @@ -143,8 +144,8 @@ class Runtime { // FIX ME : It must be supplemented to set a specific path wrt.setCookiePath(); - // AUL public key - To support debug argument - if (!_this.debug_mode && appControl.getData('__AUL_DEBUG__') == "1") { + // AUL public key/Vconf - To support inspector + if (!_this.debug_mode && _this.checkInspectorCondition(appControl)) { _this.debug_mode = true; _this.launchInspector(appControl); } @@ -189,8 +190,19 @@ class Runtime { return _this.extensionManager.deactivate(app, name); }); } + checkInspectorCondition(appControl) { + var _this = this; + let bundle_debug = (appControl.getData('__AUL_DEBUG__') === "1"); + _this.need_inspector = wrt.needUseInspector(); + return (bundle_debug || _this.need_inspector); + } launchInspector(appControl) { - var data = { "port" : [ wrt.getDebuggingPort().toString() ] }; + var _this = this; + var portnum = wrt.getDebuggingPort(); + var data = { "port" : [ portnum.toString() ] }; + if(_this.need_inspector) { + _this.webApplication.debugport = portnum; + } appControl.reply(data); } } diff --git a/wrt_app/src/web_application.js b/wrt_app/src/web_application.js old mode 100755 new mode 100644 index 3f242e98..2c35351b --- a/wrt_app/src/web_application.js +++ b/wrt_app/src/web_application.js @@ -32,6 +32,7 @@ class WebApplication { this.firstRendered = false; this.backgroundSupport = wrt.getBackgroundSupport(); this.multitaskingSupport = wrt.getMultitaskingSupport(); + this.debugport = 0; if (options.launchMode == 'backgroundAtStartup') { console.log('backgroundAtStartup'); this.preloadState = 'preload'; @@ -228,6 +229,11 @@ class WebApplication { if (self.runningStatus !== 'behind') wrt.notifyAppStatus('preload'); } + if((self.debugport) && (wrt.getPlatformType() === "product_tv")) { + const kDebugPopupScript = "alert('port number :" + self.debugport +"')"; + wrt.executeJS(self.mainWindow.webContents, kDebugPopupScript); + self.debugport = 0; + } }); } suspend() { -- 2.34.1