console.log(window.location.href); As noted in the comments, the line below works, but it is bugged for Firefox. document.URL