diff options
author | Moonchild <moonchild@palemoon.org> | 2020-11-15 23:10:49 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-11-15 23:11:24 +0000 |
commit | 3abb8e28add1be2c2ec2f53a20bd105bde64a5b2 (patch) | |
tree | 465194ef093f1dd4cdc1fc8ec848b9361b0555a3 /netwerk/protocol/http/nsHttpHandler.cpp | |
parent | 18df01eb5498c954044f96c346026da0238d2e61 (diff) | |
download | uxp-3abb8e28add1be2c2ec2f53a20bd105bde64a5b2.tar.gz |
Revert "Issue #1684 - Remove global UA override preference and supporting code."
This reverts commit 18df01eb5498c954044f96c346026da0238d2e61.
Backed out for devtools breakage.
Diffstat (limited to 'netwerk/protocol/http/nsHttpHandler.cpp')
-rw-r--r-- | netwerk/protocol/http/nsHttpHandler.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index 0ae5891517..7a29e041ba 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -685,6 +685,11 @@ nsHttpHandler::BuildAppVersion() const nsAFlatCString & nsHttpHandler::UserAgent() { + if (mUserAgentOverride) { + LOG(("using general.useragent.override : %s\n", mUserAgentOverride.get())); + return mUserAgentOverride; + } + if (mUserAgentIsDirty) { BuildUserAgent(); mUserAgentIsDirty = false; @@ -986,6 +991,13 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) mUserAgentIsDirty = true; } + // general.useragent.override + if (PREF_CHANGED(UA_PREF("override"))) { + prefs->GetCharPref(UA_PREF("override"), + getter_Copies(mUserAgentOverride)); + mUserAgentIsDirty = true; + } + // // HTTP options // |