Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6143267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:30:11+00:00 2026-05-23T18:30:11+00:00

I want to open the link when the user uninstalls the addon, so for

  • 0

I want to open the link when the user uninstalls the addon, so for this what i have to code and under which event.

If anybody know about this then please help me out.

Currently this is what I am doing at the time of uninstall. But gBrowser.addTab(Website + 'uninstalled=true&token=' + uniqueguid); is not working over here.

var UninstallObserver = {
_uninstall : false,
observe : function(subject, topic, data) {

           //===Write Code here for Delete File Uninsatll Time
           //alert("Uninstall Time Delete File");
           var Filename = "webmail";
           // Delete all template file.

try{
var pref =  Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var finished = "";
pref.setBoolPref("myextension.install.just_installed", false);  
}
catch(e) {}


            gBrowser.addTab(Website + 'uninstalled=true&token=' + uniqueguid);
            var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);

            file.initWithPath(Components.classes["@mozilla.org/file/directory_service;1"].getService( Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile).path+"\\DefaultTemplate.txt");
            if ( file.exists() == true )
            {   
                var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance();
                if (aFile instanceof Components.interfaces.nsILocalFile)
                {                            
                    aFile.initWithPath(Components.classes["@mozilla.org/file/directory_service;1"].getService( Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile).path + "\\DefaultTemplate.txt");
                    aFile.remove(false);
                }
            }           
        //=======       
  if (topic == "em-action-requested") {
    subject.QueryInterface(Components.interfaces.nsIUpdateItem);

    if (subject.id == MY_EXTENSION_UUID)
     {

      if (data == "item-uninstalled")
      {
                    //==Delete File Whenever Uninstall          
                         //alert("When Uninatall");
                    //===========   
         data =  "item-cancel-action";
         this._uninstall = true;
      }

      if (data == "disabled")
      {
        //  alert("You are not allow to disable SysLocker.");
        this._uninstall = true;
      }

      else if (data == "item-cancel-action") 
      {
        this._uninstall = false;
      }
    }
  } 
  else if (topic == "quit-application-granted")
  {

  data =  "item-cancel-action";
    if (this._uninstall) 
    {     
      //Code here to delete registry       
    }
    this.unregister();
  }
},

register : function() {

 var observerService =
   Components.classes["@mozilla.org/observer-service;1"].
     getService(Components.interfaces.nsIObserverService);

 observerService.addObserver(this, "em-action-requested", false);
 observerService.addObserver(this, "quit-application-granted", false);

},

unregister : function() {

  var observerService =
    Components.classes["@mozilla.org/observer-service;1"].
      getService(Components.interfaces.nsIObserverService);

  observerService.removeObserver(this,"em-action-requested");
  observerService.removeObserver(this,"quit-application-granted");
}

}

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:30:12+00:00Added an answer on May 23, 2026 at 6:30 pm

    0) What kind of extension is this? I assume it’s a regular extension requiring restart; bootstrapped (restartless) extensions have their own uninstall notification.

    1) Per the MDC docs, the em-action-requested notification was replaced with a different notification in Firefox 4+, are you testing with Firefox 4 or 3.6?

    2) How exactly is gBrowser.addTab “not working over here”? Does the code get to that point? Do you get any messages in the Error Console (see that page for set up tips)? If you put your code in an XPCOM component (which is correct), you’ll first have to get a reference to a browser window. See Working with windows in chrome code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my page have a link <a href=/hyperlink>Hyper link</a> i want to open a dialog
When the user clicks on a link, I want to open a modal window
I have a button/link. I want to open multiple divs on multiple clicks on
In a Windows 8 Metro App I want the ListViewItems/Tiles to open a link
I want a link to open up another view in my webapp to display
I want to make the descriptive text around a form link also open the
want to open pdf file when a user clicks on hyperlink shown in gridview
I want to disable a hyperlink so that if user clicks on the link,
I have question about the beta Open Graph stuffs. The documentation I am looking
I want to open a popup window of an Image on More Info link

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.