且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我可以通过Google Chrome扩展程序阻止提醒()吗?

更新时间:2023-12-05 23:12:22

谢谢。这有帮助。然而,我意识到我需要这样做才能使它工作。

Thank you. That helped. However, I realized I needed to do this to get it to work

location.href="javascript: window.alert = function(x) {console.log(x)};"

如果我想删除警报并确认,我可以这样做

if I wanted to remove alerts and confirms, I can do

location.href="javascript: window.alert = function(x) {console.log(x)}; window.confirm = function(){return true;};";