The Export attribute indeed fixed the problem. Thanks very much! It looks like there&#39;s still some discussion as to whether or not to do the patch, though?<br><br><div class="gmail_quote">On Fri, Feb 25, 2011 at 9:12 AM, Geoff Norton <span dir="ltr">&lt;<a href="mailto:gnorton@novell.com">gnorton@novell.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word">It appears we dont have the WebScripting protocol bound as a [Model] yet:<div><br></div>
<div><a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/WebKit/Protocols/WebScripting_Protocol/Reference/Reference.html" target="_blank">http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/WebKit/Protocols/WebScripting_Protocol/Reference/Reference.html</a></div>
<div><br></div><div><a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/WebKit/Protocols/WebScripting_Protocol/Reference/Reference.html" target="_blank"></a>If we did you would want to have your NativeMessageReceiver inherit from WebScripting and override the methods.</div>
<div><br></div><div>Would you like to submit a patch to the webkit bindings that does this?</div><div><br></div><div>In the mean time you can use</div><div><br></div><div>[Export (&quot;isSelectorExcludedFromWebScript:&quot;)]</div>
<div>static bool IsSelectorExcluded (Selector s) {</div><div>  return false;</div><div>}<br><div><div><div></div><div class="h5"><div>On 2011-02-25, at 11:01 AM, Clay Fowler wrote:</div><br></div></div><blockquote type="cite">
<div><div></div><div class="h5">Is anyone successfully using WindowScriptObject in WebView to have Javascript communicate with your C# classes in a MonoMac project? I&#39;m trying to do things like this:<div><br></div><div>
...</div><div><br></div><div>webView.WindowScriptObject.SetValueForKey(new NativeMessageReceiver(),new NSString(&quot;NativeMessageReceiver&quot;));</div>
<div><br></div><div>...</div><div><br></div><div><div><span style="white-space:pre-wrap">                </span>NSString handleMessage(NSString messageText)</div><div><span style="white-space:pre-wrap">                </span>{</div>
<div><span style="white-space:pre-wrap">                        </span>Console.Out.WriteLine(&quot;Got message from page [&quot; + messageText + &quot;]&quot;);</div><div><span style="white-space:pre-wrap">                        </span>return new NSString(&quot;OK&quot;);</div>

<div><span style="white-space:pre-wrap">                </span>}</div><div><br></div><div><span style="white-space:pre-wrap">                </span>bool isSelectorExcludedFromWebScript(Selector s)</div><div><span style="white-space:pre-wrap">                </span>{</div>

<div><span style="white-space:pre-wrap">                        </span>return false;</div><div><span style="white-space:pre-wrap">                </span>}</div></div><div><br></div><div>But &quot;isSelectorExcludedFromWebScript&quot; and &quot;handleMessage&quot; never get called.</div>

<div><br></div><div>Any tips?</div></div></div><div class="im">
_______________________________________________<br>Mono-osx mailing list<br><a href="mailto:Mono-osx@lists.ximian.com" target="_blank">Mono-osx@lists.ximian.com</a><br><a href="http://lists.ximian.com/mailman/listinfo/mono-osx" target="_blank">http://lists.ximian.com/mailman/listinfo/mono-osx</a><br>
</div></blockquote></div><br></div></div></blockquote></div><br>