How to print browser url in Javascript?
// If url = "http://127.0.0.1:80/index.html"
console.log(location.href); // http://127.0.0.1:80/index.html
console.log(location.protocol); // http:
console.log(location.hostname); // 127.0.0.1
console.log(location.port); // 80
console.log(location.pathname); // /index.html