Bug 917685 - Let complex overrides take precedence over pref overrides. r=dao, a=akeybl
authorJim Chen <nchen@mozilla.com>
Wed, 16 Oct 2013 10:51:23 -0400
changeset 155804 420a47d418ec92e81efc45d3de3516c619b62d7d
parent 155803 a93bf8a2d13702034a501185bcb26dd2d0600a24
child 155805 ef0f77bda0be84a1ca353507666b104ccd0fefe4
push id4428
push userryanvm@gmail.com
push dateThu, 17 Oct 2013 16:54:16 +0000
treeherdermozilla-aurora@9ca74e12ff65 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, akeybl
bugs917685
milestone26.0a2
Bug 917685 - Let complex overrides take precedence over pref overrides. r=dao, a=akeybl
netwerk/protocol/http/UserAgentOverrides.jsm
--- a/netwerk/protocol/http/UserAgentOverrides.jsm
+++ b/netwerk/protocol/http/UserAgentOverrides.jsm
@@ -51,17 +51,18 @@ this.UserAgentOverrides = {
       gUpdatedOverrides = overrides;
     });
 
     buildOverrides();
     gInitialized = true;
   },
 
   addComplexOverride: function uao_addComplexOverride(callback) {
-    gOverrideFunctions.push(callback);
+    // Add to front of array so complex overrides have precedence
+    gOverrideFunctions.unshift(callback);
   },
 
   getOverrideForURI: function uao_getOverrideForURI(aURI) {
     if (!gInitialized ||
         (!gOverrides.size && !gUpdatedOverrides) ||
         !(aURI instanceof Ci.nsIStandardURL))
       return null;