Created
October 4, 2013 15:47
-
-
Save dergachev/6828074 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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