incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (Commented) (JIRA)" <>
Subject [jira] [Commented] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc)
Date Wed, 18 Apr 2012 18:52:42 GMT


Shazron Abdullah commented on CB-535:


1) Will do.

2) I haven't started to trim the fat from the header, but - we can do that I suppose, I haven't
spent time on it yet.

3) UIWebView uses the WebView somewhere in it's hierarchy, yes. This code works, I've tested
it on an iOS 5 device and simulator. I haven't tested it on iOS 4 or 3 - I believe this delegate
only works on WebKit2 based WebViews, and iOS 3 probably is based on the original WebKit,
but we're abandoning support for iOS 3 anyway and we can document that this won't work in
iOS 3.

4) We could do it like the Location Services permission in iOS, where it pops up a permission
dialog - but users will just have an OK button before they can proceed. Annoying, yes, but
it may be necessary. This will run each time the app runs.

On another note which may be of interest to you wrt weinre -- what the other parts of the
delegate (that I don't use) suggest, we could build a debugger with breakpoints possibly...
(didExecuteStatement, willEnterCallFrame, willLeaveCallFrame, etc)
> Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with
line numbers, etc)
> ------------------------------------------------------------------------------------------------------------
>                 Key: CB-535
>                 URL:
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: Master
>            Reporter: Shazron Abdullah
>            Assignee: Shazron Abdullah
>             Fix For: 1.7.0
> It's possible from tests I did with my proof of concept based on this header:
> You would then set the delegate on a UIWebView subclass that overrode this selector:
> {code}
> - (void)webView:(id)sender didClearWindowObject:(id)windowObject forFrame:(WebFrame*)frame
> {
>     [sender setScriptDebugDelegate:myWebScriptDebugDelegate]; // e.g
> }
> {code}
> webView:didClearWindowObject:forFrame:
> Of course this will involve private methods (not kosher by Apple), and might not be baked
in (but included in the source that is installed), and we could provide instructions on how
to explicitly include and enable it and output warnings if it is used.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message