I love Joe Hewitt's FireBug extension, and just like Bill Rawlinson, I can't live without a Gmail tab open; unfortunately, Gmail doesn't play nicely with FireBug due to the enormous amount of errors it produces.
After a few days of fruitless Googling (Bill's entry was the closest I came to finding a solution), I decided to have a crack at the problem myself, and managed to solve it.
I'd like to make it crystal-clear that FireBug is not my work in any way, and that I claim no credit for it whatsoever. All I've done is stop it working with Gmail, so I could continue to use it. Joe's done a fantastic job on it, far better than I could have, and I hope he continues to develop this great extension.
You can grab the tweaked XPI from this site, or if you're the more cautious/curious type, read on for Windows-oriented DIY instructions. It's a trivial change – the only hard part was finding which file to edit!
I'm by no means a JavaScript or XPI expert, but since it was such a minor alteration that preserved existing behaviour, it's unlikely to screw things up. If FireBug doesn't get updated any time soon, I might see what I can do to make it more intuitive to black- or white-list URIs via a preference setting. I'm not nearly well-versed enough in the world of XPIs/XUL to fix any bugs there might be, or add anything more useful, though. I think. We'll see.
First things first
Here's a few things you'll need to make the edit yourself:
- A copy of the original FireBug 0.4 XPI (save it somewhere convenient; don't install it).
- A ZIP utility (I used my personal favourite, 7-Zip).
- Any text editor to make the changes with.
7-Zip: The easy way
If you have 7-Zip (or are willing to get it), the process is a lot less complicated. Once you've saved firebug0.4.xpi, right-click it, and choose 7-Zip > Open archive. First, we need to change a setting to use WordPad instead of Notepad as the default file editor (the file uses UNIX-style line endings, so Notepad won't suffice). Go to Tools > Options... and click the Editor tab. Select WordPad as the default editor, and apply the changes.
I can't tell you where WordPad is on your system, since it seems to vary a lot - a Windows search should give you the path, though. Mine was hiding at C:\Program Files\Windows NT\Accessories\wordpad.exe - it might also be named write.exe, if I recall correctly from older versions of Windows.
Now that we've got a somewhat-capable text editor at our disposal, we can click our way to victory. In the open archive, double-click through to chrome > firebug.jar > content > firebug. You should now see a list of files, firebug.js being one of them. Right-click it, and click Edit.
Follow the steps under Replacing the code, then come back here.
Now that you've replaced the code, save the file, close WordPad, and 7-Zip will prompt you, asking if you want to update the archive with the altered file. Click OK, and close 7-Zip - it should prompt you again, saying that firebug.jar has been modified - click OK again, and 7-Zip will close.
All that's left is to install the hacked version.
The not-so-easy way
If you don't have 7-Zip, and don't want to get it, these instructions are for you.
Once you've saved firebug0.4.xpi, extract it (it's just a ZIP underneath) to its own directory with your favourite ZIP utility; rename it from .xpi to .zip if it won't extract. Change to {xpi-extract-dir}\chrome\ and do the same for firebug.jar as you just did for the XPI.
Now comes the fun part. In the new directory you extracted the .jar to, go to {jar-extract-dir}\content\firebug\ and right-click firebug.js, then click "Open With" > "Choose Program..." and select WordPad from the list. Click OK, and the file should open.
Follow the steps under Replacing the code, then come back here.
Save the file, close WordPad, and go back to your {jar-extract-dir}. Select all the directories in there, and save them to a ZIP-format archive named firebug.jar - overwrite the original in the parent of your {jar-extract-dir}. Delete the {jar-extract-dir}, and change to your {xpi-extract-dir}.
Select everything in your {xpi-extract-dir}, not the directory itself, and add it to a ZIP-format archive, naming it as you please (though I recommend firebug0.4-gmail.xpi).
All that's left is to install the hacked version.
Replacing the code
Find the line starting with FireBug.isWindowInspectable and replace this:
FireBug.isWindowInspectable = function(win)
{
return win.location.href != "about:blank";
}
with this:
FireBug.isWindowInspectable = function(win)
{
// The old code, commented-out:
//return win.location.href != "about:blank";
// The new code:
if ( win.location.href == 'about:blank' )
{
return false;
}
// Check the current browser location, and do the same for Gmail as Joe does for about:blank
else if ( win.location.href.indexOf('mail.google.com') != -1 )
{
return false;
}
// Not about:blank, and not Gmail
else
{
return true;
}
}
Installing the hacked XPI
That's it, editing finished, so all you should need to do now is enter the full file-system path to your modified FireBug XPI in Firefox's address bar, hit enter, and install the hacked version. Restart Firefox, then relax and enjoy the lack of Gmail-induced sluggishness.