var comment = (function createCurrentURLComment(window){
var document = window.document,
location = window.location,
html = document.documentElement;
var comment = html.insertBefore(
document.createComment(location.href),
html.firstChild
);
window.addEventListener('popstate', function(){
comment.data = location.href;
}, false);
return comment
}(window));