我正在使用cocoon-cordova-labs-local-webserver。
以下是整个config.xml
:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.app.app" version="6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Name</name>
<author email="marktsang10@hotmail.com" href="http://dscova.com">The Dscova Team</author>
<content src="http://localhost:49000" />
<access origin="*" />
<preference name="orientation" value="portrait" />
<platform name="ios">
<config-file parent="ITSAppUsesNonExemptEncryption" target="*-Info.plist">
<false />
</config-file>
</platform>
<plugin name="cordova-custom-config" spec="~3.1.2" />
<engine name="ios" spec="~4.3.1" />
<engine name="android" spec="~6.1.2" />
<engine name="browser" spec="~4.1.0" />
<plugin name="cordova-plugin-whitelist" spec="~1.3.2" />
<plugin name="cocoon-cordova-labs-local-webserver" spec="~2.4.1" />
</widget>
我在html头中也有这个:
<meta
http-equiv="Content-Security-Policy"
content="
default-src 'self' data: gap:
http://localhost*
https://fonts.googleapis.com 'unsafe-eval' 'unsafe-inline';
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
font-src 'self' https://fonts.gstatic.com;
img-src * 'self' data:;
media-src *;
">
答案 0 :(得分:1)
aahhh,我意识到这个插件仅适用于ios。对于Android,你需要使用不同的插件。