Bug 886138 - Make Geolocation work when geo.wifi.uri is a file:// URI. r=jdm
authorMichael Harrison <mjh563@yahoo.co.uk>
Tue, 01 Oct 2013 17:38:30 -0400
changeset 163444 49e797ce0f2226550cc9bb45d9c6fab6e4914bc4
parent 163336 4fe6e345e0b05d69d2c882dcc34ecc733f441530
child 163445 d079bd51114c541d4079010e15cdf8522e7cec07
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs886138
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 886138 - Make Geolocation work when geo.wifi.uri is a file:// URI. r=jdm
dom/system/NetworkGeolocationProvider.js
--- a/dom/system/NetworkGeolocationProvider.js
+++ b/dom/system/NetworkGeolocationProvider.js
@@ -176,17 +176,17 @@ WifiGeoPositionProvider.prototype = {
     xhr.mozBackgroundRequest = true;
     xhr.channel.loadFlags = Ci.nsIChannel.LOAD_ANONYMOUS;
     xhr.onerror = function() {
         LOG("onerror: " + xhr);
     };
 
     xhr.onload = function() {  
         LOG("gls returned status: " + xhr.status + " --> " +  JSON.stringify(xhr.response));
-        if (xhr.status != 200) {
+        if (xhr.channel instanceof Ci.nsIHttpChannel && xhr.status != 200) {
             return;
         }
 
         if (!xhr.response || !xhr.response.location) {
             return;
         }
 
         let newLocation = new WifiGeoPositionObject(xhr.response.location.lat,