Is there something I'm doing in correctly or is my expectation
incorrect.
Cheers,
Wink Saville
Your expectation makes sense, but as far as I know venkman is an
extension to firefox and hence is loaded after the firefox starts.
I think with FF3 something better could be done: I remember some
discussion of an "app" command line argument which puts firefox into a
kind of XULRunner mode.
I am working on Chromebug to bring Firebug to extensions. If it could
load first with "app" then control the loading of extensions then
extension startup could be debugged.
John.
Venkman starts up first.
- You can add debugger; statements to your extension's code to have it
stop there.
- You could be really fast in setting up breakpoints.
- You could create breakpoints when you feel like it while Firefox is up
normally, and tell Venkman to load them automatically (check "Save
Break/Watch settings" in the File menu).
~ Gijs
> Venkman starts up first.
Hi Gijs, do you know how Venkman gets in first?
> - You can add debugger; statements to your extension's code to have it
> stop there.
You might have to run Venkman once and exit before this will work.
Venkman has to set some bit to start JSD on startup and it can't do that
until its had control once. Or so I guess from the name of the method,
jsd.initAtStartup.
> - You could be really fast in setting up breakpoints.
> - You could create breakpoints when you feel like it while Firefox is up
> normally, and tell Venkman to load them automatically (check "Save
> Break/Watch settings" in the File menu).
...and then exit and restart (in case that wasn't clear).
>
> ~ Gijs
I guess he more means "the venkman window" which if it loads minus the
firefox window (am taking that for granted in this thread) then yes it
definately comes up first.
If he means "before the services of said extension" than no, they
initialize first.
~Justin Wood (Callek)
Because "firefox.exe -venkman" causes the venkman command line handler
to run which opens a venkman window and this happens before the firefox
window opens?
>
> If he means "before the services of said extension" than no, they
> initialize first.
I guessing that "firefox.exe -venkman" means that at least the command
line handlers have to run, and thus the components in each extension
would have to be registered to see if they have command line handlers.
Therefore at least we compile extensions/*/components/*.js and call all
the NSGetModule() and run command line handlers? In the order given by
that funky m- rule? Is that stuff what you mean by services?
>
> ~Justin Wood (Callek)
My desire was to have venkman start before my extension as it appeared
there was something wrong with my xul file (see below). But apparently
that isn't possible.
Anyway for those interested, I resolved my problem. Turns out that the
MacOS version of FF doesn't seem to handle the <menubar> at line 10 & 28
and if present no buttons are displayed. This xul does work on PC and Linux:
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
3 <overlay id="sample"
4 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
5 <script type="application/x-javascript" src="chrome://sparkrocket/content/ll.js"/>
6 <script type="application/x-javascript" src="chrome://sparkrocket/content/ajax_queue.js"/>
7 <script type="application/x-javascript" src="chrome://sparkrocket/content/sr.js"/>
8 <script type="application/x-javascript" src="chrome://sparkrocket/content/prefutils.js"/>
9 <toolbaritem id="urlbar-container">
10 <menubar position="1" id="SparkRocketMenuBar">
11 <!--style="width: 50px; height: 32px" style attribute for buttons -->
12 <button type="menu"
13 id="SparkMenu"
14 image="chrome://sparkrocket/content/spark-16x16.png"
15 label="Sparks">
16 <menupopup id="SparkMenuPopup">
17 <menuitem label="SparkRocket" oncommand="sr_goto('http://www.sparkrocket.com');"/>
18 </menupopup>
19 </button>
20 <button type="menu"
21 id="RocketMenu"
22 image="chrome://sparkrocket/content/rocket-16x16.png"
23 label="Rockets">
24 <menupopup id="RocketMenuPopup">
25 <menuitem label="No friends to target yet"/>
26 </menupopup>
27 </button>
28 </menubar>
29 </toolbaritem>
30 </overlay>
If delete the menubar tags and use position in the buttons I get what I
want, two buttons as the first items in the url-container:
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
3 <overlay id="sample"
4 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
5 <script type="application/x-javascript" src="chrome://sparkrocket/content/ll.js"/>
6 <script type="application/x-javascript" src="chrome://sparkrocket/content/ajax_queue.js"/>
7 <script type="application/x-javascript" src="chrome://sparkrocket/content/sr.js"/>
8 <script type="application/x-javascript" src="chrome://sparkrocket/content/prefutils.js"/>
9 <toolbaritem id="urlbar-container">
10
11 <!--style="width: 50px; height: 32px" style attribute for buttons -->
12 <button position="1" type="menu"
13 id="SparkMenu"
14 image="chrome://sparkrocket/content/spark-16x16.png"
15 label="Sparks">
16 <menupopup id="SparkMenuPopup">
17 <menuitem label="SparkRocket" oncommand="sr_goto('http://www.sparkrocket.com');"/>
18 </menupopup>
19 </button>
20 <button position="2" type="menu"
21 id="RocketMenu"
22 image="chrome://sparkrocket/content/rocket-16x16.png"
23 label="Rockets">
24 <menupopup id="RocketMenuPopup">
25 <menuitem label="No friends to target yet"/>
26 </menupopup>
27 </button>
28
29 </toolbaritem>
30 </overlay>
You could try "-chrome chrome://venkman/content" instead.
Well that seems to start the debugger and not FF,
but now how do I run FF from the debugger?
Wink
I find going to the console panel (where you see raw messages from
Venkman, and can ask it about various values) and typing in
"window.open()" works nicely. :)
firefox -chrome chrome://venkman/content
and then executed "window.open()" as you suggested.
My code loaded and I set a future breakpoint on the
first statement in the file. I then checked
"Save Break/Watch Settings On Exit" in
the file menu and then exited firefox.
I then ran a second time with the same command:
firefox -chrome chrome://venkman/content
Then did "window.open()" a second time and we dropped
back into the debugger at my break point at the top of
the file. This was exactly what I wanted.
This is exactly what I wanted, hopefully this helps
someone else in the future.
THANKS Alex!
Wink