infocatcher / download_panel_tweaker Goto Github PK
View Code? Open in Web Editor NEWSome tweaks for built-in download panel, restartless extension for Firefox
Home Page: https://addons.mozilla.org/addon/download-panel-tweaker/
License: Other
Some tweaks for built-in download panel, restartless extension for Firefox
Home Page: https://addons.mozilla.org/addon/download-panel-tweaker/
License: Other
I like the feature, I've been using it for a long while, but apparently it's broken.
Steps to reproduce:
Actual results:
Downloads panel opens below the main window at the center.
Expected results:
Panel could perhaps open at the identity box in the location bar, like the same behavior as Ctrl+D when bookmarks button is in the menu (screenshot). Or simply open below the menu button. Your thoughts?
E.g. disable/enable or change extensions.downloadPanelTweaker.itemCountLimit
to get empty panel.
We can listen for "command" event and prevent execution of "Tools:Downloads" command (and toggle download panel).
I tried doing that by using
.downloadTarget::after {
content: attr(tooltiptext) !important;
font-size: 11px !important;
line-height: 11px !important;
opacity: 0.6 !important;
cursor: default !important;
display: -moz-box !important;
margin-top: -1px !important; /* correct vertical alignement */
margin-right: -26px !important; /* width of the % label */
}
but it does nothing - I can't even see the ::after
class in Browser Toolbox.
Also, on FF v37.0 and Download Panel Tweaker v0.2.5, I have a few minor bugs / requests too (I can file them as separate issues if you want me to):
See resource:///modules/DownloadsCommon.jsm
DownloadsDataItem.prototype.updateFromDownload() doesn't exist anymore, so following is missing:
With
<em:multiprocessCompatible>true</em:multiprocessCompatible>
flag in install.rdf we at least have window.content === null
.
(we should fix #5 first)
Old download window should be loaded faster than library window.
And we have many extensions to tweak old classic window (at least Download Manager Tweak, Download Panel and Downloads Context Menu).
Everything is in the title.
See firefox\browser\omni.ja\components\DownloadsStartup.js
(resource://app/components/DownloadsStartup.js)
case "browser-lastwindow-close-granted":
// When using the panel interface, downloads that are already completed
// should be removed when the last full browser window is closed. This
// event is invoked only if the application is not shutting down yet.
// If the Download Manager service is not initialized, we don't want to
// initialize it just to clean up completed downloads, because they can
// be present only in case there was a browser crash or restart.
if (this._downloadsServiceInitialized &&
!DownloadsCommon.useToolkitUI) {
Services.downloads.cleanUp();
}
And some other Services.downloads.cleanUp();
calls in DownloadsStartup.js.
Apparently nothing works. None of the settings are applied. I get the default panel.
Reported here: https://addons.mozilla.org/addon/download-panel-tweaker/reviews/497609/
NASA Night Launch: https://addons.mozilla.org/firefox/addon/nasa-night-launch/
We currently use
var containerSelector = parseFloat(Services.appinfo.version) >= 20
? ".downloadContainer"
: "#downloadsListBox";
(
Download_Panel_Tweaker/bootstrap.js
Line 175 in 92ca929
#downloadsListBox
to set panel width.Error: DownloadsView.onDataInvalidated is not a function Source file: resource://gre/modules/XPIProvider.jsm -> .../[email protected]!/bootstrap.js Line: 322
if(DownloadsPanel._state != DownloadsPanel.kStateUninitialized) {
DownloadsView.onDataInvalidated(); // This calls DownloadsPanel.terminate();
DownloadsPanel.initialize(function() {});
}
Hey Infocatcher,
There's a little problem when you change the "Hotkey for downloads (Ctrl+J)" option to "Toggle sidebar". Result: the keyboard shortcut will always open, but never close the sidebar.
I saw in the code that you're using OmniSidebar's menu item to do the command, but if in OmniSidebar you enable the option "Don't close the sidebar from drop-down menus" (which will be enabled by default in the next version), it will never close the downloads sidebar because, technically, it is the "menu item" that's doing the command.
The solution is simple: get the broadcaster instead of the menuitem and do the command from there. The broadcaster id changes for Australis (Firefox 29), but the menuitem id stays the same, so for backwards compatibility it'll probably be better to get it from the menuitem's "observes" attribute. Basically change:
var sbItem = document.getElementById("menu_dmSidebar") // OmniSidebar
|| document.getElementById("downloads-mitem"); // All-in-One Sidebar
if(sbItem) {
to something like
var sbItem = document.getElementById("menu_dmSidebar"); // OmniSidebar
if(sbItem)
sbItem = document.getElementById(sbItem.getAttribute('observes')); // use the broadcaster instead
else
sbItem = document.getElementById("downloads-mitem"); // All-in-One Sidebar
if(sbItem) {
Requested here: https://forum.mozilla-russia.org/viewtopic.php?pid=647112#p647112
We have chrome://browser/content/downloads/downloads.js and view-source:chrome://browser/content/downloads/download.xml#download
<xul:description class="downloadTarget"
crop="center"
style="min-width: &downloadsSummary.minWidth2;"
xbl:inherits="value=target,tooltiptext=target"/>
for panel (so used the same value for tooltip and label from target
attribute).
Also we have something different for Library and about:downloads, see chrome://browser/content/downloads/allDownloadsViewOverlay.js:
// Copied from updateProgress in downloads.js.
(two times)
// See comment in DVI_onStateChange in downloads.js (the panel-view)
(yay! enjoy that great programming pattern!)
So, looks like we don't have some global code, that can be tweaked from our side to apply changes to all download items.
Anyway, it's easy to handle only panel: we can update tooltip after mouseover
.
This would require a lot less space and would be quicker to read.
In addition for #5.
We already have extensions.downloadPanelTweaker.downloadsMaxRetentionHours, but panel becomes empty after few time.
For better startup performance because we use delayed loading at typical startup:
window.setTimeout(function() {
this.loadStyles(true);
}.bind(this), 50);
Hi!
I think it would be a nice feature to limit the download panel height (atop the setting to limit by pixels) so that none of it will be outside the screen area in any case.
Something similar is being don to the width of it. Though if I set it too high (eg 9000) it only flickers for a second and disappears. (PS: it would be nice if the measurement units would appear in the settings. It's not always obvious if it's pixels or characters)
It would be nice if the middle mouse button could clear an item from the panel list, and middle button on the downloads toolbar button itself to clear all items.
(I'm coming from being a Download Statusbar user, and I miss this!)
Windows aren't closed yet during that notification, so this may increase shutdown time, at least visually.
We can wait for "profile-change-teardown" notification.
I have the "Also remove from history" feature disabled. However when I middle click the download is also removed from history.
https://addons.mozilla.org/firefox/addon/downloads-window/
We should open its window for "Open old downloads window" in options.
There used to be a great add-on - Download Panel, which in addition to standard information provided more useful data, such as referrer (impossible to easily guess really), more precise size info (in bytes), source URI and so on. See:
This add-on however is not updated anymore and it doesn't work with the new downloads UI.
It would be great if you could enable this info somehow through the UI as well (may be the same way as an additional panel on the bottom, or some other way). May be you can reuse some code from the above add-on to save time.
Thanks.
Firefox Version: Firefox Developer Edition 48.0a2 (2016-06-04) with e10s disabled
Addon Version: 0.2.5
After accidentally starting and then cancelling a download twice because I misunderstood a website's badly-designed UI, I noticed that I couldn't clear the second entry from the history via its context menu "Remove From History" entry.
What's worse, I lost just under 500MB of download progress (on a 5Mbit connection) before I realized that, every time I tried, it cancelled and removed the in-progress download below it. (I had to go into the downloads window in the Library view to get rid of it)
A minor bug I noticed, when opening the Download Panel Tweaker options via about:addons, the menu bar of Firefox briefly appears and disappears at the top of the window, which makes the app content shift down and up. Not sure if you were aware of that.
We already track Tools:Downloads
command and downloads hotkey here: #2, also we should additionally handle #downloadsHistory
item ("Show All Downloads" button in download panel) for #6.
So we can detect 1) downloads command, 2) downloads hotkey and 3) "Show All Downloads" from download panel.
And it's easy to do something good instead of default actions.
And we can override opening of "about:downloads" tab for private windows as well.
[added at 2014-01-13] Support for Downloads Window extension: #16
For example (see resource://app/components/DownloadsUI.js), open old window
var toolkitUI = Components.classesByID["{7dfdf0d1-aff6-4a34-bad1-d0fe74601642}"]
.getService(Components.interfaces.nsIDownloadManagerUI);
toolkitUI.show(window/*, aDownload, aReason, aUsePrivateUI*/);
or open downloads in tab
window.openUILinkIn("about:downloads", "tab");
or open Library
let organizer = Services.wm.getMostRecentWindow("Places:Organizer");
if (!organizer) {
parentWindow.openDialog("chrome://browser/content/places/places.xul",
"", "chrome,toolbar=yes,dialog=no,resizable",
"Downloads");
} else {
organizer.PlacesOrganizer.selectLeftPaneQuery("Downloads");
organizer.focus();
}
Hello!
I think this extensin is great. One of the thing that makes it less usable then the old window is that I can't click multiple downloads to open them because the panel instantly closes.
And option to keep open the panel open until I click somewhere else or close it manually would be great for fixing this weakness.
Hello!
I think this is one of two significant limitations compared to the old download window. (The other is #18) It would be great if it made it possible to keep the downloads between browser sessions.
I know the library has them (so FF stores them somewhere), but library is crappy and doesn't have anything on the panel besides this.
Now we have not only DownloadsView.controllerForElement(node)
, now there is only controller.download
(looks very similar to data drom downloads.json) instead of .dataItem
.
A feature of the old Download Statusbar I tended to use a lot since I download a lot of files I only use one time. Having a way to delete them from the download panel or history is easier than opening up file manager to do it.
We also should handle mouseup
in this case as click
(mousedown
to open panel, move mouse to some item and finally mouseup
to invoke item's action).
A sort of encapsulation and better performance (we can use lazy getter to load this file).
For better startup performance: we need this code only after first panel opening.
See https://forum.mozilla-russia.org/viewtopic.php?id=59543
STR:
For some weird reason, the pause button was removed from the default download UI. It would be very useful to restore it if possible. More than once I clicked cancel button thinking that it's actually pause because of that.
I just wanted to mention a few (minor) suggestions, as well as other things:
And I'm using version 0.1.1pre6, but is there a page where I can access newest pre versions? Or instructions for how to build the latest xpi? Thanks.
Clicking on the download button does nothing.
Disabling the Add-on restores functionality.
Error console shows this on extension re-enabling after disabling:
Mon Jul 28 2014 20:39:29
Error: NS_ERROR_MALFORMED_URI: Component returned failure code: 0x804b000a (NS_ERROR_MALFORMED_URI) [nsIIOService.newURI]
Source file: resource://gre/modules/DownloadUtils.jsm
Line: 397
This is from chrome://browser/skin/browser.css:
#downloads-button[attention] > #downloads-indicator-anchor > #downloads-indicator-icon {
background-image: url("chrome://browser/skin/downloads/download-glow.png");
}
So, it's probably better to watch changes of this attention
attribute. But in old Firefox version there is two downloads buttons...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.