[webkit-dev] An oddity with windowScriptObject:setValue and apple events
grimm at xqdev.com
Sun Feb 1 14:34:29 PST 2009
This may sound very strange (it does to me), but I've been stumped by
this problem for weeks now so I figured I'd ask the list.
I'm working on embedding WebKit into an existing Mac application that
exposes an API. The API gives me a CGrafPtr to render into. So to
get WebKit into the window I simply call:
HIViewRef webView, contentView;
WindowRef window = GetWindowFromPort(myCGrafPtr);
Which works fantastically. I then try to expose some new functions to
nativeView = HIWebViewGetWebView(webView);
[[nativeView windowScriptObject] setValue:Metadata forKey:@"metadata"];
However, here's crux of my problem. Whenever one of these functions
apple events that the main application has registered on the window
become unusable. For example, if you were to execute the following
tell application "ApplicationWithWebKit" to set user to "foobar"
It would return with an error of -1728: Can't get <reference>. If you
called it would execute correctly.
Anyone have any thoughts on what is going on here?
More information about the webkit-dev