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

TinyJSD - a JavaScript Debugger for Privileged Code

49 views
Skip to first unread message

Patrick Brunschwig

unread,
Jan 30, 2013, 12:42:08 PM1/30/13
to
Ever since Venkman is not working anymore I was frustrated because
debugging my extension got very tedious. I have decided to do something
about and started to write a little debugger: TinyJSD.

The tool serves to debug privileged code, such as extensions and the
applications itself. It only supports chrome:, resource: and file: URIs.
It runs on Firefox, Thunderbird and SeaMonkey, and in principle in any
Xulrunner application. The tool is not yet complete (whatever "complete"
means), but it's in a state that allows to debug software. Main features
include setting breakpoints; step-by-step code execution, inspecting
variables and execution of code in the context of the script being
debugged (scratchpad).

The XPI and documentation are available from:
<https://sourceforge.net/u/pbrunschwig/tinyjsd/>

Have fun!
-Patrick



gNeandr

unread,
Jan 30, 2013, 3:52:01 PM1/30/13
to
Great work! Tested on FX 18.0.1 and it works for extension!
1000 Thanks will probably be my favorit moz debugger.

Is there a blog/wiki to follow you with this?

Günter


Two notes:
-- the font type/size in "Source Code" box should be smaller

-- the docu page throws a bunch of errors, mainly about CSS, but also:

Error: ReferenceError: $ is not defined
Source file: http://sourceforge.net/u/pbrunschwig/tinyjsd/wiki/Home/
Line: 403
----------
Error: ReferenceError: $ is not defined
Source file: http://sourceforge.net/u/pbrunschwig/tinyjsd/wiki/Home/
Line: 568
----------
Error: downloadable font: download not allowed (font-family: "Pictos"
style:normal weight:normal stretch:normal src index:1): content blocked
source:
http://a.fsdn.com/allura/nf/1359568826/_ew_/theme/sftheme/css/fonts/sftheme/pictos-web.woff
Source code:
@font-face { font-family: "Pictos"; src: local("☺"),
url("http://a.fsdn.com/allura/nf/1359568826/_ew_/theme/sftheme/css/fonts/sftheme/pictos-web.woff")
format("woff"),
url("http://a.fsdn.com/allura/nf/1359568826/_ew_/theme/sftheme/css/fonts/sftheme/pictos-web.ttf")
format("truetype"),
url("http://a.fsdn.com/allura/nf/1359568826/_ew_/theme/sftheme/css/fonts/sftheme/pictos-web.svg")
format("svg"); }

Patrick Brunschwig

unread,
Jan 31, 2013, 2:34:46 AM1/31/13
to
On 30.01.13 21:52, gNeandr wrote:
> On 30.01.2013 18:42, Patrick Brunschwig wrote:
>> Ever since Venkman is not working anymore I was frustrated because
>> debugging my extension got very tedious. I have decided to do something
>> about and started to write a little debugger: TinyJSD.
>>
>> The tool serves to debug privileged code, such as extensions and the
>> applications itself. It only supports chrome:, resource: and file: URIs.
>> It runs on Firefox, Thunderbird and SeaMonkey, and in principle in any
>> Xulrunner application. The tool is not yet complete (whatever "complete"
>> means), but it's in a state that allows to debug software. Main features
>> include setting breakpoints; step-by-step code execution, inspecting
>> variables and execution of code in the context of the script being
>> debugged (scratchpad).
>>
>> The XPI and documentation are available from:
>> <https://sourceforge.net/u/pbrunschwig/tinyjsd/>
>>
>> Have fun!
>> -Patrick
>>
>>
>>
> Great work! Tested on FX 18.0.1 and it works for extension!
> 1000 Thanks will probably be my favorit moz debugger.
>
> Is there a blog/wiki to follow you with this?

Yes, I'll shortly set up a blog.

[...]

> Two notes:
> -- the font type/size in "Source Code" box should be smaller
>
> -- the docu page throws a bunch of errors, mainly about CSS, but also:

It's a sourceforge page; I don't have any influence to anything except
the content :-/

-Patrick

Neil

unread,
Jan 31, 2013, 5:18:08 AM1/31/13
to
Patrick Brunschwig wrote:

>Ever since Venkman is not working anymore I was frustrated because debugging my extension got very tedious. I have decided to do something about and started to write a little debugger: TinyJSD.
>
>
OK, so I admit that I use so-called printf debugging these days, and
haven't really been keeping up with developments. I therefore don't know
whether any of the following alternatives were possible, let alone
reasonable, and I would be interested in knowing what led you to choose
the path you did:

* Retrofit the new debugging APIs into Venkman
* Make it possible to use Firefox's remote chrome debugger to debug
other applications
* Make Firefox's remote chrome debugger work in-app and port it to
work with other applications

--
Warning: May contain traces of nuts.

