fix review comments from bdahl
This commit is contained in:
parent
b607147368
commit
117582b2ea
6
extensions/firefox/bootstrap.js
vendored
6
extensions/firefox/bootstrap.js
vendored
@ -13,16 +13,16 @@ let Cu = Components.utils;
|
|||||||
|
|
||||||
Cu.import('resource://gre/modules/Services.jsm');
|
Cu.import('resource://gre/modules/Services.jsm');
|
||||||
|
|
||||||
function getBoolPref(pref, default) {
|
function getBoolPref(pref, def) {
|
||||||
try {
|
try {
|
||||||
return Services.prefs.getBoolPref(pref);
|
return Services.prefs.getBoolPref(pref);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
return default;
|
return def;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setStringPref(pref, value) {
|
function setStringPref(pref, value) {
|
||||||
let str = Cc["@mozilla.org/supports-string;1"]
|
let str = Cc['@mozilla.org/supports-string;1']
|
||||||
.createInstance(Ci.nsISupportsString);
|
.createInstance(Ci.nsISupportsString);
|
||||||
str.data = value;
|
str.data = value;
|
||||||
Services.prefs.setComplexValue(pref, Ci.nsISupportsString, str);
|
Services.prefs.setComplexValue(pref, Ci.nsISupportsString, str);
|
||||||
|
@ -21,26 +21,26 @@ let privateBrowsing = Cc['@mozilla.org/privatebrowsing;1']
|
|||||||
.getService(Ci.nsIPrivateBrowsingService);
|
.getService(Ci.nsIPrivateBrowsingService);
|
||||||
let inPrivateBrowswing = privateBrowsing.privateBrowsingEnabled;
|
let inPrivateBrowswing = privateBrowsing.privateBrowsingEnabled;
|
||||||
|
|
||||||
function getBoolPref(pref, default) {
|
function getBoolPref(pref, def) {
|
||||||
try {
|
try {
|
||||||
return Services.prefs.getBoolPref(pref);
|
return Services.prefs.getBoolPref(pref);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
return default;
|
return def;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setStringPref(pref, value) {
|
function setStringPref(pref, value) {
|
||||||
let str = Cc["@mozilla.org/supports-string;1"]
|
let str = Cc['@mozilla.org/supports-string;1']
|
||||||
.createInstance(Ci.nsISupportsString);
|
.createInstance(Ci.nsISupportsString);
|
||||||
str.data = value;
|
str.data = value;
|
||||||
Services.prefs.setComplexValue(pref, Ci.nsISupportsString, str);
|
Services.prefs.setComplexValue(pref, Ci.nsISupportsString, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStringPref(pref, default) {
|
function getStringPref(pref, def) {
|
||||||
try {
|
try {
|
||||||
return Services.prefs.getComplexValue(pref, Ci.nsISupportsString).data;
|
return Services.prefs.getComplexValue(pref, Ci.nsISupportsString).data;
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
return default;
|
return def;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user