Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2022-04-28 12:15:29 +08:00
commit 897bcc3b20
32 changed files with 251 additions and 154 deletions

View file

@ -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");

View file

@ -1940,8 +1940,6 @@
aOpenUILinkParams &&
aOpenUILinkParams.inBackground;
let where = tabBackground ? "tab-background" : aOpenUILinkWhere;
BrowserSearch.recordOneoffSearchInTelemetry(engine, source, type,
where);
return true;
]]></body>
</method>

View file

@ -36,6 +36,7 @@
#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
#include "mozilla/StartupTimeline.h"
#include "mozilla/Sprintf.h"
#include "mozilla/WindowsDllBlocklist.h"

View file

@ -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();

View file

@ -220,7 +220,7 @@ var gSyncUI = {
// Commands
doSync: function() {
setTimeout(function() Weave.Service.errorHandler.syncAndReportErrors(), 0);
setTimeout(() => Weave.Service.errorHandler.syncAndReportErrors(), 0);
},
handleToolbarButton: function() {

View file

@ -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");
@ -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
}
}
@ -2951,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;
}
}
@ -4416,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);
}
}
@ -4660,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;

View file

@ -55,7 +55,7 @@
<getter><![CDATA[
if (!this._visibleTabs)
this._visibleTabs = Array.filter(this.tabs,
function (tab) !tab.hidden && !tab.closing);
tab => !tab.hidden && !tab.closing);
return this._visibleTabs;
]]></getter>
</property>
@ -2501,7 +2501,7 @@
<body>
<![CDATA[
this.mProgressListeners =
this.mProgressListeners.filter(function (l) l != aListener);
this.mProgressListeners.filter(l => l != aListener);
]]>
</body>
</method>
@ -2518,7 +2518,7 @@
<body>
<![CDATA[
this.mTabsProgressListeners =
this.mTabsProgressListeners.filter(function (l) l != aListener);
this.mTabsProgressListeners.filter(l => l != aListener);
]]>
</body>
</method>
@ -2635,7 +2635,7 @@
<getter>
<![CDATA[
return this._browsers ||
(this._browsers = Array.map(this.tabs, function (tab) tab.linkedBrowser));
(this._browsers = Array.map(this.tabs, tab => tab.linkedBrowser));
]]>
</getter>
</property>
@ -4593,7 +4593,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,

View file

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

View file

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

View file

@ -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.

View file

@ -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.

View file

@ -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) {

View file

@ -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,

View file

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

View file

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

View file

@ -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),

View file

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

View file

@ -20,6 +20,5 @@ function searchBookmarks(aSearchString) {
}
window.addEventListener("SidebarFocused",
function()
document.getElementById("search-box").focus(),
() => document.getElementById("search-box").focus(),
false);

View file

@ -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.

View file

@ -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)
}
};
/**

View file

@ -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" });
]]></script>

View file

@ -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() {

View file

@ -86,6 +86,5 @@ function searchHistory(aInput)
}
window.addEventListener("SidebarFocused",
function()
gSearchBox.focus(),
() => gSearchBox.focus(),
false);

View file

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

View file

@ -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.

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"))

View file

@ -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) {

View file

@ -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.

View file

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

View file

@ -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,