关于去掉js 弹窗中在苹果手机上显示网址的问题
// 重置alert
window.alert = function(name){
const 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);
};
// 重置confirm
window.confirm = function (message) {
const iframe = document.createElement("IFRAME");
iframe.style.display = "none";
iframe.setAttribute("src", 'data:text/plain,');
document.documentElement.appendChild(iframe);
const alertFrame = window.frames[0];
const result = alertFrame.window.confirm(message);
iframe.parentNode.removeChild(iframe);
return result;
};