相关疑难解决方法(0)

如何覆盖警报功能?

在网站上有类似的代码(其网站上的网站)

<script language="JavaScript" type="text/javascript">         
    alert("ble");
</script>
Run Code Online (Sandbox Code Playgroud)

我尝试使用GM禁用该警报.我试图这样做

unsafeWindow.alert=function() {};
Run Code Online (Sandbox Code Playgroud)

但我看到警报并得到此错误

Error: uncaught exception: [Exception... "Component is not available"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: file:///C:/Documents%20and%20Settings/arokitnicki/Dane%20aplikacji/Mozilla/Firefox/Profiles/sm4bsods.default/extensions/%7Be4a8a97b-f2ed-450b-b12d-ee082ba24781%7D/components/greasemonkey.js :: anonymous :: line 377"  data: no]
Run Code Online (Sandbox Code Playgroud)

如何禁用该警报?

PS这是JavaScript不问题,但Greasemonkey的问题.

编辑:

它的公司的网站,所以我无法粘贴真正的代码

<head>
    <script>    
        dojo.require("dojo.back");
        dojo.back.init(); 
    </script>
</head>
<body onload="someMethod()">
    <iframe></iframe>
    <script>         
        alert("bla");
    </script>
</body>
Run Code Online (Sandbox Code Playgroud)

标题中还有一些脚本和CSS声明.

javascript alert greasemonkey userscripts tampermonkey

6
推荐指数
1
解决办法
4587
查看次数