summaryrefslogtreecommitdiffstats
path: root/netwerk/protocol
diff options
context:
space:
mode:
authorJustOff <Off.Just.Off@gmail.com>2020-03-10 13:10:26 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 13:05:07 +0200
commit702cf4254413a66b23ef5b94279db4270e1e2eba (patch)
tree691f02c3418a3d915d1a3189ecf071ee4967f015 /netwerk/protocol
parent79a9dc24795e1036063a21230639469c1b8ad655 (diff)
downloadUXP-702cf4254413a66b23ef5b94279db4270e1e2eba.tar
UXP-702cf4254413a66b23ef5b94279db4270e1e2eba.tar.gz
UXP-702cf4254413a66b23ef5b94279db4270e1e2eba.tar.lz
UXP-702cf4254413a66b23ef5b94279db4270e1e2eba.tar.xz
UXP-702cf4254413a66b23ef5b94279db4270e1e2eba.zip
Issue #1473 - Add `%OS_SLICE%` macro to SSUAO to refine OS info
Diffstat (limited to 'netwerk/protocol')
-rw-r--r--netwerk/protocol/http/UserAgentOverrides.jsm5
1 files changed, 4 insertions, 1 deletions
diff --git a/netwerk/protocol/http/UserAgentOverrides.jsm b/netwerk/protocol/http/UserAgentOverrides.jsm
index 037aa575b..aa1325a64 100644
--- a/netwerk/protocol/http/UserAgentOverrides.jsm
+++ b/netwerk/protocol/http/UserAgentOverrides.jsm
@@ -18,6 +18,9 @@ const PREF_OVERRIDES_ENABLED = "general.useragent.site_specific_overrides";
const DEFAULT_UA = Cc["@mozilla.org/network/protocol;1?name=http"]
.getService(Ci.nsIHttpProtocolHandler)
.userAgent;
+const OS_SLICE = Cc["@mozilla.org/network/protocol;1?name=http"]
+ .getService(Ci.nsIHttpProtocolHandler)
+ .oscpu + ";";
const MAX_OVERRIDE_FOR_HOST_CACHE_SIZE = 250;
XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
@@ -143,7 +146,7 @@ function getUserAgentFromOverride(override)
if (search && replace) {
userAgent = DEFAULT_UA.replace(new RegExp(search, "g"), replace);
} else {
- userAgent = override;
+ userAgent = override.replace(/%OS_SLICE%/g, OS_SLICE);
}
gBuiltUAs.set(override, userAgent);
return userAgent;