Module: requestmod

Simple interface for request modification in Firefox. Use with care, as it can slow down requests drastically, since the handler is ran sync and blocks the request from getting sent/received. And you can in theory look at all the user's traffic. It's generally advised to try an alternative method from MDN: Intercept Page Loads instead. This implementation covers the "HTTP Observers" part.
Author:
  • Martin Giger
License:
  • MPL-2.0
Source:

Classes

RequestMod

Members

(static, constant) INCOMING :number

Constant for incoming requests, as in a response from a server. You generally want to avoid this direction, except for modifying incoming headers.
Type:
  • number
Default Value:
  • 0
Source:

(static, constant) OUTGOING :number

Constant signifying an outgoing request, as in a request going to a server.
Type:
  • number
Default Value:
  • 1
Source:

Type Definitions

requestCallback(request)

Must execute actions on the OngoingRequest object synchronously.
Parameters:
Name Type Description
request module:lib/ongoingrequest.OngoingRequest
Source:

RequestModOptions

Type:
  • Object
Properties:
Name Type Description
direction Array.<(module:requestmod.INCOMING|module:requestmod.OUTGOING)> The request directions that should be listened for
url Array.<(string|RegExp)> | RegExp | string An url pattern string with '*' wildcards (see MDN: SDK match-pattern module for detailed documentation on the syntax) or a regular expression or an array of such elements.
requestHandler module:requestmod~requestCallback
Source: