Last active
December 16, 2015 05:49
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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