Help for beginners. Where is this code?

I am trying to develop a firefox extension that adds additional HTTP header fields to outgoing HTTP requests (to interact with the apache extension, which I am developing at the same time).

As long as I understand the individual components of the extension and understand the basic training materials presented on the Internet, it’s difficult for me to switch from the extensions of the Hello World textbooks to the development of a full-scale extension.

An example of the code that I want to adapt for my purposes is presented below Configuring HTTP request headers .

I am wondering where this code should be located in the extension hierarchy and how this code is called / designed / activated, will it start automatically when the extension is initialized?



Thanks in advance.

+5
source share
2 answers

For a basic extension, you put your code in the chrome / content directory of the extension. You would connect this content to Firefox using overlay . Although overlays usually represent xul content (buttons, etc.), they can be anything. Including a script tag that will load your Javascript code.

+2
source

This code is an XPCOM component and goes to a file components/<some name>.js.

XPCOM, , , .js components . ( var myModule = { ), Firefox, , , .

, , :

catMgr.addCategoryEntry("app-startup", this.myName, this.myProgID, true, true);

http-on-modify:

os.addObserver(this, "http-on-modify-request", false);
0

All Articles