Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Issue under IOS with BLOB object #257

Open
sstraus opened this issue Aug 31, 2016 · 1 comment
Open

Issue under IOS with BLOB object #257

sstraus opened this issue Aug 31, 2016 · 1 comment

Comments

@sstraus
Copy link

sstraus commented Aug 31, 2016

When I try to open a blob image does not work.

fs.readBlob(fileInfo.id, function (ab) {
 var dataView = new DataView(ab);
 var blob = new Blob([dataView], {
 type: fileInfo.type
 });
 var myURL = window.URL || window.webkitURL;
 url = myURL.createObjectURL(blob);
window.open(url);

Url is created as blob:null/the_file_name but the window is blank.

Any idea on how to fix it?

@kristfal
Copy link

kristfal commented Sep 5, 2016

If you havent, check your CSP and allow blobs. Here is a pretty liberal CSP that should work. Remove the WS path, and whatever else you don't need.

<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline' 'unsafe-eval' 'self' gap://ready file: ws://<path-to-ws-endpoint>; child-src * 'unsafe-inline' 'unsafe-eval' blob: cdvfile:; img-src * 'self' data: blob:;" />

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants