9

I am experimenting the PhoneGap development for IPhone. The environment is XCode 4.1, PhoneGap 1.0. I am using the Weinre remote debugger according to the tutorial provided by PhoneGap, when I run the app in IPhone Simulator, I got this error shown in XCode output:

2011-08-31 09:31:15.275 Contacts[898:11803] ERROR whitelist rejection: url='http://localhost:8080/target/target-script-min.js#anonymous'

The URL is pointing to the Weinre server and it works in browser. I can't find anything about the "whitelist rejection" error in google. Any idea what does this mean?

Thanks!

Felipe Sabino
  • 17,825
  • 6
  • 78
  • 112
ycseattle
  • 3,687
  • 7
  • 36
  • 42

2 Answers2

26

whitelist support was recently added to phonegap. see here and here.

to fix this, you just need to add the needed domains in your PhoneGap.plist to your ExternalHosts-Array.

In your case, it would be localhostand would look like this:

just code, because can't post an image:

<key>ExternalHosts</key>
<array>
    <string>localhost</string>
    <string>debug.phonegap.com</string>
</array>
Flori
  • 2,453
  • 1
  • 21
  • 31
2

Now that Apache Foundation has taken over the name has changed from PhoneGap.plist to Cordova.plist, but it's still ExternalHosts, this helped me get Weinre running which makes a huge difference when debugging directly on an iDevice.

Kjuly
  • 34,476
  • 22
  • 104
  • 118
Thomas Bindzus
  • 1,508
  • 12
  • 12