function hack() { let frame = document.querySelector("iframe"); if (frame) { let src = frame.getAttribute("src"); src = src.replace("tgWebAppPlatform=weba", "tgWebAppPlatform=android"); src = src.replace("tgWebAppPlatform=web", "tgWebAppPlatform=android"); frame.setAttribute("src", src); alert("hacked"); } else { alert("no iframe"); } }