Firebug 1.10 Extension Architecture

From FirebugWiki

(Difference between revisions)
Jump to: navigation, search
(Created page with "Firebug 1.10 introduces support for bootstrapped extensions and also new APIs for extensions. This page is intended to document these new APIs. == Concepts == Firebug 1.10 suppo...")
(XUL Based Extensions)
Line 14: Line 14:
* A [http://www.softwareishard.com/blog/firebug-tutorial/extending-firebug-hello-world-part-i/ tutorial] is available
* A [http://www.softwareishard.com/blog/firebug-tutorial/extending-firebug-hello-world-part-i/ tutorial] is available
-
Important thing related to XUL based extension is to understand scope. First see the next diagram.
+
Important thing related to XUL based extension is to understand scopes. First see the next diagram.
 +
[[Image:Firebug-scopes.png]]
 +
There are two scopes that are relevant to extension development.
 +
 +
* '''Browser Window''': use this scope when overlaying browser UI. Your extension might want to append new button into Firefox toolbar or create, create a new menu items, etc.
 +
* '''Firebug UI''': this is the scope mostly used by Firebug extension, use it whenever you want to extend Firebug. Your extension might want to crate a new Firebug panel, etc.
 +
 +
Note that Firebug 1.10 introduces a new feature called ''Delayed Load''. This means that overlays applied to <code>chrome://firebug/content/firebugOverlay.xul</code> are loaded the first time the Firebug UI is actually opened by the user. This way loading doesn't slow down Firefox start up time.
=== Bootstrapped Extensions ===
=== Bootstrapped Extensions ===

Revision as of 16:41, 9 February 2012

Firebug 1.10 introduces support for bootstrapped extensions and also new APIs for extensions. This page is intended to document these new APIs.

Contents

Concepts

Firebug 1.10 supports three concepts that can be used when developing an extension:

  • XUL Based Extensions
  • Bootstrapped Extensions
  • AMD Extensions

XUL Based Extensions

XUL represents an old school technique and Firebug has always supported this ways of extending. The main difference from the bootstrapped extensions is that you need to restart the browser whenever your extension is installed or uninstalled.

Important thing related to XUL based extension is to understand scopes. First see the next diagram.

Firebug-scopes.png

There are two scopes that are relevant to extension development.

  • Browser Window: use this scope when overlaying browser UI. Your extension might want to append new button into Firefox toolbar or create, create a new menu items, etc.
  • Firebug UI: this is the scope mostly used by Firebug extension, use it whenever you want to extend Firebug. Your extension might want to crate a new Firebug panel, etc.

Note that Firebug 1.10 introduces a new feature called Delayed Load. This means that overlays applied to chrome://firebug/content/firebugOverlay.xul are loaded the first time the Firebug UI is actually opened by the user. This way loading doesn't slow down Firefox start up time.

Bootstrapped Extensions

Support for bootstrapped extensions has been introduced in Firebug 1.10.


AMD Extensions

This technique (Asynchronous Module Definition) is related to how code of your extension is organized. It can be used together with XUL based or bootstrapped extensions.

Personal tools