Skip to content

Instantly share code, notes, and snippets.

@Infocatcher
Last active December 16, 2015 05:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Infocatcher/5387328 to your computer and use it in GitHub Desktop.
Save Infocatcher/5387328 to your computer and use it in GitHub Desktop.
Firefox: increase item count in built-in download panel(browser.download.useToolkitUI = false)
// https://gist.github.com/Infocatcher/5387328
// More: https://github.com/Infocatcher/Download_Panel_Tweaker
// (c) Infocatcher 2013, 2015
var itemCountLimit = 5;
// resource://app/modules/DownloadsCommon.jsm, see getSummary() function
if(DownloadsCommon._privateSummary)
DownloadsCommon._privateSummary._numToExclude = itemCountLimit;
if(DownloadsCommon._summary)
DownloadsCommon._summary._numToExclude = itemCountLimit;
// chrome://browser/content/downloads/downloads.js
DownloadsView.kItemCountLimit = itemCountLimit;
if(DownloadsPanel._state != DownloadsPanel.kStateUninitialized) {
if("onDataInvalidated" in DownloadsView)
DownloadsView.onDataInvalidated(); // This calls DownloadsPanel.terminate();
else { // Firefox 28+
// Based on code from chrome://browser/content/downloads/downloads.js in Firefox 25
DownloadsPanel.terminate();
DownloadsView.richListBox.textContent = "";
if("_downloads" in DownloadsView) // Firefox 38+
DownloadsView._downloads = [];
else {
DownloadsView._viewItems = {};
DownloadsView._dataItems = [];
}
}
DownloadsPanel.initialize(function() {});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment