Firefox Add-on SDK : nsIDOMGeolocation getCurrentPosition not working
<p>While following one of the tutorial  <a href="https://addons.mozilla.org/en-US/developers/docs/sdk/1.7/dev-guide/tutorials/reusable-modules.html" rel="nofollow">https://addons.mozilla.org/en-US/developers/docs/sdk/1.7/dev-guide/tutorials/reusable-modules.html</a> ,I got stuck, trying to get lat-lon values on console.</p>

<p>Here's an approximation of my code:</p>

<pre><code>var {Cc, Ci} = require("chrome");

function getCurrentPosition(callback) {
  var geolocation = Cc["@mozilla.org/geolocation;1"]
                      .getService(Ci.nsIDOMGeoGeolocation);
  geolocation.getCurrentPosition(done,error);
}

var widget = require("widget").Widget({
  id: "whereami",
  label: "Where am I?",
  contentURL: "http://www.mozilla.org/favicon.ico",
  onClick: function() {
    getCurrentPosition(function(position) {
      console.log("latitude: ", position.coords.latitude);
      console.log("longitude: ", position.coords.longitude);
    });
  }
});


function error(error)
{
  console.log("error occured trying to get geolocation from chrome");
}
function done(position)
{
  console.log("geolocation was found from chrome"); 
}
</code></pre>

<p>I run this using "cfx run" command from cmd on  windows machine , new instance of firefox opens up, on clicking widget created , nothing happens ,why it does not output lat lon on console?  </p>

<p>Thanks in advance.</p>
