const p = new URLSearchParams(location.search); const to = p.get("to") || "https://google.com"; location.href = to; Подключение…