Skip to main content

Posts

Showing posts with the label Thunderbird extension

Thunderbird or Firefox extension - nsISimpleEnumerator

Issue :  Some of the Firefox or Mozilla application extension API s return  an enumerator object of type interface nsISimpleEnumerator ,  that result objects can not be used in a global scope and can not do iteration through the  list more than one time.   Cause: nsISimpleEnumerator  interface has only two methods hasMoreElements() getNext()   - There is no way to reset this enumerator to the first position once it is iterated through once. Like in this example given in Mozilla developer example page,  ( https://developer.mozilla.org/en-US/docs/Using_nsISimpleEnumerator )   var enumerator = document.getElementById('aStringBundleID').strings; var s = ""; while (enumerator.hasMoreElements()) { var property = enumerator.getNext().QueryInterface(Components.interfaces.nsIProperty); s += property.name + ' = ' + property.value + ';\n'; } If you want to reuse the 'enumerator' object again, in another place another loop, this wil...

Developing Firefox or Thunderbird Extensions: Extensions Folder not found in profile folder or Extension not showing up in addons

Issue: When developing Firefox / Thunderbird Extensions , after copying your extension to the extensions folder, your extension doesn't appear in the Thunderbird / Firefox. Cause: Mozilla  apps can be installed under 3 profiles: 1. Single User : Extensions accessible by single user 2. Multi User:  You can setup multiple Firefox profiles still use the same profile folder : default for extensions. 3. Global : This is the installation folder itself. Extensions installed in this folder available for all the users have access to this folder. If your install option and the development extensions folders  differ , after restarting the application will not be to locate in the extensions folder it is looking for. FIX:   (Don't get confused with Window's user profile vs Firefox user profiles - they are different) If you had selected 'Single User' install , move your extension files/package  under your user profile Windows: %APPDATA%\Thunderbird\Profi...