debugging javascript within browsers is hard when the browser show the response on a single line

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

debugging javascript within browsers is hard when the browser show the response on a single line

Nick
Hi,

I wonder if other people suffer from the same problem when debugging javascript:

Seaside's response is viewed by browsers as a string without line-breaks.
Normally this isn't a problem as the browser "pretty-prints" the output when inspecting the html.
However when debugging javascript, either inline or within a file-library the script debugger (I'm currently using Mac Safari) shows the output as a single line - which makes it impossible to interpret any javascript generated errors ("syntax error: line 1"!!) or to set meaningful breakpoints.

I've discovered that calling #withInternetLineEndings on the file-library string results in browsers interpreting the line-endings as expected.

Locally when I'm debugging I've created a class derived from WAHtmlDocument, which overrides #nextPutAll:
WAHtmlDocumentWithInternetLineEndings>>#nextPutAll: aString
    super nextPutAll: aString withInternetLineEndings

and I modify WAFileLibrary>>#handle: modifying the WAResponse>>#document: to:
document: ((self documentForFile: fileName) withInternetLineEndings)

Is there a better solution? Are there easier workarounds, browser settings etc.

I created an issue for this problem: http://code.google.com/p/seaside/issues/detail?id=675

Though if there are easy workaround that I've missed, I'd be delighted to close the issue.

Thanks

Nick

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: debugging javascript within browsers is hard when the browser show the response on a single line

Johan Brichau-2
Hi Nick,

In the latest Chrome, you can choose to 'de-obfuscate source' in the context menu of the script tab in the developer tools.
That solves it mostly for me.

Johan

On 07 Aug 2011, at 12:40, Nick Ager wrote:

Hi,

I wonder if other people suffer from the same problem when debugging javascript:

Seaside's response is viewed by browsers as a string without line-breaks.
Normally this isn't a problem as the browser "pretty-prints" the output when inspecting the html.
However when debugging javascript, either inline or within a file-library the script debugger (I'm currently using Mac Safari) shows the output as a single line - which makes it impossible to interpret any javascript generated errors ("syntax error: line 1"!!) or to set meaningful breakpoints.

I've discovered that calling #withInternetLineEndings on the file-library string results in browsers interpreting the line-endings as expected.

Locally when I'm debugging I've created a class derived from WAHtmlDocument, which overrides #nextPutAll:
WAHtmlDocumentWithInternetLineEndings>>#nextPutAll: aString
    super nextPutAll: aString withInternetLineEndings

and I modify WAFileLibrary>>#handle: modifying the WAResponse>>#document: to:
document: ((self documentForFile: fileName) withInternetLineEndings)

Is there a better solution? Are there easier workarounds, browser settings etc.

I created an issue for this problem: http://code.google.com/p/seaside/issues/detail?id=675

Though if there are easy workaround that I've missed, I'd be delighted to close the issue.

Thanks

Nick
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: debugging javascript within browsers is hard when the browser show the response on a single line

Nick
Hi Johan,
 
In the latest Chrome, you can choose to 'de-obfuscate source' in the context menu of the script tab in the developer tools.
That solves it mostly for me.

Hmm I'm using Chrome version 13.0.782.107 which doesn't seem to include 'de-obfuscate source' option and it seems it's missing for others: http://www.google.com/support/forum/p/Chrome/thread?tid=648734bd79c17a69&hl=en

Pior to the 'de-obfuscate source'  option - did you have any other work-arounds?

Nick


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: debugging javascript within browsers is hard when the browser show the response on a single line

Johan Brichau-2
Hi Nick,

Ah yes...
It's not missing. It's now called 'pretty print' and is the '{ }' button in the bottom bar of dev tool.

Prior to that, I had no workarounds, but most (90%) of our javascript code is contained in external files, which show nicely in the scripts pane (when not minified).

Johan

On 07 Aug 2011, at 13:11, Nick Ager wrote:

Hi Johan,
 
In the latest Chrome, you can choose to 'de-obfuscate source' in the context menu of the script tab in the developer tools.
That solves it mostly for me.

Hmm I'm using Chrome version 13.0.782.107 which doesn't seem to include 'de-obfuscate source' option and it seems it's missing for others: http://www.google.com/support/forum/p/Chrome/thread?tid=648734bd79c17a69&hl=en

Pior to the 'de-obfuscate source'  option - did you have any other work-arounds?

Nick

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: debugging javascript within browsers is hard when the browser show the response on a single line

Johan Brichau-2
But apart from that, I think it would be a great option to be able to choose for 'minified' or 'non minified' generated javascript in Seaside…

On 07 Aug 2011, at 13:18, Johan Brichau wrote:

Hi Nick,

Ah yes...
It's not missing. It's now called 'pretty print' and is the '{ }' button in the bottom bar of dev tool.

Prior to that, I had no workarounds, but most (90%) of our javascript code is contained in external files, which show nicely in the scripts pane (when not minified).

Johan

On 07 Aug 2011, at 13:11, Nick Ager wrote:

Hi Johan,
 
In the latest Chrome, you can choose to 'de-obfuscate source' in the context menu of the script tab in the developer tools.
That solves it mostly for me.

Hmm I'm using Chrome version 13.0.782.107 which doesn't seem to include 'de-obfuscate source' option and it seems it's missing for others: http://www.google.com/support/forum/p/Chrome/thread?tid=648734bd79c17a69&hl=en

Pior to the 'de-obfuscate source'  option - did you have any other work-arounds?

Nick

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: debugging javascript within browsers is hard when the browser show the response on a single line

Nick
In reply to this post by Johan Brichau-2
Hi Johan,
 
Ah yes...
It's not missing. It's now called 'pretty print' and is the '{ }' button in the bottom bar of dev tool.

Brilliant - the '{ }' button is also in Safari 

Thanks

Nick

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: debugging javascript within browsers is hard when the browser show the response on a single line

patmaddox
In reply to this post by Johan Brichau-2
and the HTML too...is there an option to pretty-print HTML in Seaside? I know I can use the browser for it, but sometimes I don't trust that the browser is showing me the exact HTML that the server generated.


On Aug 7, 2011, at 5:20 AM, Johan Brichau wrote:

But apart from that, I think it would be a great option to be able to choose for 'minified' or 'non minified' generated javascript in Seaside…

On 07 Aug 2011, at 13:18, Johan Brichau wrote:

Hi Nick,

Ah yes...
It's not missing. It's now called 'pretty print' and is the '{ }' button in the bottom bar of dev tool.

Prior to that, I had no workarounds, but most (90%) of our javascript code is contained in external files, which show nicely in the scripts pane (when not minified).

Johan

On 07 Aug 2011, at 13:11, Nick Ager wrote:

Hi Johan,
 
In the latest Chrome, you can choose to 'de-obfuscate source' in the context menu of the script tab in the developer tools.
That solves it mostly for me.

Hmm I'm using Chrome version 13.0.782.107 which doesn't seem to include 'de-obfuscate source' option and it seems it's missing for others: http://www.google.com/support/forum/p/Chrome/thread?tid=648734bd79c17a69&hl=en

Pior to the 'de-obfuscate source'  option - did you have any other work-arounds?

Nick

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: debugging javascript within browsers is hard when the browser show the response on a single line

Philippe Marschall
2011/8/9 Pat Maddox <[hidden email]>:
> and the HTML too...is there an option to pretty-print HTML in Seaside? …

No there is not. AFAIK there was once but it was dropped because it
would affect the layout of the site because of significant withe space
(which has quite tricky rules). We do support pretty printing the HTML
of individual components using the halos though.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: debugging javascript within browsers is hard when the browser show the response on a single line

Esteban A. Maringolo
Did Seaside ever got this pretty-print feature back?
Reply | Threaded
Open this post in threaded view
|

Re: debugging javascript within browsers is hard when the browser show the response on a single line

sebastianconcept@gmail.co
Chrome itself has it, hasn’t it?



On Jul 3, 2014, at 4:35 PM, Esteban A. Maringolo <[hidden email]> wrote:

> Did Seaside ever got this pretty-print feature back?
>
>
>
>
> --
> View this message in context: http://forum.world.st/debugging-javascript-within-browsers-is-hard-when-the-browser-show-the-response-on-a-single-line-tp3724683p4766414.html
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: debugging javascript within browsers is hard when the browser show the response on a single line

Esteban A. Maringolo

Maybe as an extension. I'll take a look.

El jul 3, 2014 4:41 PM, "Sebastian Sastre" <[hidden email]> escribió:
Chrome itself has it, hasn’t it?



On Jul 3, 2014, at 4:35 PM, Esteban A. Maringolo <[hidden email]> wrote:

> Did Seaside ever got this pretty-print feature back?
>
>
>
>
> --
> View this message in context: http://forum.world.st/debugging-javascript-within-browsers-is-hard-when-the-browser-show-the-response-on-a-single-line-tp3724683p4766414.html
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: debugging javascript within browsers is hard when the browser show the response on a single line

sebastianconcept@gmail.co
click on the {} thing (at bottom left)




On Jul 3, 2014, at 8:33 PM, Esteban A. Maringolo <[hidden email]> wrote:

Maybe as an extension. I'll take a look.

El jul 3, 2014 4:41 PM, "Sebastian Sastre" <[hidden email]> escribió:
Chrome itself has it, hasn’t it?



On Jul 3, 2014, at 4:35 PM, Esteban A. Maringolo <[hidden email]> wrote:

> Did Seaside ever got this pretty-print feature back?
>
>
>
>
> --
> View this message in context: http://forum.world.st/debugging-javascript-within-browsers-is-hard-when-the-browser-show-the-response-on-a-single-line-tp3724683p4766414.html
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: debugging javascript within browsers is hard when the browser show the response on a single line

Esteban A. Maringolo
2014-07-03 21:15 GMT-03:00 Sebastian Sastre <[hidden email]>:
> click on the {} thing (at bottom left)

Yep. It does it.

Thank you!

Esteban A. Maringolo
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside