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 8176249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:05:33+00:00 2026-06-06T23:05:33+00:00

I’ve spent a few days reading over all manner of tutorials , MDN entries

  • 0

I’ve spent a few days reading over all manner of tutorials, MDN entries, and S.O. posts, and I’ve come to suspect that I’m missing something obvious, but I’m too inexperienced with XPCOM to spot it. I’m about 80% sure there error is somewhere in my custom component (components/fooLogin.js).

Problem: When the add-on initializes (when I call loadData() from chrome/content/foologin.js), I get an error saying:

TypeError: Components.classes[‘@foo.com/foologinautocomplete;1’] is undefined

Am I maybe trying to create the component before the class has been registered? Is there something else I need to do to register it? Any tips would be appreciated.

Relevant Code: (happy to supply any additional code, if need be)

components/fooLogin.js:

Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
function fooLoginAutoComplete(){
        this.wrappedJSObject = this;
}
fooLoginAutoComplete.prototype = {
        classID: Components.ID("loginac@foo.com"),
        contractID: "@foo.com/foologinautocomplete;1",
        classDescription: "Auto complete for foo",
        QueryInterface: XPCOMUtils.generateQI([]),
        complete: function(str){  // Autocomplete functionality will in this function
                return null;
        }
};
var NSGetFactory = XPCOMUtils.generateNSGetFactory([fooLoginAutoComplete]);

chrome/content/foologin.js:

let fooLogin = {
    dataLoaded : false,
    searchFilter = null,
    ...
    loadData : function(){
        ...
        try{
            alert(1);  // This alert fires
            this.searchFilter = Components.classes['@foo.com/foologinautocomplete;1']
                .getService().wrappedJSObject;
            alert(2);  // I get the error before this alert
        }catch(e){alert(e);}
        this.dataLoaded = true;
    }
}
window.addEventListener("load", function(){
    if(!fooLogin.dataLoaded) fooLogin.loadData();
}

chrome.manifest:

content foologin         chrome/content/
content foologin         chrome/content/ contentaccessible=yes
skin    foologin classic chrome/skin/
locale  foologin en-US   chrome/locale/en-US/

component loginac@foo.com                 components/fooLogin.js
contract  @foo.com/foologinautocomplete;1 loginac@foo.com

overlay chrome://browser/content/browser.xul chrome://foologin/content/foologin.xul
  • 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-06-06T23:05:35+00:00Added an answer on June 6, 2026 at 11:05 pm

    In your chrome.manifest, you have this:

    component loginac@foo.com components/fooLogin.js
    contract @foo.com/foologinautocomplete;1 loginac@foo.com

    and in fooLogin.js you have:

    classID: Components.ID(“loginac@foo.com”),

    loginac@foo.com is not a valid class ID for a component.

    They have to be of the form:

    {00000000-0000-0000-0000-000000000000}

    Only add-ons can have a foo@bar.com format.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.