- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我遇到了白名单插件不适用于 Android 的问题,这会导致每次 AJAX 调用都返回 404,这会破坏我的应用程序,因为我无法连接到我的后端服务器。 iOS 工作正常,因为它不需要这个插件,如果我检查插件列表 http://build.phonegap.com它确实出现了,这里可能发生了什么?
这是我的config.xml(这个项目顺便用了XDK,所以我的config.xml是用它建的:
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android" android-versionCode="7" ios-CFBundleVersion="7" version="1.0.7" id="com.project.app" >
<!-- This file was generated by the Intel XDK Cordova Package Build tool. -->
<name>PROJECT NAME</name>
<description>PROJECT DESCRIPTION</description>
<author>COMPANY</author>
<content src="index.html"/>
<preference name="android-build-tool" value="gradle" />
<platform name="android" >
<allow-intent href="tel:*"/>
<allow-intent href="geo:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="http://app.project.com/"/>
<allow-intent href="maps:*"/>
<allow-intent href="http://maps.google.com/"/>
<access origin="*"/>
<access origin="http://app.project.com/"/>
<access origin="tel:*"/>
</platform>
<platform name="ios" >
<allow-intent href="tel:*"/>
<allow-intent href="geo:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="http://app.project.com/"/>
<allow-intent href="https://www.google.com/maps"/>
<allow-intent href="https://*.google.*"/>
<access origin="*"/>
<access origin="http://app.project.com/"/>
<access origin="tel:*"/>
</platform>
<preference name="phonegap-version" value="cli-6.5.0" />
<preference name="xwalkMultipleApk" value="false" />
<plugin name="cordova-plugin-device" spec="1.1.6"/>
<plugin name="ionic-plugin-keyboard" spec="2.2.1"/>
<plugin name="phonegap-plugin-push" spec="1.4.3"/>
<plugin name="cordova-plugin-inappbrowser" spec="1.7.1"/>
<plugin name="cordova-plugin-splashscreen" spec="4.0.3"/>
<plugin name="cordova-plugin-statusbar" spec="2.2.3"/>
<plugin name="cordova-plugin-whitelist" spec="https://github.com/apache/cordova-plugin-whitelist"/> <!-- If available via Cordova registry; consider changing to an NPM reference. -->
<platform name="android" >
<preference name="android-minSdkVersion" value="16"/>
<preference name="android-targetSdkVersion" value="23"/>
<preference name="android-installLocation" value="auto"/>
<preference name="android-signed" value="true"/>
<preference name="AndroidLaunchMode" value="singleTop"/>
</platform>
<platform name="ios" >
<preference name="deployment-target" value="9.0"/>
<preference name="ios-configuration" value="production"/>
</platform>
<splash platform="android" src="package-assets/splashs/ANDROID/320x426.png" density="ldpi" width="320" height="426" orientation="portrait"/>
<splash platform="android" src="package-assets/splashs/ANDROID/320x470.png" density="mdpi" width="320" height="470" orientation="portrait"/>
<splash platform="android" src="package-assets/splashs/ANDROID/480x640.png" density="hdpi" width="480" height="640" orientation="portrait"/>
<splash platform="android" src="package-assets/splashs/ANDROID/720x960.png" density="xhdpi" width="720" height="960" orientation="portrait"/>
<splash platform="ios" src="package-assets/splashs/ios/640x960.png" width="640" height="960" orientation="portrait"/>
<splash platform="ios" src="package-assets/splashs/ios/640x1136.png" width="640" height="1136" orientation="portrait"/>
<splash platform="ios" src="package-assets/splashs/ios/750x1334.png" width="750" height="1334" orientation="portrait"/>
<splash platform="ios" src="package-assets/splashs/ios/768x1024.png" width="768" height="1024" orientation="portrait"/>
<splash platform="ios" src="package-assets/splashs/ios/1242x2208.png" width="1242" height="2208" orientation="portrait"/>
<splash platform="ios" src="package-assets/splashs/ios/1536x2048.png" width="1536" height="2048" orientation="portrait"/>
<splash platform="ios" src="package-assets/splashs/ios/2048x2732.png" width="2048" height="2732" orientation="portrait"/>
<icon platform="android" src="package-assets/iconos/android/project48.png" density="mdpi" width="48" height="48"/>
<icon platform="android" src="package-assets/iconos/android/project72.png" density="hdpi" width="72" height="72"/>
<icon platform="android" src="package-assets/iconos/android/project96.png" density="xhdpi" width="96" height="96"/>
<icon platform="ios" src="package-assets/iconos/ios/project29.png" width="29" height="29"/>
<icon platform="ios" src="package-assets/iconos/ios/project58.png" width="58" height="58"/>
<icon platform="ios" src="package-assets/iconos/ios/project87.png" width="87" height="87"/>
<icon platform="ios" src="package-assets/iconos/ios/project60.png" width="60" height="60"/>
<icon platform="ios" src="package-assets/iconos/ios/project120.png" width="120" height="120"/>
<icon platform="ios" src="package-assets/iconos/ios/project180.png" width="180" height="180"/>
<icon platform="ios" src="package-assets/iconos/ios/project76.png" width="76" height="76"/>
<icon platform="ios" src="package-assets/iconos/ios/project152.png" width="152" height="152"/>
<icon platform="ios" src="package-assets/iconos/ios/project80.png" width="40" height="40"/>
<icon platform="ios" src="package-assets/iconos/ios/project57.png" width="57" height="57"/>
<icon platform="ios" src="package-assets/iconos/ios/project114.png" width="114" height="114"/>
<icon platform="ios" src="package-assets/iconos/ios/project72.png" width="72" height="72"/>
<icon platform="ios" src="package-assets/iconos/ios/project144.png" width="144" height="144"/>
<icon platform="ios" src="package-assets/iconos/ios/project50.png" width="50" height="50"/>
<icon platform="ios" src="package-assets/iconos/ios/project100.png" width="100" height="100"/>
<icon platform="ios" src="package-assets/iconos/ios/project187.png" width="187" height="187"/>
<config-file platform="android" parent="/manifest/application" mode="merge">
<activity android:launchMode="singleTop" />
</config-file>
</widget>
最佳答案
我建议从一切敞开的地方开始——删除你所有的 allow-intent
和 access
声明,并且只有这个:
<access origin="*" />
并且不要将它放在任何 <platform />
中标签。从那里向后移动,将其限制为仅您想要的域。
此外,我没有看到任何提及您的 Content Security Policy .根据文档,您也应该在 html 文件中进行设置。同样,从敞开的角度开始,我认为它看起来像这样:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' *" />
关于android - 使用 Phonegap 构建时,cordova-plugin-whitelist 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46919658/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!