blog
discuss
releases
documentation

Archive for February, 2009

1.3: Viewports on Script Panel

Thursday, February 19th, 2009

All of the discussion about Bespin’s choice of  Canvas for source code editing, reminded me to talk about one of the invisible new features of Firebug 1.3: the Script panel is now implemented with a ‘viewport’.  By that I mean that only the visible lines of the source are rendered.

If you have 40kloc in a Javascript file (yes those extJS files do that!), the pre-1.3 Firebug would try to render all 40,000 lines in to HTML. Each line would require about 10 DOM elements, plus they have attributes.  That means we are up to around a million nodes.  So as soon as you try to view that monster JS file, Firefox starts to burn CPU while you sit and watch. With the viewport solution we only build 20 lines, a factor of more than 1,000 less!

Of course the viewport has to be updated dynamically for scrolling and other movement.  If you use 1.3 you will see that the Script panel is not as smooth or fast as one would like.  1.4 adds a number of improvements mostly around avoiding extraneous updates.

Right now the 1.4 script panel is fast enough, if not blazing. That makes it unlikely that we would invest in a canvas alternative until we examined the performance issues and determined that the problem was related to HTML rather than some other issue in Firebug.  Another consideration for a large code like Firebug is complexity: the viewport code is harder to maintain but I guess not as hard as a canvas solution.

jjb

Tabs UP!

Tuesday, February 17th, 2009

Check this out: Curtis Bartley has  re-organized the Firebug UI to put tabs on top:

Curtis Bartley's prototype Firebug UI with tabs on top

So now we need to know: is this major reorg of the UI going to cause users problems? Please try his prototype and let us know.

Firebug Internals: Firebug’s private namespaces.

Monday, February 16th, 2009

Wladimir Palant’s great post about using namespaces in XUL overlays gives me another chance to explain one aspect of Firebug source that throws some folks off at first.  All the Firebug source files have the following construct:

FBL.ns(function() { with (FBL) {const Cc = Components.classes;
const Ci = Components.interfaces;
...more constants...

Firebug.Debugger = ....

...more code...

}});

What’s that stuff about? Well this code creates a giant private namespace for Firebug. The outer function FBL.ns() calls the anonymous function defined within it like this:

fn.apply({});

So the body of the file is run with ‘this‘ set to an empty and anonymous object, rather than the default, ‘window‘.  So, presto, no name conflicts like the one’s Wladmir points out.  We then can expose just the objects we want, mostly by attaching them to 'Firebug‘, an object defined in firebug.js as a property of the window ‘top‘.

The other thing going on is the  ‘with (FBL) {}‘, which injects all of lib.js into the namespace. Thus all of these utility functions can be called directly, just as if they were built in to the environment.

This namespace wrapper is a bit strange at first, but you quickly forget about it and concentrate on the code in the middle, secure in the knowledge that you are immune from the naming conflicts.

jjb

Firebug Releases: Firebug 1.3.3b3 — The Lucky Threes Release

Monday, February 16th, 2009

getfirebug.com has Firebug 1.3.3b3.Included since b2 are net panel fixes around fb-cache issues.

robcee said something about prizes for the triple triple….

Firebug Releases: 1.3.3b1

Tuesday, February 10th, 2009

A couple of problems from fixes in 1.3.1b3 were discovered when 1.3.2 went into wider distribution. Now getfirebug.com has 1.3.3b1.  Includes a fix for issue 1456, and for an bug reported on the Firebug newsgroup.  We hope this is the end of 1.3…

Firebug Releases: 1.3.1 … er 1.3.2

Friday, February 6th, 2009

robcee sent Firebug 1.3.2 off to addons.mozilla.org yesterday. This version includes fixes for the Firebug’s activation, several fixes for the command line, as well as file locking and net panel fixes. Honza has been working with the babelzilla Firebug team to improve the localizations as well. (We are up to 22 locales by now).

At the end of 1.3.1 we discovered that the new Script panel does not work on Firefox 2 because we don’t get a scroll event we expected. Since Firefox 2 isn’t being maintained and since many improvements in Firebug 1.3 depend upon Firefox 3, we decided to change the minVersion requirement in Firebug 1.3 to Firefox 3.0. That’s the only change between Firebug 1.3.1 and  Firebug 1.3.2.

jjb

Firebug Feature? Tagged ‘firebugged’

Tuesday, February 3rd, 2009

For Firebug 1.4 we want to try yet again to improve the enabled-panels user experience. The 1.2/1.3 solution is too complex for users and too hard for us to maintain.

One idea is to turn on the resource-hungry features only for web pages that Firebug is open on.  If you are debugging, you have your site selected and you have Firebug on. If you wander off an read your email, you don’t have Firebug up. Firebug would be on when you are debugging and off when not. Makes a lot of sense (even if it is not as easy to implement as it sounds).

Part of implementing this is to remember what pages you had Firebug open on. And one way to implement this remembering thing is the Firefox Places tagging API. By tagging pages as “firebugged” when you open Firebug on them, we can check this tag when you open that URL later.  Maybe you don’t like us to mess with your tags, I don’t know.  As part of the trade off,  you can type ‘firebugged’ in to the location bar and get a list of all pages you use Firebug on:

firebuggedtags

That seems pretty cool to me.  (Note that the top link here is a page I opened Firebug, then closed it, seems like Firefox is confused).

Still investigating this idea, comments welcome.

jjb

Firebug Releases: 1.3.1b4

Tuesday, February 3rd, 2009

getfirebug.com has Firebug 1.3.1b4.  This is a candidate for 1.3.1 on addons.mozilla.org.

Give it a spin. Next stop will be 1.4b1 we hope…

jjb