Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 87B929850 for ; Wed, 18 Apr 2012 18:53:09 +0000 (UTC) Received: (qmail 26604 invoked by uid 500); 18 Apr 2012 18:53:09 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 26540 invoked by uid 500); 18 Apr 2012 18:53:09 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 26464 invoked by uid 99); 18 Apr 2012 18:53:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Apr 2012 18:53:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Apr 2012 18:53:03 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 3E0E83A1877 for ; Wed, 18 Apr 2012 18:52:42 +0000 (UTC) Date: Wed, 18 Apr 2012 18:52:42 +0000 (UTC) From: "Shazron Abdullah (Commented) (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <750931616.2033.1334775162255.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <481137951.36310.1334735563032.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CB-535) Add a way to log JavaScript exceptions, parse errors, and get JS stack frame events (with line numbers, etc) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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