【问题标题】:android phonegap external wordpress image not loading in index.htmlandroid phonegap 外部 wordpress 图像未在 index.html 中加载
【发布时间】:2020-04-16 12:09:44
【问题描述】:

我已经厌倦了在 stackoverflow 中进行谷歌搜索和搜索,但没有一个解决方案对我有用。

我有一个我开发的静态应用程序。现在在 android 中执行,现在在 android 模拟器中,真实设备图像没有从外部 url 加载。

在这方面的任何帮助将不胜感激。

注意: 我已经安装了白名单插件 我的 html 文件中已经有这个下面的元标记

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; media-src *; img-src * filesystem: data:">

我已添加:

 <access origin="*" />
    <allow-navigation href="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />

在我的 res/xml/config.xml 中

让我知道我还缺少什么,以便显示来自http://website/image.png 的图像

谢谢, 阿山阿里

【问题讨论】:

  • 线索:当我将目标 sdkversion 设置为 28 时,图像会损坏,但是当我将其设置为低于 28 时,图像会被加载

标签: android cordova phonegap whitelist


【解决方案1】:

好的,问题已解决。

为了加载外部 url,您必须输入 https:// 协议。现在从 api 级别 28 开始,您必须为图片输入 https://

警告:不要放很多高质量的图片,因为这也会让你的应用崩溃。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-14
    • 2017-11-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多