title: Possibile to convert lat/long to country using HTML5 geolocation API under Manifest v2?
body: <p>I have a Google Chrome Extension which is running under Manifest v2. Previously, I was able to speak with <a href="http://www.geoplugin.net/javascript.gp" rel="nofollow">http://www.geoplugin.net/javascript.gp</a> and be provided with the users country code (e.g. US, UK). However, Manifest v2 imposes restrictions which disallow speaking to non-https, whitelisted websites. This means I can't go out to a server for my information anymore.</p>
  
  <p>I would like to continue to have this functionality. I believe my best bet is leveraging HTML5 geolocation to convert coordinates into country codes. I haven't seen any implementations of this  Is this possible to achieve within reason? All solutions I have found online propose communicating with a server and I have not come across an https solution.</p>
  
  <p>I also looked at trying to communicate with "https://maps.googleapis.com/maps/api/geocode/", but, even with it added to the content_security_policy, I am unable to query for JSON.</p>
  
  <p>Just curious if anyone has a solution I'm not seeing / has tackled this issue</p>
  
  <p>I used RobW's answer in jQuery:</p>
  
  <pre><code>$.get('http://www.geoplugin.net/json.gp', function(result){
      var geoplugin = JSON.parse(result.replace(/^[^\{]+/, '').replace(/\);?$/, ''));
      console.log(geoplugin.geoplugin_countryCode);
  });
  </code></pre>