diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-11-04 03:14:40 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2019-11-04 03:14:40 +0300 |
commit | b11c09726fe9ccb1826e7854022519c7198fd9f0 (patch) | |
tree | f6e077fd90fc1d2c0030fe47ac6b918ee496d0ff /plugins/Overlay | |
parent | 54fe8e40ee3ccd68c3bf2f81ee36626b9c17a599 (diff) |
Some overlay improvements (#15032)
refs #14835
First fix improves the loading when you have eg configured
https://fooBar.com as a site url, and the domain in the url is foobar.com
The second fix is event.data related where in this case a website was firing an event and the site was posting event.data as an object
Diffstat (limited to 'plugins/Overlay')
-rw-r--r-- | plugins/Overlay/javascripts/Piwik_Overlay.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/Overlay/javascripts/Piwik_Overlay.js b/plugins/Overlay/javascripts/Piwik_Overlay.js index 4c06f75cd0..897bbbd394 100644 --- a/plugins/Overlay/javascripts/Piwik_Overlay.js +++ b/plugins/Overlay/javascripts/Piwik_Overlay.js @@ -149,10 +149,10 @@ var Piwik_Overlay = (function () { // unset iframe origin if it is not one of the site URLs var validSiteOrigins = Piwik_Overlay.siteUrls.map(function (url) { - return url.match(ORIGIN_PARSE_REGEX)[0]; + return url.match(ORIGIN_PARSE_REGEX)[0].toLowerCase(); }); - if (iframeOrigin && validSiteOrigins.indexOf(iframeOrigin) === -1) { + if (iframeOrigin && validSiteOrigins.indexOf(iframeOrigin.toLowerCase()) === -1) { try { console.log('Found invalid iframe origin in hash URL: ' + iframeOrigin); } catch (e) { @@ -193,6 +193,10 @@ var Piwik_Overlay = (function () { return; } + if (typeof event.data !== 'string') { + return; // some other message not intended for us + } + var strData = event.data.split(':', 3); if (strData[0] !== 'overlay.call') { return; @@ -371,4 +375,4 @@ var Piwik_Overlay = (function () { }; -})();
\ No newline at end of file +})(); |