Skip to content

Instantly share code, notes, and snippets.

@dergachev
Created October 4, 2013 15:47
Show Gist options
  • Save dergachev/6828074 to your computer and use it in GitHub Desktop.
Save dergachev/6828074 to your computer and use it in GitHub Desktop.
//
// proof of concept for how to write a chrome extension that makes the forward button always active
// hopefully can intelligently detect what to do (eg numeric URL? presence of pager?)
//
history.pushState({'forward':1}, "GO-NEXT", "/");
window.history.go(-1);
window.onpopstate = function(event) {
if(event.state && event.state.forward) {
console.log("location: " + document.location + ", state: " + JSON.stringify(event.state));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment