grahams / safari-utm-stripper

Safari extension that strips Google Analytics (i.e. Urchin Traffic Monitor) tokens from URL query strings.
https://safari-extensions.apple.com/details/?id=com.dosburros.safari-utm-stripper-J3Q79T636D
48 stars 6 forks source link

Use History interface to change URL without reload. #2

Closed kiding closed 10 years ago

kiding commented 10 years ago

HTML5's history.replaceState doesn't reload the page unlike window.location. This change reduces page load time of the affected URLs.

kiding commented 10 years ago

Neat!

grahams commented 10 years ago

Sweet... I was vaguely aware that the history API existed but never thought to use it for this extension... TBH once I got it working I kinda forgot about it. :)

Thanks for the patch!

kiding commented 10 years ago

No problem.

By the way, while testing the extension by myself, it seems to take some time for the script to get called on some heavy sites like The Verge, since Safari waits for all the DOM elements to be loaded properly. I'm now testing some bits to confirm that it's okay to put the script before the browser parsing, so I might create another pull request in some minutes...

grahams commented 10 years ago

Cool, I'll keep an eye out for it...