mathdown icon indicating copy to clipboard operation
mathdown copied to clipboard

URL tracking first line spams browser history

Open anpc opened this issue 10 years ago • 1 comments

Every keypress in first line creates new entry in browser history, because the URL fragment changes.

Should somehow delay/debounce it. Note that simple constraining it to cursor out of first line won't work in co-author's browsers which similarly track the first line but have cursor elsewhere.

Mar 5, 2014 \newcommand{\Z}{\mathbb{Z}} | mathdown mathdown.net

Mar 4, 2014 \newcommand{\Z}{\mathbb{Z}} | mathdown mathdown.net

Mar 4, 2014 \newcommand{\Z}{\mathbb{Z} | mathdown mathdown.net

Mar 4, 2014 \newcommand{\Z}{\mathbb | mathdown mathdown.net

Mar 4, 2014 \newcommand{\Z}{\mathb | mathdown mathdown.net

Mar 4, 2014 \newcommand{\Z}{\math | mathdown mathdown.net

Mar 4, 2014 \newcommand{\Z}{\mat | mathdown mathdown.net

Mar 4, 2014 \newcommand{\Z}{\ma | mathdown mathdown.net

Mar 4, 2014 \newcommand{\Z | mathdown mathdown.net

Mar 4, 2014 \newcommand{ | mathdown mathdown.net

Mar 4, 2014 \newcomband | mathdown mathdown.net

Mar 4, 2014 \newcomand | mathdown mathdown.net

Mar 4, 2014 \newcoman | mathdown mathdown.net

Mar 4, 2014 \newcoman | mathdown mathdown.net

Mar 4, 2014 \newcom | mathdown mathdown.net

Mar 4, 2014 \newco | mathdown mathdown.net

Mar 4, 2014 \newc | mathdown mathdown.net

Mar 4, 2014 \new | mathdown mathdown.net

Mar 4, 2014 \ne | mathdown mathdown.net

Mar 4, 2014 \ned | mathdown mathdown.net

Mar 4, 2014 \n | mathdown mathdown.net

Mar 4, 2014 | mathdown mathdown.net

anpc avatar Mar 11 '14 17:03 anpc

There are 2 histories involved: browser's global history of everything you've ever visited (Ctrl+H in Chrome), and Back/Forward of current tab. Findings on Chrome:

  • New entries are added when changing location.hash; document.title does not matter.
  • history.replaceState() sucessfully prevents spamming of Back button history (which is good, you can't navigate to earlier title) but still spams global history (as long as the URL including fragment hasn't been seen before).

=> Planned solution:

  • Update title immediately.
  • Debounce/rate limit hash update.
    • Do hash update via replaceState() if possible.

cben avatar Jul 31 '14 07:07 cben