From 0691dfb5ba1963cc5daa297f4b464d18448ca9dc Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 4 Nov 2021 12:37:11 +0000 Subject: [PATCH 1/5] [Basilisk] Issue MoonchildProductions/GRE#3029 - Fix search after telemetry removal. --- application/basilisk/base/content/urlbarBindings.xml | 1 - application/basilisk/components/search/content/search.xml | 2 -- 2 files changed, 3 deletions(-) diff --git a/application/basilisk/base/content/urlbarBindings.xml b/application/basilisk/base/content/urlbarBindings.xml index 511fa4dccb..9c10a7dba7 100644 --- a/application/basilisk/base/content/urlbarBindings.xml +++ b/application/basilisk/base/content/urlbarBindings.xml @@ -624,7 +624,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. } // Augment the search action details object. let details = searchActionDetails || {}; - details.isOneOff = isOneOff; details.type = eventType; let submission = engine.getSubmission(query, null, "keyword"); diff --git a/application/basilisk/components/search/content/search.xml b/application/basilisk/components/search/content/search.xml index 41a5256d50..d7ec8e2fa7 100644 --- a/application/basilisk/components/search/content/search.xml +++ b/application/basilisk/components/search/content/search.xml @@ -1940,8 +1940,6 @@ aOpenUILinkParams && aOpenUILinkParams.inBackground; let where = tabBackground ? "tab-background" : aOpenUILinkWhere; - BrowserSearch.recordOneoffSearchInTelemetry(engine, source, type, - where); return true; ]]> From 5d7a2b879335fc3f42c0777b24bdc05ef8c90849 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Wed, 12 Jan 2022 20:47:54 -0600 Subject: [PATCH 2/5] [Pale-Moon] No Issue - ifdef hide/showChrome sync-notifications code --- application/palemoon/base/content/browser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index f5cc4913f9..fa4180f845 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -2632,12 +2632,14 @@ var PrintPreviewListener = { this._chromeState.globalNotificationsOpen = !globalNotificationBox.notificationsHidden; globalNotificationBox.notificationsHidden = true; +#ifdef MOZ_SERVICES_SYNC this._chromeState.syncNotificationsOpen = false; var syncNotifications = document.getElementById("sync-notifications"); if (syncNotifications) { this._chromeState.syncNotificationsOpen = !syncNotifications.notificationsHidden; syncNotifications.notificationsHidden = true; } +#endif }, _showChrome: function() { @@ -2658,9 +2660,11 @@ var PrintPreviewListener = { document.getElementById("global-notificationbox").notificationsHidden = false; } +#ifdef MOZ_SERVICES_SYNC if (this._chromeState.syncNotificationsOpen) { document.getElementById("sync-notifications").notificationsHidden = false; } +#endif } } From 8a2431fffb1183fdb94bc0549c4100461a71c861 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 13 Jan 2022 11:04:21 +0000 Subject: [PATCH 3/5] [Pale-Moon] [win system] Update the list of delayed-loaded dlls Primarily for those who custom-install and somehow mess up directory permissions exposing themselves to dll injection attacks. Also removes esent since we no longer import anything from it. --- application/palemoon/components/build/moz.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/palemoon/components/build/moz.build b/application/palemoon/components/build/moz.build index 26f2d14237..af0abde293 100644 --- a/application/palemoon/components/build/moz.build +++ b/application/palemoon/components/build/moz.build @@ -17,7 +17,6 @@ LOCAL_INCLUDES += [ if CONFIG['OS_ARCH'] == 'WINNT': OS_LIBS += [ - 'esent', 'netapi32', 'ole32', 'shell32', @@ -25,8 +24,9 @@ if CONFIG['OS_ARCH'] == 'WINNT': 'version', ] DELAYLOAD_DLLS += [ - 'esent.dll', 'netapi32.dll', + 'advapi32.dll', + 'ole32.dll', ] # GTK: Need to link with glib for GNOME shell service From e349f9b88470626a45e90f559609e412c678eb0a Mon Sep 17 00:00:00 2001 From: Moonchild Date: Mon, 4 Apr 2022 13:36:02 +0200 Subject: [PATCH 4/5] [Pale-Moon] Issue MoonchildProductions/UXP#21 - Fix up start-up timeline instrumentation. --- application/palemoon/app/nsBrowserApp.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/application/palemoon/app/nsBrowserApp.cpp b/application/palemoon/app/nsBrowserApp.cpp index 12db297f33..028113d0c7 100644 --- a/application/palemoon/app/nsBrowserApp.cpp +++ b/application/palemoon/app/nsBrowserApp.cpp @@ -36,6 +36,7 @@ #include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL +#include "mozilla/StartupTimeline.h" #include "mozilla/Sprintf.h" #include "mozilla/WindowsDllBlocklist.h" From 264752661b9c03cc520f1c2f3aeb9b9a021997f9 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Sat, 23 Apr 2022 14:51:43 +0300 Subject: [PATCH 5/5] [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. --- .../palemoon/base/content/browser-places.js | 4 +- .../palemoon/base/content/browser-syncui.js | 2 +- application/palemoon/base/content/browser.js | 10 +- .../palemoon/base/content/tabbrowser.xml | 12 +- .../palemoon/components/distribution.js | 10 +- .../components/downloads/DownloadsCommon.jsm | 4 +- .../components/downloads/DownloadsViewUI.jsm | 4 +- .../content/allDownloadsViewOverlay.js | 45 ++++++-- .../components/downloads/content/downloads.js | 29 +++-- .../components/downloads/content/indicator.js | 5 +- .../components/fuel/fuelApplication.js | 10 +- .../components/nsBrowserContentHandler.js | 2 +- .../components/places/PlacesUIUtils.jsm | 104 +++++++++--------- .../places/content/bookmarksPanel.js | 3 +- .../places/content/browserPlacesViews.js | 40 +++++-- .../components/places/content/controller.js | 16 ++- .../places/content/downloadsViewOverlay.xul | 2 +- .../places/content/editBookmarkOverlay.js | 4 +- .../places/content/history-panel.js | 3 +- .../components/places/content/places.js | 24 ++-- .../components/places/content/treeView.js | 24 +++- .../components/preferences/applications.js | 4 +- .../palemoon/components/preferences/main.js | 4 +- .../components/preferences/privacy.js | 3 +- .../components/sessionstore/SessionStore.jsm | 4 +- application/palemoon/components/sync/setup.js | 7 +- .../modules/Windows8WindowFrameColor.jsm | 2 +- .../palemoon/modules/WindowsJumpLists.jsm | 12 +- 28 files changed, 244 insertions(+), 149 deletions(-) diff --git a/application/palemoon/base/content/browser-places.js b/application/palemoon/base/content/browser-places.js index 6fec2242fb..7130f7f28a 100644 --- a/application/palemoon/base/content/browser-places.js +++ b/application/palemoon/base/content/browser-places.js @@ -34,7 +34,7 @@ var StarUI = { get _blockedCommands() { delete this._blockedCommands; return this._blockedCommands = - ["cmd_close", "cmd_closeWindow"].map(function(id) this._element(id), this); + ["cmd_close", "cmd_closeWindow"].map(id => this._element(id)); }, _blockCommands: function() { @@ -1258,7 +1258,7 @@ var BookmarkingUI = { // calls back. For such an edge case, retain all unique entries from both // arrays. this._itemIds = this._itemIds.filter( - function(id) aItemIds.indexOf(id) == -1 + id => aItemIds.indexOf(id) == -1 ).concat(aItemIds); this._updateStar(); diff --git a/application/palemoon/base/content/browser-syncui.js b/application/palemoon/base/content/browser-syncui.js index c1995f8b63..4a4214a0fc 100644 --- a/application/palemoon/base/content/browser-syncui.js +++ b/application/palemoon/base/content/browser-syncui.js @@ -220,7 +220,7 @@ var gSyncUI = { // Commands doSync: function() { - setTimeout(function() Weave.Service.errorHandler.syncAndReportErrors(), 0); + setTimeout(() => Weave.Service.errorHandler.syncAndReportErrors(), 0); }, handleToolbarButton: function() { diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index fa4180f845..4521436063 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -1472,7 +1472,7 @@ var gBrowserInit = { let itemArray = itemBranch.getChildList(""); // See if any privacy.item prefs are set - let doMigrate = itemArray.some(function(name) itemBranch.prefHasUserValue(name)); + let doMigrate = itemArray.some(name => itemBranch.prefHasUserValue(name)); // Or if sanitizeOnShutdown is set if (!doMigrate) { doMigrate = gPrefService.getBoolPref("privacy.sanitize.sanitizeOnShutdown"); @@ -2955,7 +2955,7 @@ const BrowserSearch = { // Check to see whether we've already added an engine with this title if (browser.engines) { - if (browser.engines.some(function(e) e.title == engine.title)) { + if (browser.engines.some(e => e.title == engine.title)) { return; } } @@ -4420,7 +4420,7 @@ nsBrowserAccess.prototype = { }, isTabContentWindow: function(aWindow) { - return gBrowser.browsers.some(function(browser) browser.contentWindow == aWindow); + return gBrowser.browsers.some(browser => browser.contentWindow == aWindow); } } @@ -4664,8 +4664,8 @@ var TabsInTitlebar = { }, _update: function() { - function $(id) document.getElementById(id); - function rect(ele) ele.getBoundingClientRect(); + let $ = id => document.getElementById(id); + let rect = ele => ele.getBoundingClientRect(); if (!this._initialized || window.fullScreen) { return; diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index a5d9a4af0f..93d17e305e 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -55,7 +55,7 @@ !tab.hidden && !tab.closing); return this._visibleTabs; ]]> @@ -2493,7 +2493,7 @@ l != aListener); ]]> @@ -2510,7 +2510,7 @@ l != aListener); ]]> @@ -2627,7 +2627,7 @@ tab.linkedBrowser)); ]]> @@ -4584,7 +4584,9 @@ // positioned relative to the corner of the new window created upon // dragend such that the mouse appears to have the same position // relative to the corner of the dragged tab. - function clientX(ele) ele.getBoundingClientRect().left; + function clientX(ele) { + return ele.getBoundingClientRect().left; + } let tabOffsetX = clientX(tab) - clientX(this); tab._dragData = { offsetX: event.screenX - window.screenX - tabOffsetX, diff --git a/application/palemoon/components/distribution.js b/application/palemoon/components/distribution.js index 86ab6e7487..88d2b3f587 100644 --- a/application/palemoon/components/distribution.js +++ b/application/palemoon/components/distribution.js @@ -34,33 +34,33 @@ DistributionCustomizer.prototype = { let ini = Cc["@mozilla.org/xpcom/ini-parser-factory;1"] .getService(Ci.nsIINIParserFactory) .createINIParser(this._iniFile); - this.__defineGetter__("_ini", function() ini); + this.__defineGetter__("_ini", () => ini); return this._ini; }, get _locale() { let locale = this._prefs.getCharPref("general.useragent.locale", "en-US"); - this.__defineGetter__("_locale", function() locale); + this.__defineGetter__("_locale", () => locale); return this._locale; }, get _prefSvc() { let svc = Cc["@mozilla.org/preferences-service;1"] .getService(Ci.nsIPrefService); - this.__defineGetter__("_prefSvc", function() svc); + this.__defineGetter__("_prefSvc", () => svc); return this._prefSvc; }, get _prefs() { let branch = this._prefSvc.getBranch(null); - this.__defineGetter__("_prefs", function() branch); + this.__defineGetter__("_prefs", () => branch); return this._prefs; }, get _ioSvc() { let svc = Cc["@mozilla.org/network/io-service;1"] .getService(Ci.nsIIOService); - this.__defineGetter__("_ioSvc", function() svc); + this.__defineGetter__("_ioSvc", () => svc); return this._ioSvc; }, diff --git a/application/palemoon/components/downloads/DownloadsCommon.jsm b/application/palemoon/components/downloads/DownloadsCommon.jsm index 53287e34e9..920d1cff35 100644 --- a/application/palemoon/components/downloads/DownloadsCommon.jsm +++ b/application/palemoon/components/downloads/DownloadsCommon.jsm @@ -678,7 +678,9 @@ DownloadsDataCtor.prototype = { * Iterator for all the available Download objects. This is empty until the * data has been loaded using the JavaScript API for downloads. */ - get downloads() this.oldDownloadStates.keys(), + get downloads() { + return this.oldDownloadStates.keys(); + }, /** * True if there are finished downloads that can be removed from the list. diff --git a/application/palemoon/components/downloads/DownloadsViewUI.jsm b/application/palemoon/components/downloads/DownloadsViewUI.jsm index 0220e566f3..7471925d9c 100644 --- a/application/palemoon/components/downloads/DownloadsViewUI.jsm +++ b/application/palemoon/components/downloads/DownloadsViewUI.jsm @@ -169,7 +169,9 @@ this.DownloadsViewUI.DownloadElementShell.prototype = { * returned by a single property because they are computed together. The * result may be overridden by derived objects. */ - get statusTextAndTip() this.rawStatusTextAndTip, + get statusTextAndTip() { + return this.rawStatusTextAndTip; + }, /** * Derived objects may call this to get the status text. diff --git a/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js b/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js index b17e2b14a3..824e9932ab 100644 --- a/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js +++ b/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js @@ -220,16 +220,22 @@ HistoryDownloadElementShell.prototype = { this._updateUI(); } }, - get active() !!this._active, + get active() { + return !!this._active; + }, /** * Overrides the base getter to return the Download or HistoryDownload object * for displaying information and executing commands in the user interface. */ - get download() this._sessionDownload || this._historyDownload, + get download() { + return this._sessionDownload || this._historyDownload; + }, _sessionDownload: null, - get sessionDownload() this._sessionDownload, + get sessionDownload() { + return this._sessionDownload; + }, set sessionDownload(aValue) { if (this._sessionDownload != aValue) { if (!aValue && !this._historyDownload) { @@ -245,7 +251,9 @@ HistoryDownloadElementShell.prototype = { }, _historyDownload: null, - get historyDownload() this._historyDownload, + get historyDownload() { + return this._historyDownload; + }, set historyDownload(aValue) { if (this._historyDownload != aValue) { if (!aValue && !this._sessionDownload) { @@ -525,9 +533,14 @@ function DownloadsPlacesView(aRichListBox, aActive = true) { } DownloadsPlacesView.prototype = { - get associatedElement() this._richlistbox, + get associatedElement() { + return this._richlistbox; + }, + - get active() this._active, + get active() { + return this._active; + }, set active(val) { this._active = val; if (this._active) @@ -902,7 +915,9 @@ DownloadsPlacesView.prototype = { }, _place: "", - get place() this._place, + get place() { + return this._place; + }, set place(val) { // Don't reload everything if we don't have to. if (this._place == val) { @@ -926,7 +941,9 @@ DownloadsPlacesView.prototype = { }, _result: null, - get result() this._result, + get result() { + return this._result; + }, set result(val) { if (this._result == val) return val; @@ -961,7 +978,9 @@ DownloadsPlacesView.prototype = { return selectedNodes.length == 1 ? selectedNodes[0] : null; }, - get hasSelection() this.selectedNodes.length > 0, + get hasSelection() { + return this.selectedNodes.length > 0; + }, containerStateChanged: function(aNode, aOldState, aNewState) { @@ -1058,9 +1077,13 @@ DownloadsPlacesView.prototype = { nodeURIChanged: function() {}, batching: function() {}, - get controller() this._richlistbox.controller, + get controller() { + return this._richlistbox.controller; + }, - get searchTerm() this._searchTerm, + get searchTerm() { + return this._searchTerm; + }, set searchTerm(aValue) { if (this._searchTerm != aValue) { for (let element of this._richlistbox.childNodes) { diff --git a/application/palemoon/components/downloads/content/downloads.js b/application/palemoon/components/downloads/content/downloads.js index 7a2ba9feeb..44838c5f94 100644 --- a/application/palemoon/components/downloads/content/downloads.js +++ b/application/palemoon/components/downloads/content/downloads.js @@ -97,22 +97,33 @@ const DownloadsPanel = { _state: 0, /** The panel is not linked to downloads data yet. */ - get kStateUninitialized() 0, + get kStateUninitialized() { + return 0; + }, /** This object is linked to data, but the panel is invisible. */ - get kStateHidden() 1, + get kStateHidden() { + return 1; + }, /** The panel will be shown as soon as possible. */ - get kStateWaitingData() 2, + get kStateWaitingData() { + return 2; + }, /** The panel is almost shown - we're just waiting to get a handle on the anchor. */ - get kStateWaitingAnchor() 3, + get kStateWaitingAnchor() { + return 3; + }, /** The panel is open. */ - get kStateShown() 4, + get kStateShown() { + return 4; + }, /** * Location of the panel overlay. */ - get kDownloadsOverlay() - "chrome://browser/content/downloads/downloadsOverlay.xul", + get kDownloadsOverlay() { + return "chrome://browser/content/downloads/downloadsOverlay.xul"; + }, /** * Starts loading the download data in background, without opening the panel. @@ -1388,7 +1399,9 @@ const DownloadsSummary = { /** * Returns the active state of the downloads summary. */ - get active() this._active, + get active() { + return this._active; + }, _active: false, diff --git a/application/palemoon/components/downloads/content/indicator.js b/application/palemoon/components/downloads/content/indicator.js index 077699243e..66095519da 100644 --- a/application/palemoon/components/downloads/content/indicator.js +++ b/application/palemoon/components/downloads/content/indicator.js @@ -39,8 +39,9 @@ const DownloadsButton = { /** * Location of the indicator overlay. */ - get kIndicatorOverlay() - "chrome://browser/content/downloads/indicatorOverlay.xul", + get kIndicatorOverlay() { + return "chrome://browser/content/downloads/indicatorOverlay.xul"; + }, /** * Returns a reference to the downloads button position placeholder, or null diff --git a/application/palemoon/components/fuel/fuelApplication.js b/application/palemoon/components/fuel/fuelApplication.js index 4b9550d4a9..a4b2d28134 100644 --- a/application/palemoon/components/fuel/fuelApplication.js +++ b/application/palemoon/components/fuel/fuelApplication.js @@ -18,34 +18,34 @@ var Utilities = { get bookmarks() { let bookmarks = Cc["@mozilla.org/browser/nav-bookmarks-service;1"]. getService(Ci.nsINavBookmarksService); - this.__defineGetter__("bookmarks", function() bookmarks); + this.__defineGetter__("bookmarks", () => bookmarks); return this.bookmarks; }, get bookmarksObserver() { let bookmarksObserver = new BookmarksObserver(); - this.__defineGetter__("bookmarksObserver", function() bookmarksObserver); + this.__defineGetter__("bookmarksObserver", () => bookmarksObserver); return this.bookmarksObserver; }, get annotations() { let annotations = Cc["@mozilla.org/browser/annotation-service;1"]. getService(Ci.nsIAnnotationService); - this.__defineGetter__("annotations", function() annotations); + this.__defineGetter__("annotations", () => annotations); return this.annotations; }, get history() { let history = Cc["@mozilla.org/browser/nav-history-service;1"]. getService(Ci.nsINavHistoryService); - this.__defineGetter__("history", function() history); + this.__defineGetter__("history", () => history); return this.history; }, get windowMediator() { let windowMediator = Cc["@mozilla.org/appshell/window-mediator;1"]. getService(Ci.nsIWindowMediator); - this.__defineGetter__("windowMediator", function() windowMediator); + this.__defineGetter__("windowMediator", () => windowMediator); return this.windowMediator; }, diff --git a/application/palemoon/components/nsBrowserContentHandler.js b/application/palemoon/components/nsBrowserContentHandler.js index 7ddda55815..0f332f267f 100644 --- a/application/palemoon/components/nsBrowserContentHandler.js +++ b/application/palemoon/components/nsBrowserContentHandler.js @@ -781,7 +781,7 @@ nsDefaultCommandLineHandler.prototype = { } catch(e) {} } - var URLlist = urilist.filter(shouldLoadURI).map(function(u) u.spec); + var URLlist = urilist.filter(shouldLoadURI).map(u => u.spec); if (URLlist.length) { openWindow(null, gBrowserContentHandler.chromeURL, "_blank", "chrome,dialog=no,all" + gBrowserContentHandler.getFeatures(cmdLine), diff --git a/application/palemoon/components/places/PlacesUIUtils.jsm b/application/palemoon/components/places/PlacesUIUtils.jsm index 8a7d4a00f1..51e6f6c1b5 100644 --- a/application/palemoon/components/places/PlacesUIUtils.jsm +++ b/application/palemoon/components/places/PlacesUIUtils.jsm @@ -79,12 +79,14 @@ this.PlacesUIUtils = { return bundle.GetStringFromName(key); }, - get _copyableAnnotations() [ - this.DESCRIPTION_ANNO, - this.LOAD_IN_SIDEBAR_ANNO, - PlacesUtils.POST_DATA_ANNO, - PlacesUtils.READ_ONLY_ANNO, - ], + get _copyableAnnotations() { + return [ + this.DESCRIPTION_ANNO, + this.LOAD_IN_SIDEBAR_ANNO, + PlacesUtils.POST_DATA_ANNO, + PlacesUtils.READ_ONLY_ANNO, + ]; + }, /** * Get a transaction for copying a uri item (either a bookmark or a history @@ -1219,71 +1221,71 @@ XPCOMUtils.defineLazyGetter(PlacesUIUtils, "ptm", function() { PlacesUtils; return { - aggregateTransactions: function(aName, aTransactions) + aggregateTransactions: (aName, aTransactions) => new PlacesAggregatedTransaction(aName, aTransactions), - createFolder: function(aName, aContainer, aIndex, aAnnotations, - aChildItemsTransactions) + createFolder: (aName, aContainer, aIndex, aAnnotations, + aChildItemsTransactions) => new PlacesCreateFolderTransaction(aName, aContainer, aIndex, aAnnotations, aChildItemsTransactions), - createItem: function(aURI, aContainer, aIndex, aTitle, aKeyword, - aAnnotations, aChildTransactions) + createItem: (aURI, aContainer, aIndex, aTitle, aKeyword, + aAnnotations, aChildTransactions) => new PlacesCreateBookmarkTransaction(aURI, aContainer, aIndex, aTitle, aKeyword, aAnnotations, aChildTransactions), - createSeparator: function(aContainer, aIndex) + createSeparator: (aContainer, aIndex) => new PlacesCreateSeparatorTransaction(aContainer, aIndex), - createLivemark: function(aFeedURI, aSiteURI, aName, aContainer, aIndex, - aAnnotations) + createLivemark: (aFeedURI, aSiteURI, aName, aContainer, aIndex, + aAnnotations) => new PlacesCreateLivemarkTransaction(aFeedURI, aSiteURI, aName, aContainer, aIndex, aAnnotations), - moveItem: function(aItemId, aNewContainer, aNewIndex) + moveItem: (aItemId, aNewContainer, aNewIndex) => new PlacesMoveItemTransaction(aItemId, aNewContainer, aNewIndex), - removeItem: function(aItemId) + removeItem: (aItemId) => new PlacesRemoveItemTransaction(aItemId), - editItemTitle: function(aItemId, aNewTitle) + editItemTitle: (aItemId, aNewTitle) => new PlacesEditItemTitleTransaction(aItemId, aNewTitle), - editBookmarkURI: function(aItemId, aNewURI) + editBookmarkURI: (aItemId, aNewURI) => new PlacesEditBookmarkURITransaction(aItemId, aNewURI), - setItemAnnotation: function(aItemId, aAnnotationObject) + setItemAnnotation: (aItemId, aAnnotationObject) => new PlacesSetItemAnnotationTransaction(aItemId, aAnnotationObject), - setPageAnnotation: function(aURI, aAnnotationObject) + setPageAnnotation: (aURI, aAnnotationObject) => new PlacesSetPageAnnotationTransaction(aURI, aAnnotationObject), - editBookmarkKeyword: function(aItemId, aNewKeyword) + editBookmarkKeyword: (aItemId, aNewKeyword) => new PlacesEditBookmarkKeywordTransaction(aItemId, aNewKeyword), - editBookmarkPostData: function(aItemId, aPostData) + editBookmarkPostData: (aItemId, aPostData) => new PlacesEditBookmarkPostDataTransaction(aItemId, aPostData), - editLivemarkSiteURI: function(aLivemarkId, aSiteURI) + editLivemarkSiteURI: (aLivemarkId, aSiteURI) => new PlacesEditLivemarkSiteURITransaction(aLivemarkId, aSiteURI), - editLivemarkFeedURI: function(aLivemarkId, aFeedURI) + editLivemarkFeedURI: (aLivemarkId, aFeedURI) => new PlacesEditLivemarkFeedURITransaction(aLivemarkId, aFeedURI), - editItemDateAdded: function(aItemId, aNewDateAdded) + editItemDateAdded: (aItemId, aNewDateAdded) => new PlacesEditItemDateAddedTransaction(aItemId, aNewDateAdded), - editItemLastModified: function(aItemId, aNewLastModified) + editItemLastModified: (aItemId, aNewLastModified) => new PlacesEditItemLastModifiedTransaction(aItemId, aNewLastModified), - sortFolderByName: function(aFolderId) + sortFolderByName: (aFolderId) => new PlacesSortFolderByNameTransaction(aFolderId), - tagURI: function(aURI, aTags) + tagURI: (aURI, aTags) => new PlacesTagURITransaction(aURI, aTags), - untagURI: function(aURI, aTags) + untagURI: (aURI, aTags) => new PlacesUntagURITransaction(aURI, aTags), /** @@ -1327,49 +1329,53 @@ XPCOMUtils.defineLazyGetter(PlacesUIUtils, "ptm", function() { //////////////////////////////////////////////////////////////////////////// //// nsITransactionManager forwarders. - beginBatch: function() + beginBatch: () => PlacesUtils.transactionManager.beginBatch(null), - endBatch: function() + endBatch: () => PlacesUtils.transactionManager.endBatch(false), - doTransaction: function(txn) + doTransaction: (txn) => PlacesUtils.transactionManager.doTransaction(txn), - undoTransaction: function() + undoTransaction: () => PlacesUtils.transactionManager.undoTransaction(), - redoTransaction: function() + redoTransaction: () => PlacesUtils.transactionManager.redoTransaction(), - get numberOfUndoItems() - PlacesUtils.transactionManager.numberOfUndoItems, - get numberOfRedoItems() - PlacesUtils.transactionManager.numberOfRedoItems, - get maxTransactionCount() - PlacesUtils.transactionManager.maxTransactionCount, - set maxTransactionCount(val) - PlacesUtils.transactionManager.maxTransactionCount = val, + get numberOfUndoItems() { + return PlacesUtils.transactionManager.numberOfUndoItems; + }, + get numberOfRedoItems() { + return PlacesUtils.transactionManager.numberOfRedoItems; + }, + get maxTransactionCount() { + return PlacesUtils.transactionManager.maxTransactionCount; + }, + set maxTransactionCount(val) { + PlacesUtils.transactionManager.maxTransactionCount = val; + }, - clear: function() + clear: () => PlacesUtils.transactionManager.clear(), - peekUndoStack: function() + peekUndoStack: () => PlacesUtils.transactionManager.peekUndoStack(), - peekRedoStack: function() + peekRedoStack: () => PlacesUtils.transactionManager.peekRedoStack(), - getUndoStack: function() + getUndoStack: () => PlacesUtils.transactionManager.getUndoStack(), - getRedoStack: function() + getRedoStack: () => PlacesUtils.transactionManager.getRedoStack(), - AddListener: function(aListener) + AddListener: (aListener) => PlacesUtils.transactionManager.AddListener(aListener), - RemoveListener: function(aListener) + RemoveListener: (aListener) => PlacesUtils.transactionManager.RemoveListener(aListener) } }); diff --git a/application/palemoon/components/places/content/bookmarksPanel.js b/application/palemoon/components/places/content/bookmarksPanel.js index c964bd094b..ce8196b52b 100644 --- a/application/palemoon/components/places/content/bookmarksPanel.js +++ b/application/palemoon/components/places/content/bookmarksPanel.js @@ -20,6 +20,5 @@ function searchBookmarks(aSearchString) { } window.addEventListener("SidebarFocused", - function() - document.getElementById("search-box").focus(), + () => document.getElementById("search-box").focus(), false); diff --git a/application/palemoon/components/places/content/browserPlacesViews.js b/application/palemoon/components/places/content/browserPlacesViews.js index a80e5f8170..a92c18eefa 100644 --- a/application/palemoon/components/places/content/browserPlacesViews.js +++ b/application/palemoon/components/places/content/browserPlacesViews.js @@ -18,11 +18,17 @@ function PlacesViewBase(aPlace) { PlacesViewBase.prototype = { // The xul element that holds the entire view. _viewElt: null, - get viewElt() this._viewElt, + get viewElt() { + return this._viewElt; + }, - get associatedElement() this._viewElt, + get associatedElement() { + return this._viewElt; + }, - get controllers() this._viewElt.controllers, + get controllers() { + return this._viewElt.controllers; + }, // The xul element that represents the root container. _rootElt: null, @@ -36,7 +42,9 @@ PlacesViewBase.prototype = { Components.interfaces.nsISupportsWeakReference]), _place: "", - get place() this._place, + get place() { + return this._place; + }, set place(val) { this._place = val; @@ -53,7 +61,9 @@ PlacesViewBase.prototype = { }, _result: null, - get result() this._result, + get result() { + return this._result; + }, set result(val) { if (this._result == val) return val; @@ -101,9 +111,13 @@ PlacesViewBase.prototype = { return node; }, - get controller() this._controller, + get controller() { + return this._controller; + }, - get selType() "single", + get selType() { + return "single"; + }, selectItems: function() { }, selectAll: function() { }, @@ -122,7 +136,9 @@ PlacesViewBase.prototype = { return null; }, - get hasSelection() this.selectedNode != null, + get hasSelection() { + return this.selectedNode != null; + }, get selectedNodes() { let selectedNode = this.selectedNode; @@ -140,7 +156,9 @@ PlacesViewBase.prototype = { return [this.selectedNodes]; }, - get draggableSelection() [this._draggedElt], + get draggableSelection() { + return [this._draggedElt]; + }, get insertionPoint() { // There is no insertion point for history queries, so bail out now and @@ -706,7 +724,9 @@ PlacesViewBase.prototype = { .direction == "rtl"; }, - get ownerWindow() window, + get ownerWindow() { + return window; + }, /** * Adds an "Open All in Tabs" menuitem to the bottom of the popup. diff --git a/application/palemoon/components/places/content/controller.js b/application/palemoon/components/places/content/controller.js index 33312330f5..1224d27b25 100644 --- a/application/palemoon/components/places/content/controller.js +++ b/application/palemoon/components/places/content/controller.js @@ -1437,7 +1437,9 @@ PlacesController.prototype = { }, _cutNodes: [], - get cutNodes() this._cutNodes, + get cutNodes() { + return this._cutNodes; + }, set cutNodes(aNodes) { let self = this; function updateCutNodes(aValue) { @@ -1506,7 +1508,7 @@ PlacesController.prototype = { [ PlacesUtils.TYPE_X_MOZ_PLACE, PlacesUtils.TYPE_X_MOZ_URL, PlacesUtils.TYPE_UNICODE, - ].forEach(function(type) xferable.addDataFlavor(type)); + ].forEach(type => xferable.addDataFlavor(type)); this.clipboard.getData(xferable, Ci.nsIClipboard.kGlobalClipboard); @@ -1583,8 +1585,9 @@ PlacesController.prototype = { * @return true if there's a cached mozILivemarkInfo object for * aNode, false otherwise. */ - hasCachedLivemarkInfo: function(aNode) - this._cachedLivemarkInfoObjects.has(aNode), + hasCachedLivemarkInfo: function(aNode) { + return this._cachedLivemarkInfoObjects.has(aNode) + }, /** * Returns the cached livemark info for a node, if set by cacheLivemarkInfo, @@ -1593,8 +1596,9 @@ PlacesController.prototype = { * a places result node. * @return the mozILivemarkInfo object for aNode, if set, null otherwise. */ - getCachedLivemarkInfo: function(aNode) - this._cachedLivemarkInfoObjects.get(aNode, null) + getCachedLivemarkInfo: function(aNode) { + return this._cachedLivemarkInfoObjects.get(aNode, null) + } }; /** diff --git a/application/palemoon/components/places/content/downloadsViewOverlay.xul b/application/palemoon/components/places/content/downloadsViewOverlay.xul index 1a44dfdc0c..93d395e763 100644 --- a/application/palemoon/components/places/content/downloadsViewOverlay.xul +++ b/application/palemoon/components/places/content/downloadsViewOverlay.xul @@ -19,7 +19,7 @@ Components.interfaces.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING; ContentArea.setContentViewForQueryString(DOWNLOADS_QUERY, - function() new DownloadsPlacesView(document.getElementById("downloadsRichListBox"), false), + () => new DownloadsPlacesView(document.getElementById("downloadsRichListBox"), false), { showDetailsPane: false, toolbarSet: "back-button, forward-button, organizeButton, clearDownloadsButton, libraryToolbarSpacer, searchFilter" }); ]]> diff --git a/application/palemoon/components/places/content/editBookmarkOverlay.js b/application/palemoon/components/places/content/editBookmarkOverlay.js index fcc5f5cae0..55a95c58ab 100644 --- a/application/palemoon/components/places/content/editBookmarkOverlay.js +++ b/application/palemoon/components/places/content/editBookmarkOverlay.js @@ -709,7 +709,7 @@ var gEditItemOverlay = { this._folderMenuList.selectedItem = item; // XXXmano HACK: setTimeout 100, otherwise focus goes back to the // menulist right away - setTimeout(function(self) self.toggleFolderTreeVisibility(), 100, this); + setTimeout(() => this.toggleFolderTreeVisibility(), 100); return; } @@ -873,7 +873,7 @@ var gEditItemOverlay = { let tags = this._element("tagsField").value; return tags.trim() .split(/\s*,\s*/) // Split on commas and remove spaces. - .filter(function(tag) tag.length > 0); // Kill empty tags. + .filter(tag => tag.length > 0); // Kill empty tags. }, newFolder: function() { diff --git a/application/palemoon/components/places/content/history-panel.js b/application/palemoon/components/places/content/history-panel.js index cda39dd266..a8a48b58eb 100644 --- a/application/palemoon/components/places/content/history-panel.js +++ b/application/palemoon/components/places/content/history-panel.js @@ -86,6 +86,5 @@ function searchHistory(aInput) } window.addEventListener("SidebarFocused", - function() - gSearchBox.focus(), + () => gSearchBox.focus(), false); diff --git a/application/palemoon/components/places/content/places.js b/application/palemoon/components/places/content/places.js index a2339adfeb..6904f1859e 100644 --- a/application/palemoon/components/places/content/places.js +++ b/application/palemoon/components/places/content/places.js @@ -555,7 +555,7 @@ var PlacesOrganizer = { infoBox.setAttribute("minimal", "true"); infoBox.removeAttribute("wasminimal"); infoBoxExpanderWrapper.hidden = - this._additionalInfoFields.every(function(id) + this._additionalInfoFields.every(id => document.getElementById(id).collapsed); } additionalInfoBroadcaster.hidden = infoBox.getAttribute("minimal") == "true"; @@ -1416,7 +1416,9 @@ var ContentArea = { options: aOptions || new Object() }); }, - get currentView() PlacesUIUtils.getViewForNode(this._deck.selectedPanel), + get currentView() { + return PlacesUIUtils.getViewForNode(this._deck.selectedPanel); + }, set currentView(aNewView) { let oldView = this.currentView; if (oldView != aNewView) { @@ -1430,7 +1432,9 @@ var ContentArea = { return aNewView; }, - get currentPlace() this.currentView.place, + get currentPlace() { + return this.currentView.place; + }, set currentPlace(aQueryString) { let oldView = this.currentView; let newView = this.getContentViewForQueryString(aQueryString); @@ -1495,12 +1499,16 @@ var ContentTree = { this._view = document.getElementById("placeContent"); }, - get view() this._view, + get view() { + return this._view; + }, - get viewOptions() Object.seal({ - showDetailsPane: true, - toolbarSet: "back-button, forward-button, organizeButton, viewMenu, maintenanceButton, libraryToolbarSpacer, searchFilter" - }), + get viewOptions() { + return Object.seal({ + showDetailsPane: true, + toolbarSet: "back-button, forward-button, organizeButton, viewMenu, maintenanceButton, libraryToolbarSpacer, searchFilter" + }); + }, openSelectedNode: function(aEvent) { let view = this.view; diff --git a/application/palemoon/components/places/content/treeView.js b/application/palemoon/components/places/content/treeView.js index db31ceebe0..acaf12e1ee 100644 --- a/application/palemoon/components/places/content/treeView.js +++ b/application/palemoon/components/places/content/treeView.js @@ -21,7 +21,9 @@ function PlacesTreeView(aFlatList, aOnOpenFlatContainer, aController) { } PlacesTreeView.prototype = { - get wrappedJSObject() this, + get wrappedJSObject() { + return this; + }, __dateService: null, get _dateService() { @@ -1080,7 +1082,9 @@ PlacesTreeView.prototype = { } }, - get result() this._result, + get result() { + return this._result; + }, set result(val) { if (this._result) { this._result.removeObserver(this); @@ -1132,9 +1136,15 @@ PlacesTreeView.prototype = { }, // nsITreeView - get rowCount() this._rows.length, - get selection() this._selection, - set selection(val) this._selection = val, + get rowCount() { + return this._rows.length; + }, + get selection() { + return this._selection; + }, + set selection(val) { + this._selection = val; + }, getRowProperties: function() { return ""; }, @@ -1405,7 +1415,9 @@ PlacesTreeView.prototype = { return false; }, - getLevel: function(aRow) this._getNodeForRow(aRow).indentLevel, + getLevel: function(aRow) { + return this._getNodeForRow(aRow).indentLevel; + }, getImageSrc: function(aRow, aColumn) { // Only the title column has an image. diff --git a/application/palemoon/components/preferences/applications.js b/application/palemoon/components/preferences/applications.js index 3751ee7325..c17894d449 100644 --- a/application/palemoon/components/preferences/applications.js +++ b/application/palemoon/components/preferences/applications.js @@ -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; diff --git a/application/palemoon/components/preferences/main.js b/application/palemoon/components/preferences/main.js index 1fc46679de..c26a7b0c87 100644 --- a/application/palemoon/components/preferences/main.js +++ b/application/palemoon/components/preferences/main.js @@ -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) diff --git a/application/palemoon/components/preferences/privacy.js b/application/palemoon/components/preferences/privacy.js index 05ed3bcdd3..cdb8f868f3 100644 --- a/application/palemoon/components/preferences/privacy.js +++ b/application/palemoon/components/preferences/privacy.js @@ -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")) diff --git a/application/palemoon/components/sessionstore/SessionStore.jsm b/application/palemoon/components/sessionstore/SessionStore.jsm index 654f9e8793..084af92240 100644 --- a/application/palemoon/components/sessionstore/SessionStore.jsm +++ b/application/palemoon/components/sessionstore/SessionStore.jsm @@ -3982,8 +3982,8 @@ var SessionStoreInternal = { */ _isCmdLineEmpty: function(aWindow, aState) { var pinnedOnly = aState.windows && - aState.windows.every(function(win) - win.tabs.every(function(tab) tab.pinned)); + aState.windows.every(win => + win.tabs.every(tab => tab.pinned)); let hasFirstArgument = aWindow.arguments && aWindow.arguments[0]; if (!pinnedOnly) { diff --git a/application/palemoon/components/sync/setup.js b/application/palemoon/components/sync/setup.js index 9ff70d471b..ffae10bec4 100644 --- a/application/palemoon/components/sync/setup.js +++ b/application/palemoon/components/sync/setup.js @@ -50,7 +50,10 @@ var gSyncSetup = { server: false }, - get _remoteSites() [Weave.Service.serverURL, RECAPTCHA_DOMAIN], + get _remoteSites() { + return [Weave.Service.serverURL, RECAPTCHA_DOMAIN]; + }, + get _usingMainServers() { if (this._settingUpNew) @@ -78,7 +81,7 @@ var gSyncSetup = { }); }; addRem(true); - window.addEventListener("unload", function() addRem(false), false); + window.addEventListener("unload", () => addRem(false), false); window.setTimeout(function() { // Force Service to be loaded so that engines are registered. diff --git a/application/palemoon/modules/Windows8WindowFrameColor.jsm b/application/palemoon/modules/Windows8WindowFrameColor.jsm index e7a447db20..969d9ded46 100644 --- a/application/palemoon/modules/Windows8WindowFrameColor.jsm +++ b/application/palemoon/modules/Windows8WindowFrameColor.jsm @@ -35,7 +35,7 @@ var Windows8WindowFrameColor = { // Zero-pad the number just to make sure that it is 8 digits. windowFrameColorHex = ("00000000" + windowFrameColorHex).substr(-8); let windowFrameColorArray = windowFrameColorHex.match(/../g); - let [unused, fgR, fgG, fgB] = windowFrameColorArray.map(function(val) parseInt(val, 16)); + let [unused, fgR, fgG, fgB] = windowFrameColorArray.map(val => parseInt(val, 16)); let windowFrameColorBalance = WindowsRegistry.readRegKey(HKCU, dwmKey, "ColorizationColorBalance"); // Default to balance=78 if reg key isn't defined diff --git a/application/palemoon/modules/WindowsJumpLists.jsm b/application/palemoon/modules/WindowsJumpLists.jsm index 6badc39076..62a8a10f76 100644 --- a/application/palemoon/modules/WindowsJumpLists.jsm +++ b/application/palemoon/modules/WindowsJumpLists.jsm @@ -102,8 +102,8 @@ var tasksCfg = [ */ // Open new tab { - get title() _getString("taskbar.tasks.newTab.label"), - get description() _getString("taskbar.tasks.newTab.description"), + get title() { return _getString("taskbar.tasks.newTab.label"); }, + get description() { return _getString("taskbar.tasks.newTab.description"); }, args: "-new-tab about:blank", iconIndex: 3, // New window icon open: true, @@ -114,8 +114,8 @@ var tasksCfg = [ // Open new window { - get title() _getString("taskbar.tasks.newWindow.label"), - get description() _getString("taskbar.tasks.newWindow.description"), + get title() { return _getString("taskbar.tasks.newWindow.label"); }, + get description() { return _getString("taskbar.tasks.newWindow.description"); }, args: "-browser", iconIndex: 2, // New tab icon open: true, @@ -125,8 +125,8 @@ var tasksCfg = [ // Open new private window { - get title() _getString("taskbar.tasks.newPrivateWindow.label"), - get description() _getString("taskbar.tasks.newPrivateWindow.description"), + get title() { return _getString("taskbar.tasks.newPrivateWindow.label"); }, + get description() { return _getString("taskbar.tasks.newPrivateWindow.description"); }, args: "-private-window", iconIndex: 4, // Private browsing mode icon open: true,