summaryrefslogtreecommitdiffstats
path: root/netwerk/protocol/http/nsHttpHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'netwerk/protocol/http/nsHttpHandler.cpp')
-rw-r--r--netwerk/protocol/http/nsHttpHandler.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp
index 0ae589151..7a29e041b 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
//