Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix tracker for IE 11.

Mike Caof4d365bf7823
diff --git a/tracker/index.js b/tracker/index.js
index 99b4df461..a654c0972 100644
--- a/tracker/index.js
+++ b/tracker/index.js
@@ -125,7 +125,8 @@ import { removeTrailingSlash } from '../lib/url';
mutations.forEach(mutation => {
const element = mutation.target;
addEvent(element);
- element.querySelectorAll(eventSelect).forEach(addEvent);
+ const elements = element.querySelectorAll(eventSelect);
+ Array.prototype.forEach.call(elements, addEvent);
});
};
@@ -168,7 +169,8 @@ import { removeTrailingSlash } from '../lib/url';
switch (document.readyState) {
/* DOM rendered, add event listeners */
case 'interactive': {
- document.querySelectorAll(eventSelect).forEach(addEvent);
+ const events = document.querySelectorAll(eventSelect);
+ Array.prototype.forEach.call(events, addEvent);
const observer = new MutationObserver(monitorMutate);
observer.observe(document, { childList: true, subtree: true });
break;