简体   繁体   中英

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 browser 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM