Search code examples
javascriptiphonecordovawhitelist

Is it possible to get around phonegaps whitelisting policy?


I have an app that allows users to specify an arbitrary URL to download data from and my app processes it into their contacts. This is designed to be done via a URLScheme.

When I do this in a standard IPhone app I can use functions to download the file from an arbitrary URL. However in phonegap I can only download from a list of whitelisted hosts I specify at compile time!

I am downloading a data file not an executable javascript file but I don't know if that makes any difference.

I have several questions.

  • Is there a way to allow the user to specify at runtime a whitelisted host?
  • Is there a way in code to specify a new whitelist item at runtime?
  • Is There a way to circumvent the whitelist policy alltogether (I presume not)?

If neither of these are possible, the only way I can think of doing this is to whitelist my own site and use my site as a proxy to fetch the remote user URL?

Does anyone have any further ideas about how I might do this?


Solution

  • if you add a new whitelist entry and have the value set to * you can access any URL. This is a catch all and you will only need this entry.