同一ページ内でhisotryを遷移した際に発行されます。
<!DOCTYPE html> <head> <title>WebMessage TEST</title> <script> window.addEventListener('load', function() { history.pushState({'page':1}, "page1", "?page=1"); history.pushState({'page':2}, "page2", "?page=2"); history.pushState({'page':3}, "page3", "?page=3"); history.pushState({'page':4}, "page4", "?page=4"); history.pushState({'page':5}, "page5", "?page=5"); window.onpopstate = function(e) { alert(JSON.stringify(e.state)); } }); </script> </head> <body> <input type="button" onclick="history.back()" value="Back"> </body> </html>