From 7d4035b0ec613eb56cdda956ff1e52cb0ff10092 Mon Sep 17 00:00:00 2001 From: YossiCohn Date: Tue, 1 Sep 2020 01:38:17 +0300 Subject: Prevent possible infinite loop when page is unloading (#12114) --- js/piwik.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'js') diff --git a/js/piwik.js b/js/piwik.js index e7e4df7540..15e09d11fe 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -500,6 +500,14 @@ if (typeof window.Matomo !== 'object') { isPageUnloading = true; executePluginMethod('unload'); + + now = new Date(); + var aliasTime = now.getTimeAlias(); + if( (expireDateTime - aliasTime) > 3000) // fix bug #12108 + { + expireDateTime = aliasTime + 3000; + } + /* * Delay/pause (blocks UI) */ -- cgit v1.2.3