[Firefox addon] Remove no longer needed fallback code for older versions of Firefox
This commit is contained in:
parent
d1ffd61093
commit
08b2e25ac1
@ -93,11 +93,6 @@ function getIntPref(pref, def) {
|
||||
|
||||
function getStringPref(pref, def) {
|
||||
try {
|
||||
//#if !MOZCENTRAL
|
||||
if (!Services.prefs.getStringPref) {
|
||||
return Services.prefs.getComplexValue(pref, Ci.nsISupportsString).data;
|
||||
}
|
||||
//#endif
|
||||
return Services.prefs.getStringPref(pref);
|
||||
} catch (ex) {
|
||||
return def;
|
||||
@ -325,11 +320,6 @@ class ChromeActions {
|
||||
}
|
||||
|
||||
getLocale() {
|
||||
//#if !MOZCENTRAL
|
||||
if (!Services.locale.getRequestedLocale) {
|
||||
return getStringPref("general.useragent.locale", "en-US");
|
||||
}
|
||||
//#endif
|
||||
return Services.locale.getRequestedLocale() || "en-US";
|
||||
}
|
||||
|
||||
|
@ -74,18 +74,6 @@ var PdfjsChromeUtils = {
|
||||
this._mmg.addMessageListener("PDFJS:Parent:removeEventListener", this);
|
||||
this._mmg.addMessageListener("PDFJS:Parent:updateControlState", this);
|
||||
|
||||
//#if !MOZCENTRAL
|
||||
// The signature of `Services.obs.addObserver` changed in Firefox 55,
|
||||
// see https://bugzilla.mozilla.org/show_bug.cgi?id=1355216.
|
||||
// PLEASE NOTE: While the third parameter is now optional,
|
||||
// omitting it in prior Firefox versions breaks the addon.
|
||||
var ffVersion = parseInt(Services.appinfo.platformVersion);
|
||||
if (ffVersion <= 55) {
|
||||
// eslint-disable-next-line mozilla/no-useless-parameters
|
||||
Services.obs.addObserver(this, "quit-application", false);
|
||||
return;
|
||||
}
|
||||
//#endif
|
||||
// Observer to handle shutdown.
|
||||
Services.obs.addObserver(this, "quit-application");
|
||||
}
|
||||
@ -287,15 +275,6 @@ var PdfjsChromeUtils = {
|
||||
|
||||
_setStringPref(aPrefName, aPrefValue) {
|
||||
this._ensurePreferenceAllowed(aPrefName);
|
||||
//#if !MOZCENTRAL
|
||||
if (!Services.prefs.setStringPref) {
|
||||
let str = Cc["@mozilla.org/supports-string;1"]
|
||||
.createInstance(Ci.nsISupportsString);
|
||||
str.data = aPrefValue;
|
||||
Services.prefs.setComplexValue(aPrefName, Ci.nsISupportsString, str);
|
||||
return;
|
||||
}
|
||||
//#endif
|
||||
Services.prefs.setStringPref(aPrefName, aPrefValue);
|
||||
},
|
||||
|
||||
|
@ -45,18 +45,6 @@ var PdfjsContentUtils = {
|
||||
getService(Ci.nsISyncMessageSender);
|
||||
this._mm.addMessageListener("PDFJS:Child:updateSettings", this);
|
||||
|
||||
//#if !MOZCENTRAL
|
||||
// The signature of `Services.obs.addObserver` changed in Firefox 55,
|
||||
// see https://bugzilla.mozilla.org/show_bug.cgi?id=1355216.
|
||||
// PLEASE NOTE: While the third parameter is now optional,
|
||||
// omitting it in prior Firefox versions breaks the addon.
|
||||
var ffVersion = parseInt(Services.appinfo.platformVersion);
|
||||
if (ffVersion <= 55) {
|
||||
// eslint-disable-next-line mozilla/no-useless-parameters
|
||||
Services.obs.addObserver(this, "quit-application", false);
|
||||
return;
|
||||
}
|
||||
//#endif
|
||||
Services.obs.addObserver(this, "quit-application");
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user