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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:03:47+00:00 2026-05-19T15:03:47+00:00

I have a firefox extension that listens to http-on-modify-request and inspects all GET requests

  • 0

I have a firefox extension that listens to “http-on-modify-request” and inspects all GET requests coming from firefox. I’d like to be able to cancel the request (say return a fail code to the page) or modify the URI of the request but can’t seem to do it. the nsiHttpChannel object just doesn’t allow it – for instance

delete httpChannel;

or reseting to an empty request

httpChannel = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Components.interfaces.nsIXMLHttpRequest);

don’t work (and you can’t modify the URI).

So how do you both intercept and modify http GET requests in a firefox extension.

  • 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-19T15:03:48+00:00Added an answer on May 19, 2026 at 3:03 pm

    delete httpChannel; just deletes the variable, sort of like saying httpChannel = undefined;. The request itself is unchanged. Similarly, your second idea just sets the variable to point at a new nsIHttpChannel instance, but the old request is still unchanged.

    To modify the request, use its properties and methods. See nsIHttpChannel or nsIChannel or nsIRequest. As you say, you can’t modify the URI so you might want to cancel it (see below) and replace it with a new one. I’m not sure exactly how to do that but I imagine one of those three pages has the answer.

    To cancel it, use nsIRequest.cancel()

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

Sidebar

Related Questions

I'd like to have my firefox extension display a block of html that overlaps
From a Firefox extension is there a way to get the XUL iframe/browser that
I have a firefox extension that listens when the firefox has launched using observe:
I have a firefox extension that needs to get the exact screen co-ordinates of
I'm developing a Firefox extension, and I have a toolbar button that displays an
I'm writing a firefox extension and I have a menulist of links that should
I have a working firefox extension that currently consists of a button. When I
In the Firefox extension I'm writing, I have a variable containing some data that
I have a Firefox extension that adds several buttons to the nav-bar toolbar using
I have a Firefox extension that pops up a log-in form (it's a c++

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.