Search code examples
javascriptfirefox-addonfirefox-addon-sdk

stop the web page from loading programmatically


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.


Solution

  • 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(); }