javascript change url

JavaScript
history.pushState({}, null, newUrl); window.location.href = "www.google.com"; 
Source

Also in JavaScript: