How to debug userscripts?

42 views
Skip to first unread message

Rainer Schmid

unread,
Mar 13, 2008, 4:56:11 AM3/13/08
to flui...@googlegroups.com
Hi,

when I tried Fluid I started to love it almost immediately. I can't
really tell you why since at first I just used it to replace some
bookmarks with .apps. But now I start to discover the userscripts and
start understanding the power of it.

But when developing a new userscript, I have a somewhat hard time to
debug them since I don't get much errors reported (sometimes
JavaScript errors popup in Konsole). The rest of the time I try to
work myself through the code with putting alerts all over the place.

I haven't done any real JavaScript development so I wonder what is the
best way to develop and debug userscripts. Yesterday I fetched Drosera
(a JavaScript debugger from the WebKit project) and it seems to work
with Fluid. Is this a way to go or are there other options (Drosera
seems quite heavy-weight, but alert() is a bit annoying)?

Rainer

todd.dit...@gmail.com

unread,
Mar 13, 2008, 2:20:10 PM3/13/08
to fluidapp
Hi Rainer, thanks for trying out Fluid so thoroughly! I do recommend
Drosera, as it's a great tool. Also, note that Fluid SSBs include a
basic JavaScript Console similar to Safari's. to open:

command-shift-J

or main menu:

Window -> JavaScript Console

I need to put some more work into this console... its not super-solid
at the moment, unfortunately. But it will be helpful. Note that
window.console.log() is not yet supported in Fluid SSBs. However, this
is:

window.fluid.log(anyObject) ;

This will appear in the system log, so you can open Console.app to see
it.

Stay tuned, as I'm hoping to find time soon to make the Userscript
and JavaScript development story much strong in Fluid soon.

Todd

Yashka Oreza

unread,
Apr 28, 2008, 4:44:32 PM4/28/08
to fluidapp
I get the following error in my console when I try to use the
window.fluid.log() method:

4/28/08 3:43:49 PM FluidInstance[32291] Attempt to access privileged
method from non-privileged context

Though this is, of course, being called from a userscript.

On Mar 13, 1:20 pm, todd.ditchend...@gmail.com wrote:
> Hi Rainer, thanks for trying out Fluid so thoroughly! I do recommend
> Drosera, as it's a great tool. Also, note that Fluid SSBs include a
> basic JavaScript Console similar to Safari's. to open:
>
> command-shift-J
>
> or main menu:
>
> Window -> JavaScript Console
>
> I need to put some more work into this console... its not super-solid
> at the moment, unfortunately. But it will be helpful. Note that
> window.console.log() is not yet supported in Fluid SSBs. However, this
> is:
>
> window.fluid.log(anyObject) ;
>
> This will appear in the systemlog, so you can open Console.app to see

Todd Ditchendorf

unread,
Apr 29, 2008, 2:25:19 AM4/29/08
to flui...@googlegroups.com
Hi Yashka,

you can now use:

wondow.console.log(obj)

just like in safari. i suggest using that all the time. i am going to deprecate and remove fluid.log()

thanks,
todd
Reply all
Reply to author
Forward
0 new messages