Remove obsolete getPref helpers.

This commit is contained in:
Ascrod 2019-03-24 20:22:03 -04:00 • committed by Roy Tam
commit 8d45fa6874
15 changed files with 103 additions and 307 deletions

View file

@ -1282,7 +1282,7 @@ var gBrowserInit = {
// Setup click-and-hold gestures access to the session history
// menus if global click-and-hold isn't turned on
if (!getBoolPref("ui.click_hold_context_menus", false))
if (!Services.prefs.getBoolPref("ui.click_hold_context_menus", false))
SetClickAndHoldHandlers();
let NP = {};
@ -1873,7 +1873,7 @@ function BrowserGoHome(aEvent) {
case "tabshifted":
case "tab":
urls = homePage.split("|");
var loadInBackground = getBoolPref("browser.tabs.loadBookmarksInBackground", false);
var loadInBackground = Services.prefs.getBoolPref("browser.tabs.loadBookmarksInBackground", false);
gBrowser.loadTabs(urls, loadInBackground);
break;
case "window":

View file

@ -61,16 +61,6 @@ function openTopWin(url) {
openUILinkIn(url, "current");
}
function getBoolPref(prefname, def)
{
try {
return Services.prefs.getBoolPref(prefname);
}
catch (er) {
return def;
}
}
/* openUILink handles clicks on UI elements that cause URLs to load.
*
* As the third argument, you may pass an object with the same properties as
@ -137,7 +127,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt )
// ignoreButton allows "middle-click paste" to use function without always opening in a new window.
var middle = !ignoreButton && e.button == 1;
var middleUsesTabs = getBoolPref("browser.tabs.opentabfor.middleclick", true);
var middleUsesTabs = Services.prefs.getBoolPref("browser.tabs.opentabfor.middleclick", true);
// Don't do anything special with right-mouse clicks. They're probably clicks on context menu items.
@ -145,7 +135,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt )
if (metaKey || (middle && middleUsesTabs))
return shift ? "tabshifted" : "tab";
if (alt && getBoolPref("browser.altClickSave", false))
if (alt && Services.prefs.getBoolPref("browser.altClickSave", false))
return "save";
if (shift || (middle && !middleUsesTabs))
@ -342,7 +332,7 @@ function openLinkIn(url, where, params) {
if (loadInBackground == null) {
loadInBackground = aFromChrome ?
false :
getBoolPref("browser.tabs.loadInBackground");
Services.prefs.getBoolPref("browser.tabs.loadInBackground");
}
let uriObj;
@ -652,7 +642,7 @@ function getShellService()
function isBidiEnabled() {
// first check the pref.
if (getBoolPref("bidi.browser.ui", false))
if (Services.prefs.getBoolPref("bidi.browser.ui", false))
return true;
// then check intl.uidirection.<locale>
@ -914,7 +904,7 @@ function openHelpLink(aHelpTopic, aCalledFromModal, aWhere) {
function openPrefsHelp() {
// non-instant apply prefwindows are usually modal, so we can't open in the topmost window,
// since its probably behind the window.
var instantApply = getBoolPref("browser.preferences.instantApply");
var instantApply = Services.prefs.getBoolPref("browser.preferences.instantApply");
var helpTopic = document.getElementsByTagName("prefwindow")[0].currentPane.helpTopic;
openHelpLink(helpTopic, !instantApply);