Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to access WebKit Javascript error messages



That would be useful, but how can I make WebKit send me the NSDictionary containing the error? In your example, you've created the line number, message and source via an NSDictionary. It would be very useful if WebKit did that automatically.

Mike

--
Mike Hanna
iChat: michaelkhanna(AIM)



On 28-Mar-06, at 11:31 AM, Geoffrey Garen wrote:

Hi Mihkel.

Poking around in WebKit and WebCore, I found that the WebView UI delegate can implement the following undocumented method:

webView:addMessageToConsole:

The delegate method gets called like so:

    NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
        (NSString *)message, @"message",
        [NSNumber numberWithInt: lineNumber], @"lineNumber",
        (NSString *)sourceURL, @"sourceURL",
        NULL];
    [_bridge addMessageToConsole:dictionary];

Since this is undocumented behavior, it's likely to change in the future. But it should be fine to use for debugging purposes.

Geoff

On Mar 28, 2006, at 8:47 AM, Mihkel Tammepuu wrote:


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.