From: YONGMAN SON Date: Mon, 11 Nov 2019 07:28:50 +0000 (+0900) Subject: [Migration][WRTJS][vd][bugfix] change url compare code. X-Git-Tag: submit/tizen_5.5/20191113.043747~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ffea36eda39711f07b7e87e67bd7b875f6906945;p=platform%2Fframework%2Fweb%2Fwrtjs.git [Migration][WRTJS][vd][bugfix] change url compare code. url : https://review.tizen.org/gerrit/#/c/platform/framework/web/wrtjs/+/216442/ 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: I985f7511da5ee861a3edfc321d4ed18aa67dcaad Signed-off-by: YONGMAN SON --- diff --git a/wrt_app/src/runtime.js b/wrt_app/src/runtime.js old mode 100755 new mode 100644 index 6130fcd9..19d245b2 --- 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.