[Mono-osx] WebView WindowScriptObject

Clay Fowler paul.clay.fowler at gmail.com
Fri Feb 25 11:01:13 EST 2011


Is anyone successfully using WindowScriptObject in WebView to have
Javascript communicate with your C# classes in a MonoMac project? I'm trying
to do things like this:

...

webView.WindowScriptObject.SetValueForKey(new NativeMessageReceiver(),new
NSString("NativeMessageReceiver"));

...

NSString handleMessage(NSString messageText)
{
Console.Out.WriteLine("Got message from page [" + messageText + "]");
return new NSString("OK");
}

bool isSelectorExcludedFromWebScript(Selector s)
{
return false;
}

But "isSelectorExcludedFromWebScript" and "handleMessage" never get called.

Any tips?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110225/c2d8255a/attachment.html 


More information about the Mono-osx mailing list