手机页面alert弹出框有url咋办

xiaoxiao2021-02-28  99

在script中加入如下代码

window.alert = function(name){ // 重写alert方法去掉ios下alert带的url var iframe = document.createElement("IFRAME"); iframe.style.display="none"; iframe.setAttribute("src", 'data:text/plain,'); document.documentElement.appendChild(iframe); window.frames[0].window.alert(name); iframe.parentNode.removeChild(iframe); }
转载请注明原文地址: https://www.6miu.com/read-28377.html

最新回复(0)