isilent
isilent
  • 发布:2015-05-19 17:43
  • 更新:2015-05-19 17:43
  • 阅读:6963

使用mui和h5+后依然存在跨域问题的解决方案

分类:HTML5+

将AndroidManifest.xml文件中的android:targetSdkVersion去掉就可以了。

0 关注 分享

要回复文章请先登录注册

isilent

isilent (作者)

原文摘录如下
WebView
Android 5.0 changes the default behavior for your app.

If your app targets API level 21 or higher:
The system blocks mixed content and third party cookies by default. To allow mixed content and third party cookies, use the setMixedContentMode() and setAcceptThirdPartyCookies() methods respectively.
The system now intelligently chooses portions of the HTML document to draw. This new default behavior helps to reduce memory footprint and increase performance. If you want to render the whole document at once, disable this optimization by calling enableSlowWholeDocumentDraw().
If your app targets API levels lower than 21: The system allows mixed content and third party cookies, and always renders the whole document at once.
2015-05-22 17:00
isilent

isilent (作者)

找到原因了,webview在android5.0下有一些默认设置改变了。地址如下,需要科学上网。
http://developer.android.com/about/versions/android-5.0-changes.html#BehaviorWebView
2015-05-22 16:59
isilent

isilent (作者)

好像降低到17以下也可以。
2015-05-19 18:00