开发者

WPF WebBrowser Control .Net 3.5 SP1 and higher in XBAP application

开发者 https://www.devze.com 2022-12-14 04:44 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消