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

Johan Brichau johan at inceptive.be
Sun Aug 7 10:52:25 UTC 2011


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
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110807/afc16066/attachment.htm


More information about the seaside mailing list