You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Shazron Abdullah (Created) (JIRA)" <ji...@apache.org> on 2012/04/18 09:52:43 UTC

[jira] [Created] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc)

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

        

[jira] [Commented] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc)

Posted by "Chris Brody (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13256453#comment-13256453 ] 

Chris Brody commented on CB-535:
--------------------------------

Is it possible to put something in the AppDelegate.h (or .m) in the generated code?
                
> 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

        

[jira] [Commented] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc)

Posted by "Chris Brody (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13256452#comment-13256452 ] 

Chris Brody commented on CB-535:
--------------------------------

Is it possible to put something in the AppDelegate.h (or .m) in the generated code?
                
> 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

        

[jira] [Issue Comment Edited] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc)

Posted by "Shazron Abdullah (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] [Commented] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc)

Posted by "Shazron Abdullah (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13256456#comment-13256456 ] 

Shazron Abdullah commented on CB-535:
-------------------------------------

No, it has to go in your app's MainViewController. I showed how to add it above, if you are using the edge/mainline code. If you are using 1.6.x or lower, add this function to your MainViewController.m instead, to override the createGapView function:

{code}
- (void) createGapView
{
    CGRect webViewBounds = self.view.bounds;
    webViewBounds.origin = self.view.bounds.origin;
	
    if (!self.webView) 
	{
        self.webView = [[[CDVDebugWebView alloc] init] autorelease];
		self.webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
		
		[self.view addSubview:self.webView];
		[self.view sendSubviewToBack:self.webView];
		
		self.webView.delegate = self;
    }
}
{code}

You can then #define this whole block to enable/disable this feature.
                
> 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

        

[jira] [Updated] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc)

Posted by "Chris Brody (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Brody updated CB-535:
---------------------------

    Comment: was deleted

(was: Is it possible to put something in the AppDelegate.h (or .m) in the generated code?)
    
> 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

        

[jira] [Commented] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc)

Posted by "Patrick Mueller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13256537#comment-13256537 ] 

Patrick Mueller commented on CB-535:
------------------------------------

Coupla things:

1) We're including a header from Apple in this commit.  Please make sure you augment the relevant LICENSE and NOTICE files appropriately.  IANAL, but I _believe_ you will have to augment the top-level LICENSE file, the same kind of way I did with weinre.  See [1].

2) Do we really need to include the header file?  I don't think we do. Or could we create a simpler header file from scratch - if we need a header file - to get around the LICENSE requirement, which is a small pain in the rear.

3) The URL referenced in the description reference Mac OS X bits, not iOS bits.  Specifically, WebView vs UIWebView.  Does using WebView stuff just work in iOS, because WebView is magically mapped, or related (via subclassing, whatever) to UIWebView?  Something about this smells wrong, or at least ... just fragile and therefore stinky.  I guess I'm asking: does this code actually work?  Note that we've seen things like iWebInspector which work on the simulator, but not on real devices.  This may be one of those things.  Also, which versions of iOS does this actually work on?

4) We should really come up with a bullet-proof method of ensure that people don't accidently ship the "debug" version.  I don't have a good answer here, but will note that I've seen folks deploy web apps with weinre enabled - which is a VERY BAD THING.  It should somehow be glaringly obvious (perhaps just by default) that your app is running in "debug" mode.  Once we do this, BTW, we can start providing all kinds of other diagnostic bits, only when you're running in debug mode.  Perhaps we should open a new issue on "allow a glaringly obvious debug enablement mode" or something?

[1] https://github.com/apache/incubator-cordova-weinre/blob/master/LICENSE#L208
                
> 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

        

[jira] [Commented] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc)

Posted by "Shazron Abdullah (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13256425#comment-13256425 ] 

Shazron Abdullah commented on CB-535:
-------------------------------------

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

        

[jira] [Resolved] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc)

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah resolved CB-535.
---------------------------------

    Resolution: Fixed

Fix commit - http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/5d2e8049
                
> 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

        

[jira] [Commented] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc)

Posted by "Shazron Abdullah (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13257109#comment-13257109 ] 

Shazron Abdullah commented on CB-535:
-------------------------------------

Issues 1 and 4 are addressed in my latest commits: https://github.com/shazron/incubator-cordova-ios/commits/cdvdebugview/

iOS 4 and 3 testing have not been addressed yet.
                
> 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

        

[jira] [Commented] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc)

Posted by "Shazron Abdullah (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13256818#comment-13256818 ] 

Shazron Abdullah commented on CB-535:
-------------------------------------

@Patrick

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: 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