mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backout 418955e7c3a9 (bug 782453) for Windows xpcshell failures
This commit is contained in:
parent
69ee58ce36
commit
7ab9e64521
@ -222,11 +222,6 @@ pref("general.autoScroll", false);
|
||||
pref("general.autoScroll", true);
|
||||
#endif
|
||||
|
||||
// Send aol.com the legacy build date instead of the version number in the UA's
|
||||
// Gecko token as a temporary measure against bug 778408 (mail.aol.com defaults
|
||||
// to basic web UI when accessed with a user agent without Gecko/20100101).
|
||||
pref("general.useragent.override.aol.com", "Gecko/[^ ]*#Gecko/20100101");
|
||||
|
||||
// At startup, check if we're the default browser and prompt user if not.
|
||||
pref("browser.shell.checkDefaultBrowser", true);
|
||||
|
||||
|
@ -20,9 +20,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "UserAgentOverrides",
|
||||
"resource://gre/modules/UserAgentOverrides.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
|
||||
"resource://gre/modules/PlacesUtils.jsm");
|
||||
|
||||
@ -314,7 +311,6 @@ BrowserGlue.prototype = {
|
||||
os.removeObserver(this, "places-database-locked");
|
||||
if (this._isPlacesShutdownObserver)
|
||||
os.removeObserver(this, "places-shutdown");
|
||||
UserAgentOverrides.uninit();
|
||||
webappsUI.uninit();
|
||||
SignInToWebsiteUX.uninit();
|
||||
},
|
||||
@ -341,11 +337,14 @@ BrowserGlue.prototype = {
|
||||
// handle any UI migration
|
||||
this._migrateUI();
|
||||
|
||||
UserAgentOverrides.init();
|
||||
// Initialize webapps UI
|
||||
webappsUI.init();
|
||||
|
||||
PageThumbs.init();
|
||||
NewTabUtils.init();
|
||||
|
||||
SignInToWebsiteUX.init();
|
||||
|
||||
PdfJs.init();
|
||||
|
||||
Services.obs.notifyObservers(null, "browser-ui-startup-complete", "");
|
||||
|
@ -24,10 +24,6 @@ pref("keyword.enabled", false);
|
||||
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
|
||||
pref("general.useragent.compatMode.firefox", false);
|
||||
|
||||
// This pref exists only for testing purposes. In order to disable all
|
||||
// overrides by default, don't initialize UserAgentOverrides.jsm.
|
||||
pref("general.useragent.site_specific_overrides", true);
|
||||
|
||||
pref("general.config.obscure_value", 13); // for MCD .cfg files
|
||||
|
||||
pref("general.warnOnAboutConfig", true);
|
||||
|
@ -94,10 +94,6 @@ LOCAL_INCLUDES = \
|
||||
-I$(topsrcdir)/content/events/src \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_JS_MODULES = \
|
||||
UserAgentOverrides.jsm \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
include $(topsrcdir)/ipc/chromium/chromium-config.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
@ -1,74 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
var EXPORTED_SYMBOLS = [ "UserAgentOverrides" ];
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = Components.classes;
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const PREF_OVERRIDES_ENABLED = "general.useragent.site_specific_overrides";
|
||||
|
||||
var gPrefBranch;
|
||||
var gOverrides;
|
||||
|
||||
var UserAgentOverrides = {
|
||||
init: function uao_init() {
|
||||
gPrefBranch = Services.prefs.getBranch("general.useragent.override.");
|
||||
gPrefBranch.addObserver("", buildOverrides, false);
|
||||
|
||||
Services.prefs.addObserver(PREF_OVERRIDES_ENABLED, buildOverrides, false);
|
||||
|
||||
Services.obs.addObserver(HTTP_on_modify_request, "http-on-modify-request", false);
|
||||
|
||||
buildOverrides();
|
||||
},
|
||||
|
||||
uninit: function uao_uninit() {
|
||||
gPrefBranch.removeObserver("", buildOverrides);
|
||||
|
||||
Services.prefs.removeObserver(PREF_OVERRIDES_ENABLED, buildOverrides);
|
||||
|
||||
Services.obs.removeObserver(HTTP_on_modify_request, "http-on-modify-request");
|
||||
}
|
||||
};
|
||||
|
||||
function buildOverrides() {
|
||||
gOverrides = {};
|
||||
|
||||
if (!Services.prefs.getBoolPref(PREF_OVERRIDES_ENABLED))
|
||||
return;
|
||||
|
||||
const defaultUA = Cc["@mozilla.org/network/protocol;1?name=http"]
|
||||
.getService(Ci.nsIHttpProtocolHandler)
|
||||
.userAgent;
|
||||
let domains = gPrefBranch.getChildList("");
|
||||
|
||||
for (let domain of domains) {
|
||||
let override = gPrefBranch.getCharPref(domain);
|
||||
|
||||
let [search, replace] = override.split("#", 2);
|
||||
if (search && replace) {
|
||||
gOverrides[domain] = defaultUA.replace(new RegExp(search, "g"), replace);
|
||||
} else {
|
||||
gOverrides[domain] = override;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function HTTP_on_modify_request(aSubject, aTopic, aData) {
|
||||
let channel = aSubject.QueryInterface(Ci.nsIHttpChannel);
|
||||
let host = channel.URI.asciiHost;
|
||||
|
||||
for (let domain in gOverrides) {
|
||||
if (host == domain ||
|
||||
host.endsWith("." + domain)) {
|
||||
channel.setRequestHeader("User-Agent", gOverrides[domain], false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user