alert在移动端顶部显示域名,重写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);
}








网友评论