次の方法で共有


WebBrowser control for Windows Phone 8

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Windows Phone provides a WebBrowser control that is based on the desktop browser. The WebBrowser control for Windows Phone OS 7.1 is based on Internet Explorer 9, and the WebBrowser control for Windows Phone 8 is based on Internet Explorer 10. Because of this, there are slight differences in the appearance of apps that use the WebBrowser control running on Windows Phone 7.5 compared to phones that run on Windows Phone 8.

The WebBrowser control can be embedded in an app and used for a number of purposes that include, but are not limited to, the following:

Script is disabled in the WebBrowser control by default. Set the IsScriptEnabled property to true if you want to enable scripting in your control. You can then call scripts using the InvokeScript method. The ScriptNotify event occurs when JavaScript in the WebBrowser control passes a string to managed code.

Warning

When you create a WebBrowser control in XAML, you must specify a value for the P:System.Windows.FrameworkElement.Name property for that control so that the Windows Phone Capability Detection Tool can properly detect and grant the right capabilities for your app. For more info about the Windows Phone Capability Detection Tool, see How to determine app capabilities for Windows Phone 8.

You can also use the GetCookies(WebBrowser) method of the WebBrowserExtensions class to retrieve a collection of cookies from a website that you can use in future web requests. For more info about working with cookies, see How to get and set cookies for Windows Phone 8.

Sample app

To view a sample app that uses the WebBrowser control, see How to create your first app for Windows Phone 8.

See Also

Other Resources

WebBrowser control design guidelines for Windows Phone