|
|
@ -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; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|