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 badges
Add a ment  | 

3 Answers 3

Reset to default 9
if(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