Bug 786613 Port |Bug 782453 - Add site-specific User Agent infrastructure| r=Neil a=Callek.
authorPhilip Chee <philip.chee@gmail.com>
Fri, 31 Aug 2012 20:15:14 +0800
changeset 13481 e86a3f550aeea64e3f79e1658e8baf6fd418c872
parent 13480 a034aa3e5de892d19ee63c5a9d293a927b44fc19
child 13482 a06ccb7796512f50682a63d8243cf034bba23633
push id712
push userphilip.chee@gmail.com
push dateSun, 14 Oct 2012 04:57:37 +0000
treeherdercomm-beta@a06ccb779651 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil, Callek
bugs786613, 782453
Bug 786613 Port |Bug 782453 - Add site-specific User Agent infrastructure| r=Neil a=Callek.
suite/browser/browser-prefs.js
suite/common/src/nsSuiteGlue.js
--- a/suite/browser/browser-prefs.js
+++ b/suite/browser/browser-prefs.js
@@ -27,17 +27,22 @@ pref("general.startup.addressbook",     
 pref("general.open_location.last_url",      "");
 pref("general.open_location.last_window_choice", 0);
 
 pref("general.smoothScroll", false);
 pref("general.autoScroll", true);
 
 pref("general.useragent.compatMode.firefox", true);
 
-// 0 = blank, 1 = home (browser.startup.homepage), 2 = last
+// 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");
+
+// 0 = blank, 1 = home (browser.startup.homepage), 2 = last visited page, 3 = resume previous browser session
 pref("browser.startup.page",                1);
 pref("browser.startup.homepage",	   "chrome://navigator-region/locale/region.properties");
 pref("browser.startup.homepage.count", 1);
 
 pref("browser.warnOnQuit", true);
 pref("browser.warnOnRestart", true);
 
 // disable this until it can be disabled on a per-docshell basis (see bug 319368)
--- a/suite/common/src/nsSuiteGlue.js
+++ b/suite/common/src/nsSuiteGlue.js
@@ -8,16 +8,19 @@ Components.utils.import("resource://gre/
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/AddonManager.jsm");
 Components.utils.import("resource:///modules/Sanitizer.jsm");
 Components.utils.import("resource:///modules/mailnewsMigrator.js");
 
 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");
 
 XPCOMUtils.defineLazyModuleGetter(this, "BookmarkHTMLUtils",
                                   "resource://gre/modules/BookmarkHTMLUtils.jsm");
 
 // We try to backup bookmarks at idle times, to avoid doing that at shutdown.
 // Number of idle seconds before trying to backup bookmarks.  15 minutes.
@@ -273,16 +276,17 @@ SuiteGlue.prototype = {
     if (this._isIdleObserver)
       this._idleService.removeIdleObserver(this, BOOKMARKS_BACKUP_IDLE_TIME);
     if (this._isPlacesInitObserver)
       Services.obs.removeObserver(this, "places-init-complete");
     if (this._isPlacesLockedObserver)
       Services.obs.removeObserver(this, "places-database-locked");
     if (this._isPlacesShutdownObserver)
       Services.obs.removeObserver(this, "places-shutdown");
+    UserAgentOverrides.uninit();
   },
 
   // profile is available
   _onProfileAfterChange: function()
   {
     // check if we're in safe mode
     if (Services.appinfo.inSafeMode) {
       Services.ww.openWindow(null, "chrome://communicator/content/safeMode.xul", 
@@ -301,17 +305,17 @@ SuiteGlue.prototype = {
 
     if (Services.prefs.prefHasUserValue("privacy.sanitize.didShutdownSanitize")) {
       Services.prefs.clearUserPref("privacy.sanitize.didShutdownSanitize");
       // We need to persist this preference change, since we want to
       // check it at next app start even if the browser exits abruptly
       Services.prefs.savePrefFile(null);
     }
 
-    // once we support a safe mode popup, it should be called here
+    UserAgentOverrides.init();
   },
 
   // Browser startup complete. All initial windows have opened.
   _onBrowserStartup: function(aWindow)
   {
     if (Services.prefs.getBoolPref("plugins.update.notifyUser"))
       this._showPluginUpdatePage(aWindow);