Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Beginner Assistance - Where does this code belong?

I'm trying to develop a firefox extension that inserts additional HTTP header fields into outgoing HTTP requests (to interface with an apache extension i'm concurrently developing).

While I understand the individual components of an extension and understand the basic tutorials that are presented on the web, I'm finding it difficult going from the "Hello World" tutorial extensions, into developing a full blown extension.

The sample code I am wanting to adapt for my purposes is presented at the bottom of Setting HTTP request headers.

I am wondering, where in the extension hierarchy should this code be placed and how is such code called/constructed/activated, will it run automatically when the extension is initialised?



Thanks in advance.

like image 725
Mike Hamer Avatar asked Nov 06 '22 22:11

Mike Hamer


1 Answers

For a basic extension, you would place your code in the chrome/content directory of the extension. You would hook this content into Firefox using an overlay. While overlays are usually xul content (buttons, etc) they can be anything. Including a script tag which would load fire off your Javascript code.

like image 91
ng.mangine Avatar answered Nov 11 '22 17:11

ng.mangine