From eca8e674ee9f53f64f905df1a751430e01b8c0cc Mon Sep 17 00:00:00 2001 From: YONGMAN SON Date: Fri, 25 Oct 2019 11:24:26 +0900 Subject: [PATCH] [WRTJS][vd][bugfix] change url compare code. kona : DF191021-00235 If the page url doesn't change, don't need to reload. But it's being reloaded by a bug. src = http://d2ehepluhe2jv7.cloudfront.net _this.webApplication.mainWindow.getURL() = http://d2ehepluhe2jv7.cloudfront.net/#/ (Compare the loaded url with the url to be loaded. Some special characters make the url different.) Change-Id: I18947c0d7641d395ae5797c3c85890424871e1e8 Signed-off-by: YONGMAN SON --- wrt_app/src/runtime.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) mode change 100755 => 100644 wrt_app/src/runtime.js diff --git a/wrt_app/src/runtime.js b/wrt_app/src/runtime.js old mode 100755 new mode 100644 index 6130fcd..19d245b --- a/wrt_app/src/runtime.js +++ b/wrt_app/src/runtime.js @@ -34,6 +34,7 @@ class Runtime { this.sandbox = []; this.webContents = null; this.addonPkgs = []; + this.isTVProfile = (wrt.getPlatformType() === 'product_tv'); var _this = this; app.on('before-quit', function(event) { @@ -148,8 +149,21 @@ class Runtime { let reload = loadInfo.getReload() || _this.webApplication.isAlwaysReload; if (!reload) { - if (src != _this.webApplication.mainWindow.getURL()) - reload = true; + if (_this.isTVProfile) { + console.log(`src = ${src}, app-control uri = ${_this.webApplication.mainWindow.getURL()}`); + const url = require('url'); + let appcontrolUrl = url.parse(src); + let originUrl = url.parse(_this.webApplication.mainWindow.getURL()); + if (appcontrolUrl.protocol !== originUrl.protocol || + appcontrolUrl.host !== originUrl.host || + appcontrolUrl.pathname !== originUrl.pathname) { + reload = true; + } + } else { + if (src != _this.webApplication.mainWindow.getURL()) { + reload = true; + } + } } // handle http://tizen.org/appcontrol/operation/main operation specially. // only menu-screen app can send launch request with main operation. -- 2.7.4