Jeff Griffiths

unread,
Jan 31, 2013, 10:32:23 AM1/31/13
to Patrick Brunschwig, dev-ext...@lists.mozilla.org
Very cool!

Had you tested at all on OS X, or with SDK-based add-ons? I wanted to
try this but it locked up the entire browser. What is perhaps unusual
about my profile is that all of my add-ons are restartless, and every
one except adblock+ is SDK-based. SDK-based add-ons might be difficult
to debug because all scripts run in their own sandbox.

I tried debugging an SDK-based add-on in a profile with only TinyJSD and
that add-on enabled, and when I clicked on a commonJS module all I got
was 'loading failed':

https://dl.dropbox.com/u/1212936/Screen%20Shot%202013-01-31%20at%207.29.52%20AM.png

Performance was better with fewer add-ons installed, but still not great.

cheers, Jeff
> _______________________________________________
> dev-extensions mailing list
> dev-ext...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-extensions
>

Patrick Brunschwig

unread,
Feb 1, 2013, 2:35:25 AM2/1/13
to
On 31.01.13 16:32, Jeff Griffiths wrote:
> Very cool!
>
> Had you tested at all on OS X, or with SDK-based add-ons? I wanted to
> try this but it locked up the entire browser. What is perhaps unusual

My main platform is OS X. But I don't know about SDK-Addons, I didn't
check any of them so far. That's one of the next steps on my todo list.

Performance is one of the biggest problems all JavaScript debuggers are
faced with -- the overhead is huge because every singe JS-statement is
checked.

> about my profile is that all of my add-ons are restartless, and every
> one except adblock+ is SDK-based. SDK-based add-ons might be difficult
> to debug because all scripts run in their own sandbox.


>
> I tried debugging an SDK-based add-on in a profile with only TinyJSD and
> that add-on enabled, and when I clicked on a commonJS module all I got
> was 'loading failed':
>
>
https://dl.dropbox.com/u/1212936/Screen%20Shot%202013-01-31%20at%207.29.52%20AM.png

Well, TinyJSD won't load that URL. It's an image, and TinyJSD only works
with local URLs...

-Patrick

Patrick Brunschwig

unread,
Feb 1, 2013, 2:38:04 AM2/1/13
to
Well, my first intention was to fix Venkman. But when I started to try
to find out what's wrong I realized that I don't know enough about the
JSD APIs. So I started to explore them, and at one point I had half a
debugger running. So I continued on this -- and forgot about Venkman ... ;-)

-Patrick

Philip Chee

unread,
Feb 1, 2013, 5:23:56 AM2/1/13
to
On 01/02/2013 15:38, Patrick Brunschwig wrote:

> Well, my first intention was to fix Venkman. But when I started to try
> to find out what's wrong I realized that I don't know enough about the
> JSD APIs. So I started to explore them, and at one point I had half a
> debugger running. So I continued on this -- and forgot about Venkman ... ;-)

Perhaps we can remind you about Venkman every now and then?

Phil (there is no Dana)

--
Philip Chee <phi...@aleytys.pc.my>, <phili...@gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.

gNeandr

unread,
Feb 1, 2013, 6:13:17 AM2/1/13
to
On 01.02.2013 11:23, Philip Chee wrote:
> On 01/02/2013 15:38, Patrick Brunschwig wrote:
>
>>... So I continued on this -- and forgot about Venkman ... ;-)
>
> Perhaps we can remind you about Venkman every now and then?
>
> Phil (there is no Dana)
>
Great Phil,
please update to this newsgroup about Venkman improvements, like crash
fixes in Thunderbird, early loading of extension code .. just to spot
two of the pains :>

Günter

Neil

unread,
Feb 1, 2013, 6:41:00 AM2/1/13
to
That's a screen shot of TinyJSD not loading dotjs.js ...

Patrick Brunschwig

unread,
Feb 3, 2013, 3:49:01 AM2/3/13
to
On 01/31/2013 04:32 PM, Jeff Griffiths wrote:
> Very cool!
>
> Had you tested at all on OS X, or with SDK-based add-ons? I wanted to
> try this but it locked up the entire browser. What is perhaps unusual
> about my profile is that all of my add-ons are restartless, and every
> one except adblock+ is SDK-based. SDK-based add-ons might be difficult
> to debug because all scripts run in their own sandbox.
>
> I tried debugging an SDK-based add-on in a profile with only TinyJSD and
> that add-on enabled, and when I clicked on a commonJS module all I got
> was 'loading failed':
>
> https://dl.dropbox.com/u/1212936/Screen%20Shot%202013-01-31%20at%207.29.52%20AM.png

I fixed this (tried with dotjs) and published a new version (0.1.2): I
have seen some more occurrences of the same error, which I'll have to
look into.

-Patrick
0 new messages