From: VBS Date: Wed, 20 Nov 2019 08:23:40 +0000 (+0800) Subject: [VD]Fix account is not logined in automatically when relaunch X-Git-Tag: accepted/tizen/5.5/unified/20191122.012336~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8ab4b97f7acd548e2061ad74bd44b2064fd5b08;p=platform%2Fframework%2Fweb%2Fwrtjs.git [VD]Fix account is not logined in automatically when relaunch Defect id: DF191018-00567 Issue: when relaunch app Watcha Play(3201612011352), app change to logout status. Reason: the src of Watcha Play app is: https://erd2-play.watcha.net/tv but not index.html. So url request which need the cookie is earlier than valid cookie path been set. Fix method: for tv product, set cookie path before loadURL. Change-Id: I7351d1027c2c6efc90a8e2897aeef2e431b211a7 Signed-off-by: chunling.ye --- diff --git a/wrt_app/src/runtime.js b/wrt_app/src/runtime.js index bb98db3..00b7274 100644 --- a/wrt_app/src/runtime.js +++ b/wrt_app/src/runtime.js @@ -79,6 +79,8 @@ class Runtime { }); app.on('web-contents-created', function(event, webContents) { console.log('web-contents-created'); + if (_this.isTVProfile) + _this.setCookiePath(); _this.webContents = webContents; _this.webContents.on('before-input-event', function(event, input) { if (_this.isLaunched && _this.webApplication) { @@ -179,7 +181,8 @@ class Runtime { } } } - _this.configureRuntime(appControl); + _this.setCookiePath(); + _this.launchInspector(appControl); }); wrt.on('suspend', function() { console.log('suspend'); @@ -306,22 +309,24 @@ class Runtime { let bundleDebug = (appControl.getData('__AUL_DEBUG__') === "1"); return (bundleDebug || this.inspectorEnabledByVconf); } - launchInspector(appControl) { - var debugPort = wrt.startInspectorServer(); - var data = { "port" : [ debugPort.toString() ] }; - if (this.webApplication) - this.webApplication.debugPort = debugPort; - appControl.reply(data); - } - configureRuntime(appControl) { - this.configureRuntime = (param) => {}; // call once + setCookiePath() { + this.setCookiePath = () => {}; // call once + console.log('setCookiePath'); // FIX ME : It must be supplemented to set a specific path wrt.setCookiePath(); + } + launchInspector(appControl) { + this.launchInspector = (param) => {}; // call once + console.log('launchInspector'); // AUL public key/Vconf - To support inspector if (this.checkInspectorCondition(appControl)) { - this.launchInspector(appControl); + var debugPort = wrt.startInspectorServer(); + var data = { "port" : [ debugPort.toString() ] }; + if (this.webApplication) + this.webApplication.debugPort = debugPort; + appControl.reply(data); } } handleKeyEvents(key) {