summaryrefslogtreecommitdiffstats
path: root/components/nsBrowserGlue.js
diff options
context:
space:
mode:
authorThomas Groman <tgroman@nuegia.net>2019-12-17 01:18:59 -0800
committerThomas Groman <tgroman@nuegia.net>2019-12-17 01:18:59 -0800
commit64cbf43e17ab59f1d6b3f160ce00aff66001302f (patch)
tree54ac2c83afd65a8fab26f8c2c3dddc8fa03b91ee /components/nsBrowserGlue.js
parent004e9d310009ca8999c99bf4023738e894753ab3 (diff)
downloadwebbrowser-64cbf43e17ab59f1d6b3f160ce00aff66001302f.tar
webbrowser-64cbf43e17ab59f1d6b3f160ce00aff66001302f.tar.gz
webbrowser-64cbf43e17ab59f1d6b3f160ce00aff66001302f.tar.lz
webbrowser-64cbf43e17ab59f1d6b3f160ce00aff66001302f.tar.xz
webbrowser-64cbf43e17ab59f1d6b3f160ce00aff66001302f.zip
removed old pm interface converters and fixed typo in version 19 conveter
Diffstat (limited to 'components/nsBrowserGlue.js')
-rw-r--r--components/nsBrowserGlue.js195
1 files changed, 1 insertions, 194 deletions
diff --git a/components/nsBrowserGlue.js b/components/nsBrowserGlue.js
index b978eac..e8eefa4 100644
--- a/components/nsBrowserGlue.js
+++ b/components/nsBrowserGlue.js
@@ -1224,199 +1224,6 @@ BrowserGlue.prototype = {
}
}
- if (currentUIVersion < 3) {
- // This code merges the reload/stop/go button into the url bar.
- let currentsetResource = this._rdf.GetResource("currentset");
- let toolbarResource = this._rdf.GetResource(BROWSER_DOCURL + "nav-bar");
- let currentset = this._getPersist(toolbarResource, currentsetResource);
- // Need to migrate only if toolbar is customized and all 3 elements are found.
- if (currentset &&
- currentset.indexOf("reload-button") != -1 &&
- currentset.indexOf("stop-button") != -1 &&
- currentset.indexOf("urlbar-container") != -1 &&
- currentset.indexOf("urlbar-container,reload-button,stop-button") == -1) {
- currentset = currentset.replace(/(^|,)reload-button($|,)/, "$1$2")
- .replace(/(^|,)stop-button($|,)/, "$1$2")
- .replace(/(^|,)urlbar-container($|,)/,
- "$1urlbar-container,reload-button,stop-button$2");
- this._setPersist(toolbarResource, currentsetResource, currentset);
- }
- }
-
- if (currentUIVersion < 4) {
- // This code moves the home button to the immediate left of the bookmarks menu button.
- let currentsetResource = this._rdf.GetResource("currentset");
- let toolbarResource = this._rdf.GetResource(BROWSER_DOCURL + "nav-bar");
- let currentset = this._getPersist(toolbarResource, currentsetResource);
- // Need to migrate only if toolbar is customized and the elements are found.
- if (currentset &&
- currentset.indexOf("home-button") != -1 &&
- currentset.indexOf("bookmarks-menu-button-container") != -1) {
- currentset = currentset.replace(/(^|,)home-button($|,)/, "$1$2")
- .replace(/(^|,)bookmarks-menu-button-container($|,)/,
- "$1home-button,bookmarks-menu-button-container$2");
- this._setPersist(toolbarResource, currentsetResource, currentset);
- }
- }
-
- if (currentUIVersion < 5) {
- // This code uncollapses PersonalToolbar if its collapsed status is not
- // persisted, and user customized it or changed default bookmarks.
- let toolbarResource = this._rdf.GetResource(BROWSER_DOCURL + "PersonalToolbar");
- let collapsedResource = this._rdf.GetResource("collapsed");
- let collapsed = this._getPersist(toolbarResource, collapsedResource);
- // If the user does not have a persisted value for the toolbar's
- // "collapsed" attribute, try to determine whether it's customized.
- if (collapsed === null) {
- // We consider the toolbar customized if it has more than
- // 3 children, or if it has a persisted currentset value.
- let currentsetResource = this._rdf.GetResource("currentset");
- let toolbarIsCustomized = !!this._getPersist(toolbarResource,
- currentsetResource);
- function getToolbarFolderCount() {
- let toolbarFolder =
- PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root;
- let toolbarChildCount = toolbarFolder.childCount;
- toolbarFolder.containerOpen = false;
- return toolbarChildCount;
- }
-
- if (toolbarIsCustomized || getToolbarFolderCount() > 3) {
- this._setPersist(toolbarResource, collapsedResource, "false");
- }
- }
- }
-
- if (currentUIVersion < 6) {
- // convert tabsontop attribute to pref
- let toolboxResource = this._rdf.GetResource(BROWSER_DOCURL + "navigator-toolbox");
- let tabsOnTopResource = this._rdf.GetResource("tabsontop");
- let tabsOnTopAttribute = this._getPersist(toolboxResource, tabsOnTopResource);
- if (tabsOnTopAttribute)
- Services.prefs.setBoolPref("browser.tabs.onTop", tabsOnTopAttribute == "true");
- }
-
- // Migration at version 7 only occurred for users who wanted to try the new
- // Downloads Panel feature before its release. Since migration at version
- // 9 adds the button by default, this step has been removed.
-
- 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 (currentUIVersion < 9) {
- // This code adds the customizable downloads buttons.
- let currentsetResource = this._rdf.GetResource("currentset");
- let toolbarResource = this._rdf.GetResource(BROWSER_DOCURL + "nav-bar");
- let currentset = this._getPersist(toolbarResource, currentsetResource);
-
- // Since the Downloads button is located in the navigation bar by default,
- // migration needs to happen only if the toolbar was customized using a
- // previous UI version, and the button was not already placed on the
- // toolbar manually.
- if (currentset &&
- currentset.indexOf("downloads-button") == -1) {
- // The element is added either after the search bar or before the home
- // button. As a last resort, the element is added just before the
- // non-customizable window controls.
- if (currentset.indexOf("search-container") != -1) {
- currentset = currentset.replace(/(^|,)search-container($|,)/,
- "$1search-container,downloads-button$2")
- } else if (currentset.indexOf("home-button") != -1) {
- currentset = currentset.replace(/(^|,)home-button($|,)/,
- "$1downloads-button,home-button$2")
- } else {
- currentset = currentset.replace(/(^|,)window-controls($|,)/,
- "$1downloads-button,window-controls$2")
- }
- this._setPersist(toolbarResource, currentsetResource, currentset);
- }
-
- Services.prefs.clearUserPref("browser.download.useToolkitUI");
- Services.prefs.clearUserPref("browser.library.useNewDownloadsView");
- }
-
-#ifdef XP_WIN
- if (currentUIVersion < 10) {
- // For Windows systems with display set to > 96dpi (i.e. systemDefaultScale
- // will return a value > 1.0), we want to discard any saved full-zoom settings,
- // as we'll now be scaling the content according to the system resolution
- // scale factor (Windows "logical DPI" setting)
- let sm = Cc["@mozilla.org/gfx/screenmanager;1"].getService(Ci.nsIScreenManager);
- if (sm.systemDefaultScale > 1.0) {
- let cps2 = Cc["@mozilla.org/content-pref/service;1"].
- getService(Ci.nsIContentPrefService2);
- cps2.removeByName("browser.content.full-zoom", null);
- }
- }
-#endif
-
- if (currentUIVersion < 11) {
- Services.prefs.clearUserPref("dom.disable_window_move_resize");
- Services.prefs.clearUserPref("dom.disable_window_flip");
- Services.prefs.clearUserPref("dom.event.contextmenu.enabled");
- Services.prefs.clearUserPref("javascript.enabled");
- Services.prefs.clearUserPref("permissions.default.image");
- }
-
- if (currentUIVersion < 12) {
- // Remove bookmarks-menu-button-container, then place
- // bookmarks-menu-button into its position.
- let currentsetResource = this._rdf.GetResource("currentset");
- let toolbarResource = this._rdf.GetResource(BROWSER_DOCURL + "nav-bar");
- let currentset = this._getPersist(toolbarResource, currentsetResource);
- // Need to migrate only if toolbar is customized.
- if (currentset) {
- if (currentset.contains("bookmarks-menu-button-container")) {
- currentset = currentset.replace(/(^|,)bookmarks-menu-button-container($|,)/,
- "$1bookmarks-menu-button$2");
- this._setPersist(toolbarResource, currentsetResource, currentset);
- }
- }
- }
-
- if (currentUIVersion < 16) {
- // Migrate Sync from pmsync.palemoon.net to pmsync.palemoon.org
- try {
- let syncURL = Services.prefs.getCharPref("services.sync.clusterURL");
- let newSyncURL = syncURL.replace(/pmsync\.palemoon\.net/i,"pmsync.palemoon.org");
- if (newSyncURL != syncURL) {
- Services.prefs.setCharPref("services.sync.clusterURL", newSyncURL);
- }
- } catch(ex) {
- // Pref not found: Sync not in use, nothing to do.
- }
- }
-
- if (currentUIVersion < 17) {
- this._notifyNotificationsUpgrade();
- }
-
- if (this._dirty)
- this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush();
-
- delete this._rdf;
- delete this._dataSource;
-
- if (currentUIVersion < 18) {
- // Make sure the doNotTrack value conforms to the conversion from
- // three-state to two-state. (This reverts a setting of "please track me"
- // to the default "don't say anything").
- try {
- if (Services.prefs.getBoolPref("privacy.donottrackheader.enabled") &&
- Services.prefs.getIntPref("privacy.donottrackheader.value") != 1) {
- Services.prefs.clearUserPref("privacy.donottrackheader.enabled");
- Services.prefs.clearUserPref("privacy.donottrackheader.value");
- }
- }
- catch (ex) {}
- }
-
#ifndef MOZ_JXR
// Until JPEG-XR decoder is implemented (UXP #144)
if (currentUIVersion < 19) {
@@ -1435,7 +1242,7 @@ BrowserGlue.prototype = {
if (currentUIVersion < 20) {
// HPKP change of UI preference; reset enforcement level
- Services.prefs.clearUserPerf("security.cert_pinning.eforcement_level");
+ Services.prefs.clearUserPref("security.cert_pinning.eforcement_level");
}
// Update the migration version.