On Aug 4, 4:21 pm, Gabriel Mariani <
gmariani...@gmail.com> wrote:
> I'm a bit confused on how I need to update my extension to work with Firebug
> 1.8. My extension (Flashbug) currently supports 1.6/1.7 but doesn't in 1.8.
> I understand that some globals have been replaced, but if I replace those
> they will no longer work in 1.6, 1.7 correct? It would be nice if Firebug
> versions didn't overlap so I could just target a specific version of Firefox
> and not worry about checking for specific versions of Firebug.
I think you can do the check simply in your code:
For example:
var currentContext;
if (typeof(FirebugContext) != "undefined")
currentContext = FirebugContext;
else
currentContext = Firebug.currentContext;
Instead of testing Firebug version, you should detect existing
features (just like it's recommended for cross-browser feature
detection).
> I also had a
> question about HOW i should update my extension. What i mean is, do I need
> to do a complete overhaul to match the AMD style you guys decided to go with
> in order for it to work?
Not in Firebug 1.8, Firebug 1.8 still supports extensions based on XUL
overlays.
> I know you are supporting some legacy, but should I
> start migrating to that style yet or wait til 1.9? And if I should wait til
> 1.9, how do I access some API that's only in a specific module now? The
> error console has tons of errors but it's only pertaining to Firebug scripts
> not my extensions so I don't know what I need to update to get it working.
Using the Firebug module loader and AMD style in Firebug extensions is
already supported, but not well documented. Anyway, you can see
HelloWorld example here:
http://code.google.com/p/fbug/source/browse/#svn%2Fexamples%2Ffirebug1.8%2Fhelloworld
(it also includes support for restartless extension, which is not
interesting in this particular case).
We need to improve the AMD related APIs for extensions yet, provide
examples/docs/tutorial which should happen in Firebug 1.9
> My extension makes extensive use of NetMonitor.Utils and only hunting
> through Firebug itself did I find it was replaced by NetUtils. But do I have
> to include that module to get it to work or can I still use
> NetMonitor.Utils? The wiki isn't very clear on this fact or complete so I'm
> left pretty confused. Any help would be appreciated on which path I need to
> take to update my extension moving forward.
You should be able to load any existing Firebug module in your
extension as a dependency. See this file (part of the Hello World
example):
http://code.google.com/p/fbug/source/browse/examples/firebug1.8/helloworld/chrome/content/main.js
In your case it would look like as follows:
define([
"firebug/lib/trace",
"firebug/net/netUtils",
"helloworld/myPanel"
],
function(FBTrace, NetUtils) {
/* ... */
});
In order to make progress on your extension, please create a new bug
report and we can step-by-step solve all problems you are facing when
using AMD in your extension.
I can also create a better HelloWorld example that's focused on how to
use AMD in Firebug extensions.
Honza