Skip to content

Instantly share code, notes, and snippets.

@daviddahl
Last active April 22, 2016 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daviddahl/da3381e13fcc9686105424f29bb98464 to your computer and use it in GitHub Desktop.
Save daviddahl/da3381e13fcc9686105424f29bb98464 to your computer and use it in GitHub Desktop.
Page reloading Diagnosis

Page Reloading Diagnosis

Examination

  • Watched the console for clues, but found the console constantly re-loading and nearly useless
  • First gut feeling this has something to do with window.location
  • Grabbed all uglified JS files and beuatified them
  • Searched each file for location
  • A line in ac-globalfooter.js jumps out at me: window.location.replace('');
  • Calling window.location.replace('') in another web page console just throws. I still think it is the problem
  • I re-construct all JS (beautified) and HTML (not CSS) on my own server: https://dev.nulltxt.se/web-compat
  • I comment out each JS file one at a time to reduce the test case
  • ac-globalfooter.js is the culptrit
  • The line with window.location.replace('') is the problem.

Conclusion

  • Since window.content is undefined in Chrome/Webkit, the location.replace('') line is never called there
  • I found a few bugs on bugzilla that were similar to this, but nuanced history issues
  • I also noticed that Firefox's usage of location.replace to get stuck on a certain URL: I changed the '' to https://mozilla.org and the page was stuck on the redirect even with a "shift-reload"
  • I am still unsure of the underlying cause - perhaps another script does a correct call to location.replace() before this one is called and the caching issue is what we are seeing here?

Recommendation

  • I want to understand why the empty location.replace('')is needed - perhaps not? If so the site owner should remove it.
  • I would file a Gecko bug with the STR and examination data to see what bz, et al have to say
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment