去除alert显示域名

页面中加入下面代码即可:

 1  (function(){
 2         window.alert = function(name){
 3           var iframe = document.createElement("IFRAME");
 4           iframe.style.display="none";
 5           iframe.setAttribute("src", 'data:text/plain');
 6           document.documentElement.appendChild(iframe);
 7           window.frames[0].window.alert(name);
 8           iframe.parentNode.removeChild(iframe);
 9         }
10 })();

 

posted @ 2019-11-08 16:48  张馨  阅读(956)  评论(0编辑  收藏  举报