Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Starting firefox -venkman

2 views
Skip to first unread message

Wink Saville

unread,
Nov 19, 2007, 12:48:11 AM11/19/07
to dev-apps-j...@lists.mozilla.org
From what I understand starting firefox -venkman should only start
the debugger and not the browser UI, thus allowing the debugging
of extension loading. When I do this both the debugger and the
browser UI is started, not what I expected.

Is there something I'm doing in correctly or is my expectation
incorrect.

Cheers,

Wink Saville

John J Barton

unread,
Nov 19, 2007, 2:28:51 PM11/19/07
to

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.

Gijs Kruitbosch

unread,
Nov 19, 2007, 2:38:28 PM11/19/07
to Wink Saville

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

John J. Barton

unread,
Nov 19, 2007, 9:07:20 PM11/19/07
to
Gijs Kruitbosch wrote:

> 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

Justin Wood (Callek)

unread,
Nov 20, 2007, 12:49:18 AM11/20/07
to
John J. Barton wrote:
> Gijs Kruitbosch wrote:
>
>> Venkman starts up first.
>
> Hi Gijs, do you know how Venkman gets in first?
>

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)

John J. Barton

unread,
Nov 20, 2007, 1:27:25 AM11/20/07
to
Justin Wood (Callek) wrote:
> John J. Barton wrote:
>> Gijs Kruitbosch wrote:
>>
>>> Venkman starts up first.
>>
>> Hi Gijs, do you know how Venkman gets in first?
>>
>
> 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.

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)

Wink Saville

unread,
Nov 20, 2007, 12:17:45 PM11/20/07
to Justin Wood (Callek), dev-apps-j...@lists.mozilla.org
> _______________________________________________
> dev-apps-js-debugger mailing list
> dev-apps-j...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-apps-js-debugger

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>


Alex Vincent

unread,
Nov 28, 2007, 2:06:55 PM11/28/07
to

You could try "-chrome chrome://venkman/content" instead.

Wink Saville

unread,
Dec 2, 2007, 1:37:52 PM12/2/07
to Alex Vincent, dev-apps-j...@lists.mozilla.org
> _______________________________________________
> dev-apps-js-debugger mailing list
> dev-apps-j...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-apps-js-debugger
>
Alex,

Well that seems to start the debugger and not FF,
but now how do I run FF from the debugger?

Wink

Alex Vincent

unread,
Dec 2, 2007, 1:42:13 PM12/2/07
to
Wink Saville wrote:

> Alex Vincent wrote:
>> You could try "-chrome chrome://venkman/content" instead.
>> _______________________________________________
>> dev-apps-js-debugger mailing list
>> dev-apps-j...@lists.mozilla.org
>> https://lists.mozilla.org/listinfo/dev-apps-js-debugger
>>
> Alex,
>
> 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. :)

Wink Saville

unread,
Dec 2, 2007, 2:32:17 PM12/2/07
to Alex Vincent, dev-apps-j...@lists.mozilla.org
That worked beautifully, I wanted to set a break point
on the first line of my code that executed after it loaded,
so I ran:

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

0 new messages