Bug 762966 - reset homepage pref for users who have it set to google.com/firefox r=dao

This commit is contained in:
Raymond Lee 2012-09-27 20:57:39 +08:00
parent 1b25a20a8d
commit f61f9fa5aa

View File

@ -1207,7 +1207,7 @@ BrowserGlue.prototype = {
},
_migrateUI: function BG__migrateUI() {
const UI_VERSION = 7;
const UI_VERSION = 8;
const BROWSER_DOCURL = "chrome://browser/content/browser.xul#";
let currentUIVersion = 0;
try {
@ -1342,6 +1342,15 @@ BrowserGlue.prototype = {
}
}
if (currentUIVersion < 8) {
// Reset homepage pref for users who have it set to google.com/firefox
let uri = Services.prefs.getComplexValue("browser.startup.homepage",
Ci.nsIPrefLocalizedString).data;
if (uri && /^https?:\/\/(www\.)?google(\.\w{2,3}){1,2}\/firefox\/?$/.test(uri)) {
Services.prefs.clearUserPref("browser.startup.homepage");
}
}
if (this._dirty)
this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush();