java - Marshmallow 上 native WebView 中的 Instagram 链接

标签 java android webview instagram android-6.0-marshmallow

最近我注意到当你尝试调用https://www.instragram.com/时出现了一个非常奇怪的错误。当您的智能手机运行 Android 6 Marshmallow 时,在 WebView 中。

问题是,屏幕始终保持空白,只有中间那个小 instagram 图标 - 看起来像是一个加载屏幕。它看起来像这样:

Blank Instagram Loading Screen

当您在浏览器中查看 Instagram 页面而未启用 JavaScript 时,也会发生这种情况 - 页面似乎无法在没有 JavaScript 的情况下加载。奇怪的是,我在我的 WebView 中做了以下设置:

 WV_Downloader.getSettings().setJavaScriptEnabled(true);
 WV_Downloader.getSettings().setDomStorageEnabled(true);
 WV_Downloader.getSettings().setBlockNetworkImage(false);
 WV_Downloader.getSettings().setLoadsImagesAutomatically(true);

在更高版本的 Android 上它可以完美运行,为什么它不能在 Android 6 上运行?没有错误日志,只有一些正常的 Chrome 输出(我认为)不会导致这样的行为:

I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'worker-src'."
I/chromium: [INFO:CONSOLE(16)] "The key "viewport-fit" is not recognized and ignored."
I/chromium: [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'entry_data' of undefined"
W/chromium: [WARNING:keycode_converter.cc(91)] empty code string
I/chromium: [INFO:CONSOLE(0)] "The source list for Content Security Policy directive 'script-src' contains an invalid source: ''report-sample''. It will be ignored."
I/chromium: [INFO:CONSOLE(0)] "The source list for Content Security Policy directive 'script-src' contains an invalid source: ''strict-dynamic''. It will be ignored."
I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'worker-src'.

我在互联网上找不到此行为的解释。有人可以解释一下,这可能是什么原因?提前致谢!

最佳答案

您需要更新Android系统上的webview包。

关于java - Marshmallow 上 native WebView 中的 Instagram 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59108595/

相关文章:

android - WebView LoadUrl() 在后台使用 asynctask -

安卓NDK : custom WebView compiling from source

java.lang.RuntimeException : Unable to start activity ComponentInfo for register and login 错误

java - 使用字符串引用数组列表的自定义类成员

java - 如何修复未使用微调器自定义适配器中的代码选中复选框的问题?

android - 如何启动内置​​录音机应用程序?

javascript - 如何在 Android 中的 MHTML 文件上应用 javaScript 函数?

java - 如何在java中读取XML样式的文本文件?

java - 如何检查数组中的除数

java - 有没有一种方法可以将复杂的 JSON 转换为对象而不创建 POJO?