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 <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.jsdebugger |
|---|---|
| Message-ID | <[email protected]> |
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: > [email protected] 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. >