I need JavaScript to check for any changes in the URL address bar. These changes would not be caused by any clicks or refreshes. I've tried using the solution supplied by this answer:
I am just testing this code and it doesn't work:
setInterval(function() {
console.log(location.href);
}, 2000);
No matter what changes I make to the address bar URL, the location.href that is outputted always stays the same. Any ideas what I could be doing wrong? Thanks!