window.onload = function() { // similar behavior as clicking on a link window.location.href = "https://google.com"; }