WPF WebBrowser Control .Net 3.5 SP1 and higher in XBAP application
Should I expect any problems with WebBrowser control, if WPF will be deployed as XBAP in a browser or it should work straightforwardly ? The reason I am asking this question is that WebBrowser control is added to Silverlight 4 , but works only in out of brow开发者_开发技巧ser mode. I am primarily interested in HTML given to WebBrowser as a string ( generated in the application ). Can I do everything which was possible in Windows Forms : calling JavaScript in this html from WPF application and vice versa calling C# methods from JavaScript.
From the docs:
WebBrowser is bound by the security constraints of the WPF application that is hosting the WebBrowser ... When WebBrowser is hosted by a partial-trust WPF application (an XBAP, for example), WebBrowser can only host documents that are Site Of Origin application data files. For more information, see Windows Presentation Foundation Application Resource, Content, and Data Files.
(emphasis added)
So it should work straightforwardly if it is displaying pages from the same site as the XBAP came from, but it won't be able to navigate to arbitrary sites.
精彩评论