I have a cocoa plugin embedded on an html page. This page also defines a javascript function in the header. I'd like to programmatically call this javascript function from my plugin. This was easy enough under IE/firefox/chrome plugins. How does this work under cocoa/safari? I think the problem comes down to accessing the pages webview and getting the webScriptObject. Once I have this I can use "callWebScriptMethod" af follows:
[scriptObject callWebScriptMethod:@"sayHello" withArguments:[NSArray arrayWithObjects:"@chris"]];
However, I don't know how to access the webview of the page hosting my plugin. My plugin is defined as "WASafariPluginView : NSView " and I don't see anything in its object hierarchy I can use to obtain the "parent" webview.
Thanks,