firefox-addons-dndetails-typeError

Resolving the TypeError: Components.classes with dndetails firefox addon

Resolving the TypeError: Components.classes with dndetails firefox addon

One of the Best firefox AddOn I have used in the last 8 years is the dndetails.
Unfortunately Ian Willis, Author of the addon and dndetails.com stopped  updating the addon.

due to this reason, many had problems in running the addon successfully in the firefox based browser.

I just want to share the findings of the problem and solutions to resolve the issue.

I am not the one who found the solution, I am just sharing the solution offered by rick & others.

You will get the below error, when you install this addon on New firefox versions
its not working with new versions of Firefox because FFv3 component is removed from the application which manifests as an alert box

TypeError: Components.classes['@mozilla.org/extensions/manager;1'] is undefined

type-error-components-classses

You have to open the roaming folder of your users Appdata
Normally drivename:\Users\username\AppData\Roaming\Mozilla\Firefox\Profiles
eg. C:\Users\ilango\AppData\Roaming\Mozilla\Firefox\Profiles\somename.default\
here open >> /extensions/{152455DE-7B40-4bcf-B5B4-C68A1BE85A91}/chrome/chromeFiles/content/dndetails.js with editor like notepad++(http://l.whir.in/notepad)

dndetails_dbsearch function which starts on line 494 you need to remove the old firefox 3 check.

. 
.
---------------------------------------------------------------------------
//firefox 4 no longer supports extension manager, using directory service workaround
const id = "{152455DE-7B40-4bcf-B5B4-C68A1BE85A91}";
if (parseInt(Application.version.substr(0, 1)) == 3) {
//firefox 3
var file = Components.classes["@mozilla.org/extensions/manager;1"]
.getService(Components.interfaces.nsIExtensionManager)
.getInstallLocation(id)
.getItemLocation(id);
} else {
var file = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties)
.get("ProfD", Components.interfaces.nsIFile);
file.append("extensions");
file.append(id);
}
---------------------------------------------------------------------------

should be replace by this code below:

---------------------------------------------------------------------------
//firefox 4 no longer supports extension manager, using directory service workaround
const id = "{152455DE-7B40-4bcf-B5B4-C68A1BE85A91}";
var file = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile);
file.append("extensions");
file.append(id);
---------------------------------------------------------------------------

Once done, Popup error message issue will be resolved.

do share your thoughts, do visit again for more ..

2 Replies to “Resolving the TypeError: Components.classes with dndetails firefox addon”

Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.