summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2017-08-26 15:04:25 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-02-22 07:49:13 +0100
commit3458dde44f5693ef2c1c2ff8b056fc1f4022701d (patch)
tree79e2e865235dbf9e3e60d73f3c6544a50036b75e
parentee221138d4bbb5e6209d648a1a14cc176100963a (diff)
downloadUXP-3458dde44f5693ef2c1c2ff8b056fc1f4022701d.tar
UXP-3458dde44f5693ef2c1c2ff8b056fc1f4022701d.tar.gz
UXP-3458dde44f5693ef2c1c2ff8b056fc1f4022701d.tar.lz
UXP-3458dde44f5693ef2c1c2ff8b056fc1f4022701d.tar.xz
UXP-3458dde44f5693ef2c1c2ff8b056fc1f4022701d.zip
Add site-specific overrides and remove the overruling global.
-rw-r--r--browser/components/nsBrowserGlue.js4
-rw-r--r--dom/base/Navigator.cpp10
2 files changed, 4 insertions, 10 deletions
diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js
index d69a11f6b..f97c173a0 100644
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -64,6 +64,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "AlertsService", "@mozilla.org/alerts-s
["Task", "resource://gre/modules/Task.jsm"],
["UITour", "resource:///modules/UITour.jsm"],
["URLBarZoom", "resource:///modules/URLBarZoom.jsm"],
+ ["UserAgentOverrides", "resource://gre/modules/UserAgentOverrides.jsm"],
["WebChannel", "resource://gre/modules/WebChannel.jsm"],
["WindowsRegistry", "resource://gre/modules/WindowsRegistry.jsm"],
["webrtcUI", "resource:///modules/webrtcUI.jsm"],
@@ -662,6 +663,8 @@ BrowserGlue.prototype = {
}
} catch (ex) { /* missing any of the prefs is not critical */ }
+ UserAgentOverrides.init();
+
PageThumbs.init();
webrtcUI.init();
AboutHome.init();
@@ -1042,6 +1045,7 @@ BrowserGlue.prototype = {
BrowserUsageTelemetry.uninit();
SelfSupportBackend.uninit();
+ UserAgentOverrides.uninit();
PageThumbs.uninit();
NewTabMessages.uninit();
AboutNewTab.uninit();
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index 290af152b..8b20d0196 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1854,16 +1854,6 @@ Navigator::GetUserAgent(nsPIDOMWindowInner* aWindow, nsIURI* aURI,
{
MOZ_ASSERT(NS_IsMainThread());
- if (!aIsCallerChrome) {
- const nsAdoptingString& override =
- mozilla::Preferences::GetString("general.useragent.override");
-
- if (override) {
- aUserAgent = override;
- return NS_OK;
- }
- }
-
nsresult rv;
nsCOMPtr<nsIHttpProtocolHandler>
service(do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv));