Skip to content

Commit

Permalink
Merge pull request #142 from ekremney/rid-of-conflicting-variables
Browse files Browse the repository at this point in the history
fix: remove conflicting variables
  • Loading branch information
trieloff authored Mar 27, 2024
2 parents c4455e8 + 3f871d2 commit c56a2f4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ document.querySelectorAll('form').forEach((form) => {
window.addEventListener('visibilitychange', ((event) => sampleRUM.leave(event)));
window.addEventListener('pagehide', ((event) => sampleRUM.leave(event)));

const observer = new PerformanceObserver((list) => {
new PerformanceObserver((list) => {
list.getEntries()
.filter((entry) => !entry.responseStatus || entry.responseStatus < 400)
.filter((entry) => window.location.hostname === new URL(entry.name).hostname)
Expand All @@ -175,11 +175,9 @@ const observer = new PerformanceObserver((list) => {
sampleRUM('missingresource', { source: entry.name, target: entry.hostname });
});
}
});
observer.observe({ type: 'resource', buffered: true });
}).observe({ type: 'resource', buffered: true });

const usp = new URLSearchParams(window.location.search);
[...usp.entries()]
[...new URLSearchParams(window.location.search).entries()]
.filter(([key]) => key.startsWith('utm_'))
.filter(([key]) => key !== 'utm_id')
.forEach(([key, value]) => {
Expand Down

0 comments on commit c56a2f4

Please sign in to comment.