Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Page reloading in infinite loop in Firefox and Safari if tracking browser location object #660

Open
yftachman opened this issue Jun 22, 2021 · 1 comment

Comments

@yftachman
Copy link

Hello,
I recently encountered a problem in my app that in firefox and safari the page got into an infinite reload loop. In chrome this did not happen. After much investigation I have found that the problem was in a specific tracking we did.

window.analytics.track('Page Viewed', {
    title: document.title,
    label: toState.name,
    page: window.location.pathname,
    url: window.location,
});

Changing the "url: window.location" to "url: window.location.href" has fixed the issue. I'm pretty sure this problem has started happening recently, possibly in the last week but not sure on the specific timeline.

@impressiver
Copy link

Oddly enough, removing the .min in the snippet to load the unminified version of analytics.js does not cause an infinite reload (when using window.location).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants