admin管理员组文章数量:1246502
I want to create an extension to firefox using addon builder that stops users from visiting a malicious website; When I see a URL that is suspicious, I stop the page from loading and ask the user if he really wants to visit the site. How could I implement that? I am expecting the functionality programmatically, so that I can make an extension.
I want to create an extension to firefox using addon builder that stops users from visiting a malicious website; When I see a URL that is suspicious, I stop the page from loading and ask the user if he really wants to visit the site. How could I implement that? I am expecting the functionality programmatically, so that I can make an extension.
Share Improve this question edited Nov 16, 2019 at 1:48 Cœur 38.7k26 gold badges203 silver badges277 bronze badges asked Jul 24, 2012 at 5:58 MmhMmh 4171 gold badge6 silver badges16 bronze badges3 Answers
Reset to default 9if(site.is_malicious)
window.stop();
There is an event called beforescriptexecute supported my mozilla ..... Have a look , I think it will work the job for you. But what you desire can be done something like this:
var r=confirm("Are you sure you want to visit this site ?");
if (r==false) { window.stop(); }
You are creating a FF extension right? Why not use greasemonkey or so? You can execute a script BEFORE the page loads(on greasemonkey). when that script is called, you can potentially stop the pageload and throw an error message.
本文标签: javascriptstop the web page from loading programmaticallyStack Overflow
版权声明:本文标题:javascript - stop the web page from loading programmatically - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740264763a2250952.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论