none
Silverlight 5 in WebView (WebKit) on Mac

    Question

  • In my Mac OS X cocoa application i am hosting Silverlight application using WebView control of WebKit. But after installing Silverlight 5 run-time I am facing a few problems. I worked around most of them, but cannot get the text boxes to accept input. The ristriction seems quite similare to the ones Silverlight put when application is fullscreen, but my Silverlight application is not running in fullscreen.

    I want to know the reason why this restriction is applied to Silverlight running in WebView (WebKit), and is there any workround for it.

    Thursday, March 22, 2012 6:46 AM

Answers

  • I have found a way to avoid the problem. It's very strange, but after setting the User-Agent of webview (Webkit) to same as Safari on Mac, Silverlight 5 works perfectly in WebView (Webkit). Even the issues like being unable to access html from silverlight were solved after seting User-Agent.

    Saturday, April 28, 2012 11:53 AM

All replies

  • Hi AbdulMoeed,

    Thanks for your post.

    I am trying to involve someone who familiar with this topic to further look at this issue.

    Best Regards,

    Tuesday, March 27, 2012 2:58 AM
    Moderator
  • WebView isn't a supported browser, but being based on WebKit should work, just like Safari.

    I don't think Silverlight detects the browser and disables/block input based on browser.

    Have you tried to debug the input to see where the OS is routing it to?  Is Silverlight getting the keyboard input?

    Tuesday, March 27, 2012 6:17 PM
  • Silverlight is getting keyboard events, as I am able to move between controls using using Tab. Other keys like arrows and enter also work.

    Another thing that is mentionable is that the keyboard input works perfectly if I have Silverlight 4 runtime installed. So there something new in Silverlight 5 runtime that is causing the problem.

    Wednesday, March 28, 2012 7:24 AM
  • I got another finding that we get the same problem if Silverlight application is running in Chrome on Mac OS X. I know that Chrome on Mac OS X is not offically supported by Microsoft, but I am getting the same problem when I host my application in WebKit framework which is suggested in following artical on MSDN;

    http://msdn.microsoft.com/en-us/library/dd550717%28VS.95%29.aspx#using_silverlight_in_a_browser_control

    Thursday, March 29, 2012 9:40 AM
  • Silverlight plugs into many browsers and works. 

    Can you reproduce with a simple Cocoa app, Webkit and simple SL app?

    Tuesday, April 03, 2012 3:50 PM
  • I have found a way to avoid the problem. It's very strange, but after setting the User-Agent of webview (Webkit) to same as Safari on Mac, Silverlight 5 works perfectly in WebView (Webkit). Even the issues like being unable to access html from silverlight were solved after seting User-Agent.

    Saturday, April 28, 2012 11:53 AM
  • BTW, this is an issue with Silverlight 5 on Chrome too (Silverlight 4 worked)

    There is an end-user friendly extension to allow switching Chrome's user-agent string (since you say that setting to Safari the user-agent fixes it for WebKit):
    http://www.omgchrome.com/user-agent-switcher-extension-for-chrome/

    Otherwise, more tech savvy users can use Chrome's developer tools:
    http://googlesystem.blogspot.gr/2011/12/changing-user-agent-new-google-chrome.html

    can somebody with Chrome/OS-X confirm it works? (that text boxes of Silverlight 5 then receive input OK)


    Microsoft MVP J# 2004-2010, Borland Spirit of Delphi 2001


    Saturday, October 12, 2013 8:06 PM