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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:50:00+00:00 2026-05-14T04:50:00+00:00

I am writing a FireFox add-on that displays webpages from my server as control

  • 0

I am writing a FireFox add-on that displays webpages from my server as control and info panels. These panels were written and work in regular URLs, but when I try to access them through a custom protocol (so it’s like about:, just myplugin:settings) every XMLHttpRequest returns blank as if I was doing XSS stuff. I know the data’s getting through – the requests are valid, accepted by the server, and tcpdump says they’re making it to my machine. Clearly, it has something to do with the custom protocol implementation, so here is the relevant part of that:

    newURI: function(spec, charset, baseURI)
    {
        var uri = Components.classes[@"mozilla.org/network/simple-uri;1"].createInstance(nsIURI);

        if (baseURI) {
            spec = "myplugin:" + spec;
        }

        uri.spec = spec;

        return(uri);
    },

    newChannel: function(aURI)
    {
        var incomingURI = aURI.spec;
        var purpose = incomingURI.substring(incomingURI.indexOf(":") + 1, incomingURI.length);
        var my_spec;
        var my_uri;
        var proto;

 var api_scheme = "http";
 var api_host = "myapi.myserver.com";
 var api_token = "temp";

        purpose = encodeURI(purpose);

        if(purpose.match(/^\//)) // If it begins with a "/" (relative URL)
            if(purpose.match(/\?/)) // It already contains a query string
                my_spec = api_scheme + "://" + api_host + purpose + "&api_token=" + api_token;
            else
                my_spec = api_scheme + "://" + api_host + purpose + "?api_token=" + api_token;
        else
            my_spec = api_scheme + "://" + api_host + "/frontend/" + purpose + "?api_token=" + api_token;

        my_uri = Components.classes[@mozilla.org/network/simple-uri;1].createInstance(nsIURI);
        my_uri.spec = my_spec;
        proto = Components.classes["@mozilla.org/network/protocol;1?name="+api_scheme].getService(nsIProtocolHandler);

        return (proto.newChannel(my_uri));
    }
};
  • 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-14T04:50:00+00:00Added an answer on May 14, 2026 at 4:50 am

    In the eyes of the spec you ARE doing xss.

    While the implementations differ slightly across platforms the general rule of thumb is same protocol, same domain, same port.

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

Sidebar

Related Questions

I am writing a firefox extension that interacts with a JSON server interface. I
I'm writing a Firefox add-on that do something after the webpage is completely loaded.
I am writing a FireFox-Extension and want to load Data from Server. But when
I'm writing some JavaScript that interacts with a browser plugin (add-on in Firefox, ActiveX
I am writing a Firefox add-on that adds little icons next to all the
I'm writing a Firefox extension that's to be used in house. Basically, I need
When writing filters for the Firefox Add-On 'Adblock Plus' you can write rules to
I'm writing a simple web page that displays a table. It the right column
As I was writing a Firefox add-on using the Add-on SDK , I noticed
I'm writing a browser add-on (Chrome and Firefox) which, in a nutshell, does some

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.