venkman and firebug loading source code for a page without sending the params that were sent when the browser made the call

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

venkman and firebug loading source code for a page without sending the params that were sent when the browser made the call

eyal.herlin
i'm sorry for the multi-post but i was just advised that
netscape.public.mozilla.jsdebugger moved to mozilla.dev.apps.js-
debugger.
also i have already posted this message as a forward but failed to see
it in the group so this is the second post.
sorry for the hassle.

hi all,

i am debugging a site with venkman and firebug.
it seems the debuggers try to get their own copy of the source from
the
web server (instead of taking the browser's copy as i would expect)
and
call it without the params it needs (which the browser itself did
send
when it loaded the page).
i am interested to know if this behaviour is by design. it would seem
strange to me if it were so, since different params might mean
totally
different source sent to the browser.
(in case it matters the page on which i saw this problem handles a
multipart/form-data form submition.)


thanks to all in advance,
eyal.

_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Reply | Threaded
Open this post in threaded view
|

Re: venkman and firebug loading source code for a page without sending the params that were sent when the browser made the call

James Ross
[hidden email] wrote:

> i am debugging a site with venkman and firebug.
> it seems the debuggers try to get their own copy of the source from
> the
> web server (instead of taking the browser's copy as i would expect)
> and
> call it without the params it needs (which the browser itself did
> send
> when it loaded the page).
> i am interested to know if this behaviour is by design. it would seem
> strange to me if it were so, since different params might mean
> totally
> different source sent to the browser.
> (in case it matters the page on which i saw this problem handles a
> multipart/form-data form submition.)

I can't speak for FireBug, but I assume it's fundamentally the same
problem. The low-level debug API that Venkman and FireBug use (called
JSD) reports only the file name (URL/URI) of the source for the code.
This presents a problem - how to get the source [1].

The normal behaviour of both is to fetch the URL given, which is fine
for your average static HTML or JavaScript file. As you found, it's less
than sufficient for dynamically generated and form-result pages.

In Venkman, you can turn on Pretty Print with Ctrl-P, the toolbar item,
or from the View menu. Pretty Print will show you JavaScript code
reconstructed from the compiled code being executed; this means that it
wont be your bracing style and wont have any comments, but it will be
the right code. The is usually sufficient.

Hope that helps.

--
James Ross <[hidden email]>
ChatZilla and Venkman Developer

[1] In theory, it could get the browser's cached copy, but there are
issues; what if the same URL is loaded twice, and via DOM/JS they are
different? What about secure pages that aren't cached by the browser? Etc.
_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Reply | Threaded
Open this post in threaded view
|

Re: venkman and firebug loading source code for a page without sending the params that were sent when the browser made the call

eyal.herlin
thanks alot. that cleared it up for me.

On Feb 21, 7:12 pm, James Ross <[hidden email]> wrote:

> [hidden email] wrote:
> > i am debugging a site with venkman and firebug.
> > it seems the debuggers try to get their own copy of the source from
> > the
> > web server (instead of taking the browser's copy as i would expect)
> > and
> > call it without the params it needs (which the browser itself did
> > send
> > when it loaded the page).
> > i am interested to know if this behaviour is by design. it would seem
> > strange to me if it were so, since different params might mean
> > totally
> > different source sent to the browser.
> > (in case it matters the page on which i saw this problem handles a
> > multipart/form-data form submition.)
>
> I can't speak for FireBug, but I assume it's fundamentally the same
> problem. The low-level debug API that Venkman and FireBug use (called
> JSD) reports only the file name (URL/URI) of the source for the code.
> This presents a problem - how to get the source [1].
>
> The normal behaviour of both is to fetch the URL given, which is fine
> for your average static HTML or JavaScript file. As you found, it's less
> than sufficient for dynamically generated and form-result pages.
>
> In Venkman, you can turn on Pretty Print with Ctrl-P, the toolbar item,
> or from the View menu. Pretty Print will show you JavaScript code
> reconstructed from the compiled code being executed; this means that it
> wont be your bracing style and wont have any comments, but it will be
> the right code. The is usually sufficient.
>
> Hope that helps.
>
> --
> James Ross <[hidden email]>
> ChatZilla and Venkman Developer
>
> [1] In theory, it could get the browser's cached copy, but there are
> issues; what if the same URL is loaded twice, and via DOM/JS they are
> different? What about secure pages that aren't cached by the browser? Etc.


_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Reply | Threaded
Open this post in threaded view
|

Re: venkman and firebug loading source code for a page without sending the params that were sent when the browser made the call

John Bandhauer
In reply to this post by James Ross
FWIW...

The JSD C API does have a whole subsystem for tracking and managing
source text: http://lxr.mozilla.org/seamonkey/source/js/jsd/jsdebug.h#501

When JSD was written for Navigator 4 I added hooks into the old html
parser to feed it copies of html and js source when pages where loaded
while JSD was active. This source storage was exposed to the (old)
debugger via a Java API layer that used this C API. Other embeddings of
JS in that era also had schemes for feeding source text to JSD.

It seems that when rginda created Venkman and added the XPCOM API to JSD
he did not use this scheme. I don't know what factors made him opt to
get source into the debugger in a different way.

John.

James Ross wrote:

> [hidden email] wrote:
>> i am debugging a site with venkman and firebug.
>> it seems the debuggers try to get their own copy of the source from
>> the
>> web server (instead of taking the browser's copy as i would expect)
>> and
>> call it without the params it needs (which the browser itself did
>> send
>> when it loaded the page).
>> i am interested to know if this behaviour is by design. it would seem
>> strange to me if it were so, since different params might mean
>> totally
>> different source sent to the browser.
>> (in case it matters the page on which i saw this problem handles a
>> multipart/form-data form submition.)
>
> I can't speak for FireBug, but I assume it's fundamentally the same
> problem. The low-level debug API that Venkman and FireBug use (called
> JSD) reports only the file name (URL/URI) of the source for the code.
> This presents a problem - how to get the source [1].
>
> The normal behaviour of both is to fetch the URL given, which is fine
> for your average static HTML or JavaScript file. As you found, it's less
> than sufficient for dynamically generated and form-result pages.
>
> In Venkman, you can turn on Pretty Print with Ctrl-P, the toolbar item,
> or from the View menu. Pretty Print will show you JavaScript code
> reconstructed from the compiled code being executed; this means that it
> wont be your bracing style and wont have any comments, but it will be
> the right code. The is usually sufficient.
>
> Hope that helps.
>
_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Reply | Threaded
Open this post in threaded view
|

Re: venkman and firebug loading source code for a page without sending the params that were sent when the browser made the call

John J Barton
In reply to this post by James Ross
James Ross wrote:

> [hidden email] wrote:
>> i am debugging a site with venkman and firebug.
>> it seems the debuggers try to get their own copy of the source from
>> the
>> web server (instead of taking the browser's copy as i would expect)
>> and
>> call it without the params it needs (which the browser itself did
>> send
>> when it loaded the page).
>> i am interested to know if this behaviour is by design. it would seem
>> strange to me if it were so, since different params might mean
>> totally
>> different source sent to the browser.
>> (in case it matters the page on which i saw this problem handles a
>> multipart/form-data form submition.)
>
> I can't speak for FireBug, ...

Firebug (re-)loads context.window.location.href then re-loads everything
it finds via
  win.document.documentElement.getElementsByTagName("script");

In my simple test values past "?" on the url are sent to the server.

All of this seems wrong: the source ought to be captured when
onScriptCreated is called. Maybe that is what the code Bandhauer
references does.

John.
_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Reply | Threaded
Open this post in threaded view
|

Re: venkman and firebug loading source code for a page without sending the params that were sent when the browser made the call

James Ross
John J. Barton wrote:
> All of this seems wrong: the source ought to be captured when
> onScriptCreated is called. Maybe that is what the code Bandhauer
> references does.

I expect it's really all about efficiency; there is little we can do
about it currently, since no code (that I can find) even considers
sending the source text to JSD, meaning it can't possibly be exposed to
debuggers.

I don't think it would be worthwhile trying to resurrect the source
interfaces jband referred to, at least not from my position. I already
have bits and pieces of code that could potentially make Venkman load
the right source with no extra work from the user. Still a way to go,
though.

--
James Ross <[hidden email]>
ChatZilla and Venkman Developer
_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger