On 13/11/2012 19:28, Fred Wenzel wrote:
> Hey there Gaia devs,
>
> Is there a way to do for cross-origin requests (in this case, audio
> file downloads) in packaged apps?
>
Your applications needs to have extended privileges (so needs to be
certified) and then it needs to have the systemXHR permission.
https://github.com/mozilla-b2g/gaia/blob/master/apps/browser/manifest.webapp#L12
Then when you do a request you need to add a special attribute:
https://github.com/mozilla-b2g/gaia/blob/master/apps/browser/js/places.js#L125
Vivien.
> tofumatt and I are prototyping a podcasts app, i.e., a feed reader
> that'll download podcasts and keep them around for your offline
> listening pleasure.
>
> There are some interesting problems in there (for example, perhaps
> keeping the downloads in an indexeddb) but what's bafflingly
> complicated is actually downloading the files.
>
> I can drop the remote audio file into an audio tag but then I can't
> get to it to store it for later, offline use. So I tried to access the
> file via XHR, but that seems to fail due to cross-origin restrictions
> (obviously in a website, not so obviously in a packaged app, too).
>
> Implementing a server-side proxy to go with my packaged app for the
> sole reason of circumventing cross-origin restrictions doesn't sound
> like a good solution to this problem.
>
> Am I missing something?
>
> Thanks,
> Fred
>
> _______________________________________________
> dev-gaia mailing list
>
dev-...@lists.mozilla.org
>
https://lists.mozilla.org/listinfo/dev-gaia