I would suggest starting with Honza's tutorials on creating an
extension: http://www.softwareishard.com/blog/firebug-tutorial/ (Start
from the bottom and work your way up.)
Once you have that working, to get the headers you just need to
register a listener on Firebug's NetMonitor. You can do this in your
extension's Module like so:
Firebug.MyModule = extend(Firebug.Module,
{
...
initializeUI: function(detachArgs)
{
Firebug.NetMonitor.addListener(this);
},
// NetMonitor listener interface method
onLoad: function(context, file)
{
// do something with the file.responseHeaders here
},
...
});
In the onLoad function you have access to the file object, which has
the the requestHeaders and responseHeaders. Take a look at Firebug's
net.js for more on the NetFile object.
Also, if you want to see an example of how to do what you are
describing check out the source code for ColdFire, as this is exactly
what it does. You can get the latest source here:
http://svn.riaforge.org/coldfire/branches/1.3/
I believe FirePHP does something similar, so you may want to look at
that code as well.
Hope that helps,
--Nathan
On Fri, Feb 6, 2009 at 2:13 AM, Rob Hudson <[email protected]> wrote:
>
> Hi,
>
> I'm very new to creating Firebug extensions. I'm working on a project
> and want to create a Firebug extension that scans the HTTP headers of
> the current request, looking for a particular header (or headers), and
> extract information from it and display it in the panel.
>
> The problem for me is I'm not sure where to do this or how to access
> the HTTP headers. Are they stored somewhere? Can I ask Firefox to
> hand them over?
>
> Any help or pointers would be much appreciated.
>
> Thanks,
> Rob
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---