Bypass LiveHTTPHeaders Error: Components is not defined

November 26, 2005 at 11:00 pm (HowTo)

I just installed LiveHTTPHeaders extension into my firefox yesterday. Actually I have been using it since my Mozilla-suite’s old days, and it really helped a lot during the endless debugging sessions in my thesis project (Well, finally I’m a graduate now! :) ).

I have noticed this bug since then. When you run the LiveHTTPHeaders window, everything are just cool until after you close it, the Javascript Console will be flooded by a repeating error:

Error: Components is not defined Source File: chrome://livehttpheaders/content/LiveHTTPHeaders.js Line: 427

Thanks to Daniel Kabs’s workaround, now the bug is bypassed (as he said, it’s not a fix yet). However, rather to extract the whole jar and modify many unnecessary files (shown in his instruction [a] and [b]), I chose to extract only the particular file, modify it and add it back to jar. Here’s what I did:

  1. Find livehttpheaders.jar – I’m using Win2k installed in C drive. So normally firefox keeps all extensions under C:\Document and Settings\Application Data\Mozilla\Firefox\Profiles\xxxxx.default\extensions directory. From there, you can find the livehttpheaders.jar file under {8f8fe09b-0bd3-4470-bc1b-8cad42b8203a}\chrome directory.
  2. Extract LiveHTTPHeaders.js with WinRAR – I think both WinRAR & Winzip will do the job. Just browse into the jar file, find LiveHTTPHeaders.js under content directory and extract it.
  3. Add two lines of code to LiveHTTPHeaders.js – as suggested by Daniel, quoted as below:
    // This is the observerService's observe listener.
    observe: function(aSubject, aTopic, aData) {
    +		if (typeof Components == 'undefined')
    +			return;
    if (aTopic == 'http-on-modify-request') {
    aSubject.QueryInterface(Components.interfaces.nsIHttpChannel);
    (added the lines with the + at the beginning,
    but add them without the +!)
  4. Add LiveHTTPHeaders.js back to livehttpheaders.jar - just drag & drop it back into the WinRAR window, WinRAR will do the job for you. BTW, make sure you close the firefox before you add the file, otherwise it will fail as firefox is using that jar file.

Yeah, that’s all! ;)

Permalink 2 Comments

How I switch to Firefox

November 15, 2005 at 10:42 pm (HowTo)

I love reading. Especially after having ADSL signals tunneling through my phone wire, I spend more time reading online. Like most of the other users, I read using browsers. Rather to have only one browser installed, I have several browsers in my WinOS box, including Opera, Mozilla Suite, Firefox and and of course, the default IE (oh.. believe or not, and Lynx too! ;) But I only tried it once).

As an online reader, I wish my browser to have these features:

  • Saved Session (as in Opera) – able to recall which page and until where I read in the last browsing session.
  • Easy-To-Trackback History (as in Opera) – a list of previous browsed web pages sorted by last accessed date, so I can track back what I’d read (Nightmare.. if trying to track back the last accessed web page in IE’s history).
  • Custom Styling View (as in Opera) – able to view web page in customized styling. As I always prefer a darker background when I read novels in long hours.
  • Tabbed Browsing (as in Opera, Mozilla) – I love to follow hyperlinks and open them in new pages. I do read multiple pages MUXly at once, sometimes. :P
  • Feeds Reader – (as in Opera, Firefox) blogrolls are growing in my bookmark, I wish to have a feeds reader intergrated into my browser.

As a programmer wannabe, somehow I wish my browser to have extra features:

  • Custom User Scripts (as Greasemonkey) – well, I love the idea where users should able to take control of what will be executed in their own box.
  • Web Development & Debugging Tools (as in Mozilla Suite) – they really helped me so much to during the degree’s thesis project. ;)
  • A Playground to Hack – hack into the codes.. adding features of my own..

So, this evening, I decided to try to setup an *ideal* browser with features described as above. Here’s what I did:

  1. Download & install Firefox 1.0.7
  2. Install a new theme/skin: ifox 1.6
  3. Install extension: Sage 1.3.6 – the feed aggregator
  4. Install extension: Greasemonkey 0.5.3 – the user script manager
  5. Install extension: SessionSaver .2d * nightly 30 – restore last browsing session

And here’s what I have now!

my new firefox screenshot

A browser with Saved Session, EasyToTrack History, Tabbed Browsing, Feeds Reader and a *cute* monkey. ;) Suprisingly, I can use Sage to watch out my gmail too!

Well, I will install some Web Development Tools once I need them, I think. Now, there is still one thing, my new browser cannot view page using custom styling mode (as “User Mode” in Opera). I just couldn’t find the appropriate extension yet, please tell me if you have the extension that just do the job. :)

Permalink 3 Comments