[Mono-osx] WebView WindowScriptObject

kjpou kjpou at pt.lu
Fri Feb 25 11:11:37 EST 2011


Clay

There is a sample that demonstrates this.  It is labeled SkinnableApp.  
Take a look at it to see what it does.

On 2/25/11 5:01 PM, Clay Fowler wrote:
> 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?
>
>
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110225/ca74f52e/attachment.html 


More information about the Mono-osx mailing list