After looking through the WebScriptObject implementation, I don't
think there's an easy way to access exceptions from Objc. Both -
evaluateWebScript and -callWebScriptMethod discard exceptions and
return 'undefined' instead. You may want to file an enhancement
request about that.
The best work-around I can suggest is to wrap your scripts inside a
function with a try/catch block, and have the function return the
exception information you're interested in. You can do that in the
script files themselves, or in the call to -evaulateWebScript. The
latter would work like this:
On Apr 12, 2006, at 11:25 AM, John Anderson wrote:
I'm trying to write an automated test tool which loads a page and
executes a series of JavaScripts. However, I can't figure out how
to know when an exception is thrown.
How can I catch JavaScript exceptions in my WebKit Obj-C app code?
John
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden