On Nov 24, 4:31 pm, Manoj <[EMAIL PROTECTED]> wrote:
> Hi,
>
> In my sample extension I have the following line:
>
> FBL.ns(function() { with (FBL) {
The FBL.ns() part stores the code until initialization runs.
The function() { ... } part encapsulates the objects.
The with(FBL) part makes the functions of FBL appear to be local
functions to your code.
>
> All is fine until I detach firebug in which case I'm seeing the
detach? as in open firebug in new window?
> following exception:
>
> "FTS0: fbs.onError with this.showStackTrace=true and
> this.breakOnErrors=true kind
> =Uncaught-Exception msg=ReferenceError: FBL is not [EMAIL PROTECTED]://
> testExtension/
> content/test.js:13.0"
>
You must have a script tag test.js in a window that does not have
lib.js included.
If you followed Honza's example, you should have created an overlay
that had your code. If you now open Firebug in a new window, it
possible that the overlay failed.
> Frankly, I don't have a good handle on how this namespace magic works,
> other than we are encapsulating each file in a seperate object so it
> is not exposed globally and the only global object is FBL.
Actually there are other globals, eg Firebug, that the code adds
properties to.
>
> Does this imply that the architecture does not allow for sharing
> functionality (e.g. network monitoring) between the various modules
> and extensions?
Lots of sharing in Firebug. Not a lot of documentation about
sharing...
> for e.g. Is there an API which allows me to add a listener so the net
> module can keep my extension updated of the traffic it's already
> monitoring OR do I have to duplicate that functionality in my module.
Firebug monitors all net traffic now. This is new code in 1.3.
Firebug.NetMonitor.addListener looks promising, but Honza will have to
say more.
>
> Thanks,
> Manoj
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---