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.