Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2021-01-26 21:30:34 +0300
committerGitHub <noreply@github.com>2021-01-26 21:30:34 +0300
commitc8959ca507583b96960b6810a801786f5a9a0826 (patch)
tree7ef0ed4b1425a5b7a67ecebad0e5ef800dca1d2e /js/piwik.js
parenta08f08ff29e029ac67723302912cb270d2968942 (diff)
Fix possible service worker error in Firefox (#17139)
* Fix possible service worker error in Firefox * rebuilt piwik.js
Diffstat (limited to 'js/piwik.js')
-rw-r--r--js/piwik.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/js/piwik.js b/js/piwik.js
index 2d59699325..6c88b24835 100644
--- a/js/piwik.js
+++ b/js/piwik.js
@@ -6975,7 +6975,9 @@ if (typeof window.Matomo !== 'object') {
addEventListener(windowAlias, 'online', function () {
if (isDefined(navigatorAlias.serviceWorker) && isDefined(navigatorAlias.serviceWorker.ready)) {
navigatorAlias.serviceWorker.ready.then(function(swRegistration) {
- return swRegistration.sync.register('matomoSync');
+ if (swRegistration && swRegistration.sync) {
+ return swRegistration.sync.register('matomoSync');
+ }
});
}
}, false);