I would like to obtain the IP address of the user in a Chrome app. The Content Security Policy directive prevents me from using a service such as IPify, or an ajax request, such as:
$.ajax({
url: 'https://freegeoip.net/json/',
type: 'POST',
dataType: 'jsonp',
success: function(location) {
alert(location.ip);
}
});
The error message is:
Refused to load the script 'https://freegeoip.net/json/?callback=jQuery21304975464364979416_1442806213407&_=1442806213408' because it violates the following Content Security Policy directive: "default-src 'self' blob: filesystem: chrome-extension-resource:". Note that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
Thanks,
Edit for clarity: I am looking for the IP address as it is seen from a server on the global internet network, not the local IP.