[Pale-Moon] Issue MoonchildProductions/UXP#1828 - Stop using js expression closures in Pale Moon front-end

Stop using non-standard JS expression closures in Pale Moon front-end.
This commit is contained in:
win7-7 2022-04-23 14:51:43 +03:00 • committed by roytam1
commit 264752661b
28 changed files with 244 additions and 149 deletions

View file

@ -402,7 +402,7 @@ HandlerInfoWrapper.prototype = {
var disabledPluginTypes = this._getDisabledPluginTypes();
var type = this.type;
disabledPluginTypes = disabledPluginTypes.filter(function(v) v != type);
disabledPluginTypes = disabledPluginTypes.filter(v => v != type);
this._prefSvc.setCharPref(PREF_DISABLED_PLUGIN_TYPES,
disabledPluginTypes.join(","));
@ -1498,7 +1498,7 @@ var gApplicationsPane = {
case Ci.nsIHandlerInfo.useHelperApp:
if (preferredApp)
menu.selectedItem =
possibleAppMenuItems.filter(function(v) v.handlerApp.equals(preferredApp))[0];
possibleAppMenuItems.filter(v => v.handlerApp.equals(preferredApp))[0];
break;
case kActionUsePlugin:
menu.selectedItem = pluginMenuItem;

View file

@ -100,7 +100,9 @@ var gMainPane = {
{
let homePage = document.getElementById("browser.startup.homepage");
let tabs = this._getTabsForHomePage();
function getTabURI(t) t.linkedBrowser.currentURI.spec;
function getTabURI(t) {
return t.linkedBrowser.currentURI.spec;
}
// FIXME Bug 244192: using dangerous "|" joiner!
if (tabs.length)

View file

@ -88,8 +88,7 @@ var gPrivacyPane = {
initializeHistoryMode: function()
{
let mode;
let getVal = function(aPref)
document.getElementById(aPref).value;
let getVal = aPref => document.getElementById(aPref).value;
if (this._checkDefaultValues(this.prefsForDefault)) {
if (getVal("browser.privatebrowsing.autostart"))