summaryrefslogtreecommitdiffstats
path: root/netwerk
diff options
context:
space:
mode:
authorNew Tobin Paradigm <email@mattatobin.com>2020-03-10 16:58:06 -0400
committerGitHub <noreply@github.com>2020-03-10 16:58:06 -0400
commitccee9ea5b7167675290c022e75b1744d41c005d2 (patch)
tree1023056c7c8ccc5c738349f53b7a465e005ee4f1 /netwerk
parentfda8403f562657ec7ae340d8553e462592a30630 (diff)
parent3c8bc3da7cd537680288e8b870c21e1ae789a541 (diff)
downloadUXP-ccee9ea5b7167675290c022e75b1744d41c005d2.tar
UXP-ccee9ea5b7167675290c022e75b1744d41c005d2.tar.gz
UXP-ccee9ea5b7167675290c022e75b1744d41c005d2.tar.lz
UXP-ccee9ea5b7167675290c022e75b1744d41c005d2.tar.xz
UXP-ccee9ea5b7167675290c022e75b1744d41c005d2.zip
Merge pull request #1476 from JustOff/PR_ssuao_os_slice
Add `%OS_SLICE%` macro to SSUAO to refine OS info
Diffstat (limited to 'netwerk')
-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;