【问题标题】:Enabled Mode Compatibily in Webview UWP Win 8.1Webview UWP Win 8.1 中兼容的启用模式
【发布时间】:2019-08-07 04:21:57
【问题描述】:

是否可以强制我的页面在 UWP Windows 8.1 应用程序的 Web 视图中以 Internet Explorer 8 兼容模式显示?

今天我的网络应用程序通过 POST 接收请求并显示仅与 Internet Explorer 8 兼容的内容:(

代码网页视图:

<WebView x:Name="MyWebView" Source="" />  

代码 C# UWP:

string url = "https://www.exampleapp.net/app/";  

string postBody = string.Format("keyvalue=param1&keyvalue2={0}", someValue);  

StringContent postBodyEncoded = new StringContent(postBody, Encoding.UTF8, "application/x-www-form-urlencoded");  

HttpClientHandler handler = new HttpClientHandler();  

handler.AllowAutoRedirect = true;

HttpClient client  = new HttpClient(handler);     

HttpResponseMessage res = await client.PostAsync(url, postBodyContent);  

var content = await res.Content.ReadAsStringAsync(); 

MyWebView.NavigateToString(content); 

我的页面:

<html>
   <head>
      <meta http-equiv="X-UA-Compatible" content="IE=8" />
      <title>My Web Page</title>
      <script src="https://www.exampleapp.net/app/script.js"></script>       
  </head>
   <body>
      <p>Dynamic Content.</p>
   </body>
</html>

【问题讨论】:

    标签: c# webview uwp


    【解决方案1】:

    是否可以强制我的页面以 Internet Explorer 8 兼容性显示

    派生自official document,您无法强制页面以 Internet Explorer 8 兼容模式显示。

    如果需要,您可以将内容保存为 html 文件并使用边缘浏览器打开它。并设置 Edge 兼容模式如下。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-25
      • 2017-11-04
      • 1970-01-01
      • 2015-03-14
      • 2016-02-18
      • 2016-08-19
      • 2018-05-25
      相关资源
      最近更新 更多