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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:48:23+00:00 2026-06-11T22:48:23+00:00

I’m trying to use Firefox to read the SSH banner. ie. when you initially

  • 0

I’m trying to use Firefox to read the SSH banner. ie. when you initially connect to an SSH server the server sends you its banner, identifying the server software and you send the SSH server your banner, identifying your client software.

To do so I’m using the example at this URL:

Is there nsiClientSocket in firefox extension javascript?

Here’s my code:

'use strict';

const {Cc,Ci} = require("chrome")
const prefs = require("simple-prefs");


exports.main = function(options,callbacks) {
    var transport = Components.classes["@mozilla.org/network/socket-transport-service;1"]
                              .getService(Components.interfaces.nsISocketTransportService)
                              .createTransport(null, 0, "localhost", 22, null);

    //var output = transport.openOutputStream(0, 0, 0);
    var input = transport.openInputStream(0, 0, 0);
    var data = "test";
    dump(stream.read());
    //stream.write(data, data.length);
    //stream.close();
    dump("all done!");
};

When I do cfx xpi with that I get this:

The following lines from file C:\path\to\lib\main.js:
   8: var transport = Components.classes["@mozilla.org/network/socket-transport-service;1"]
   9: .getService(Components.interfaces.nsISocketTransportService) use 'Components' to access chrome authority. To do so, you need to add a line somewhat like the following:

  const {Cc,Ci} = require("chrome");

Then you can use any shortcuts to its properties that you import from the 'chrome' module ('Cc', 'Ci', 'Cm', 'Cr', and 'Cu' for the 'classes', 'interfaces', 'manager', 'results', and 'utils' properties, respectively. And `components` for `Components` object itself).

So I try this instead:

'use strict';

const {Cc,Ci} = require("chrome")
const prefs = require("simple-prefs");


exports.main = function(options,callbacks) {
    var transport = components.classes["@mozilla.org/network/socket-transport-service;1"]
                              .getService(interfaces.nsISocketTransportService)
                              .createTransport(null, 0, "localhost", 22, null);

    //var output = transport.openOutputStream(0, 0, 0);
    var input = transport.openInputStream(0, 0, 0);
    var data = "test";
    dump(stream.read());
    //stream.write(data, data.length);
    //stream.close();
    dump("all done!");
};

ie. I make Components components (lowercase) and Components.interfaces just interfaces. But then I get this error on the console:

    var transport = components.classes["@mozilla.org/network/socket-transport-service;1"]
ReferenceError: components is not defined

Any ideas?

  • 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-11T22:48:24+00:00Added an answer on June 11, 2026 at 10:48 pm

    You should use Cc instead of Components.classes and Ci instead of Components.interfaces – these are the variables you imported from the chrome module and they are defined. Should you ever need to use the Components object itself (unlikely) you can import it as well:

    const {components, Cc, Ci} = require("chrome");
    

    For reference: chrome authority

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to select an H1 element which is the second-child in its group
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
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.