我有Crosswalk 16.45.421.19的Android项目。
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
我有index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="/">
<link rel="icon" href="img/favicon.ico" type="image/x-icon" />
</head>
<body>
<img src="file:///android_asset/img/logo.png">
<img src="file:///android_asset/img/preloaderWhite.gif">
<div id="my-app">Привет!!!!</div>
</body>
</html>
&#13;
xWalkWebView.load("file:///android_asset/index.html", null); //All works!
当此文件在服务器上时:
xWalkWebView.load("http://192.168.0.102/", null); //Get index.html, but images don't load.
并且:
Not allowed to load local resource: file:///android_asset/img/logo.png"
答案 0 :(得分:-1)
您好,请查看CSP内容安全策略https://developer.mozilla.org/en/docs/Web/Security/CSP,我相信这是您的主题