JavaScript obtenga URL actual
var currentUrl = window.location.href;
Grepper
var currentUrl = window.location.href;
window.location.hostname
var url = new URL('http://megaimkon.loc/storage/photos/all_users/slider-1.jpg');
console.log(url.pathname)
window.location.protocol = “http:”
window.location.host = “css-tricks.com”
window.location.pathname = “/example/index.html”
window.location.search = “?s=flexbox”const
postID = (new URLSearchParams(window.location.search)).get('post');
const url = new URL(url [, base])