mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
Issue #1473 - Add %OS_SLICE% macro to SSUAO to refine OS info
This commit is contained in:
parent
2501a7c74d
commit
0333159186
1 changed files with 4 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue