skume

alert 被覆盖

今天装修博客园,调试了下JS代码发现 alert() 方法被官方覆盖了,查看源码得知 alert 的功能被替换成了 console.log。

恢复

var _frame = document.createElement(\'iframe\');
document.body.appendChild(_frame);
window.alert = _frame.contentWindow.alert

官方有一套脚本过滤机制,主要是为了安全和体验上的考虑,不建议去绕过这种机制。

分类:

技术点:

相关文章:

  • 2021-12-27
  • 2022-02-01
  • 2021-07-28
  • 2021-12-05
  • 2021-11-13
  • 2021-10-08
  • 2021-12-27
猜你喜欢
  • 2021-10-05
  • 2021-12-18
  • 2021-09-08
  • 2021-12-27
  • 2022-12-23
  • 2021-12-27
相关资源
相似解决方案