[ 
https://issues.apache.org/jira/browse/CB-535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13256425#comment-13256425
 ] 

Shazron Abdullah edited comment on CB-535 at 4/18/12 10:31 AM:
---------------------------------------------------------------

Added working support in my branch: 
https://github.com/shazron/incubator-cordova-ios/tree/cdvdebugview
(the files are there, but you will have to explicitly add the files to your 
project - CordovaLib/Classes/debugview, drag all 3 files into your project)

Still WIP, initial commit: 
https://github.com/shazron/incubator-cordova-ios/commit/6b80b91789497394733a58df617f72c6cec4da78

If you are using the mainline, to use this, in your app's MainViewController.m 
you would override:
{code}

- (CDVCordovaView*) newCordovaViewWithFrame:(CGRect)bounds
{
    return [[CDVDebugWebView alloc] initWithFrame:bounds];
}
{code}

The user can switch to between this and calling the superclass' method, based 
on .plist setting, or #define
                
      was (Author: shazron):
    Added working support in my branch: 
https://github.com/shazron/incubator-cordova-ios/tree/cdvdebugview

Still WIP, initial commit: 
https://github.com/shazron/incubator-cordova-ios/commit/6b80b91789497394733a58df617f72c6cec4da78

If you are using the mainline, to use this, in your app's MainViewController.m 
you would override:
{code}

- (CDVCordovaView*) newCordovaViewWithFrame:(CGRect)bounds
{
    return [[CDVDebugWebView alloc] initWithFrame:bounds];
}
{code}

The user can switch to between this and calling the superclass' method, based 
on .plist setting, or #define
                  
> Add a way to log JavaScript exceptions, parse errors, and get JS stack frame 
> events (with line numbers, etc)
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: CB-535
>                 URL: https://issues.apache.org/jira/browse/CB-535
>             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: 
> http://opensource.apple.com/source/WebKit/WebKit-6531.9/mac/WebView/WebScriptDebugDelegate.h
> 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: 
> https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/WebKit/Protocols/WebFrameLoadDelegate_Protocol/Reference/Reference.html
> 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: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to