对于以前的iOS测试版8,负荷(束)本地web应用程序,它都为正常工作UIWebView和WKWebView,我甚至移植使用新的网页游戏WKWebViewAPI.
var url = NSURL(fileURLWithPath:NSBundle.mainBundle().pathForResource("car", ofType:"html"))
webView = WKWebView(frame:view.frame)
webView!.loadRequest(NSURLRequest(URL:url))
view.addSubview(webView)
Run Code Online (Sandbox Code Playgroud)
但在测试版4中,我只是得到了一个空白的白色屏幕(UIWebView仍在工作),看起来没有任何内容被加载或执行.我在日志中看到一个错误:
无法为其创建沙箱扩展 /
有没有帮助引导我走向正确的方向?谢谢!
我在我的angular/ionic/cordova应用程序中显示下载到cordova.file.dataDirectory的图像时遇到问题.
我正在使用cordova-plugin-file,我可以下载文件,并使用.toInternalURL()和/或.toURL()提取URL.但是,角度列表视图拒绝它们.我正在使用WkWebView for Ios,我的代码在Android上工作正常(使用.toInternalURL()).我已在配置和元内容安全策略中将cdvfile://*和file:///*列入白名单......
我添加了屏幕截图这里是.toInternalURL()生成的链接的控制台屏幕截图

这是我使用的安全策略:
<meta http-equiv="Content-Security-Policy" content="default-src * data: cdvfile://* content://* file:///*; style-src 'self' 'unsafe-inline' *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; media-src *">
Run Code Online (Sandbox Code Playgroud) 我正在尝试将图像上传到我的FTP.
到目前为止我所获得的是这个plnkr
我的cordova文件传输看起来像
$scope.upload =function(){
var options = {
fileKey: "file",
fileName: "gopi",
chunkedMode: false,
mimeType: "image/jpeg",
params : {'user_token':'Chandru@123', 'user_email':'wepopusers'} // directory represents remote directory, fileName represents final remote file name
};
console.log(options);
$cordovaFileTransfer.upload('ftp://308.3d8.myftpupload.com/', MyService.getImgPath(), options)
.then(function(result) {
// Success!
console.log(result);
console.log("SUCCESS: " + JSON.stringify(result.response));
alert('ftp success');
}, function(err) {
// Error
console.log(err);
alert('ftp fail');
console.log("ERROR: " + JSON.stringify(err));
}, function (progress) {
// constant progress updates
console.log(progress);
});
};
Run Code Online (Sandbox Code Playgroud)
我对cordova文件的错误函数的响应如下
FileTransferError {code:2,source:"file:///storage/sdcard0/Android/data/com.ionicframework.camera108827/cache/1462186990291.jpg",target:" ftp://308.3d8.myftpupload.com/ " ,http_status:null,body:null ...} body:nullcode:2exception:nullhttp_status:nullsource:"file:///storage/sdcard0/Android/data/com.ionicframework.camera108827/cache/1462186990291.jpg"target:" …