From d53576564830e61477e59958cdd65359d752a059 Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Fri, 29 Apr 2016 11:46:24 -0500 Subject: [PATCH] Fixes issue with externalConnectUrl hash param when the value is null --- connection_optimization/do_external_connect.js | 7 +++++-- modules/API/API.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/connection_optimization/do_external_connect.js b/connection_optimization/do_external_connect.js index bcd632584..98014eafb 100644 --- a/connection_optimization/do_external_connect.js +++ b/connection_optimization/do_external_connect.js @@ -17,8 +17,11 @@ */ (function () { var params = getConfigParamsFromUrl(); - - var url = params["config.externalConnectUrl"] || config.externalConnectUrl; + + //Url params have higher proirity than config params + var url = config.externalConnectUrl; + if(params.hasOwnProperty('config.externalConnectUrl')) + url = params["config.externalConnectUrl"]; /** * Check if connect from connection.js was executed and executes the handler diff --git a/modules/API/API.js b/modules/API/API.js index 28236e124..f15de8bb5 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -130,7 +130,7 @@ function processMessage(event) { */ function isEnabled () { let hash = location.hash; - return hash && hash.indexOf("external") > -1 && window.postMessage; + return hash && hash.indexOf("external=true") > -1 && window.postMessage; } /**