Coder Social home page Coder Social logo

infocatcher / download_panel_tweaker Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 2.0 1.05 MB

Some tweaks for built-in download panel, restartless extension for Firefox

Home Page: https://addons.mozilla.org/addon/download-panel-tweaker/

License: Other

CSS 5.36% JavaScript 91.88% Shell 0.66% Batchfile 2.10%

download_panel_tweaker's People

Contributors

fang5566 avatar infocatcher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

phoneixs fang5566

download_panel_tweaker's Issues

Toggling panel (while in menu) opens it below window

Steps to reproduce:

  1. Move downloads button to the menu button.
  2. Assign hotkey (Ctrl+J) to toggle panel.
  3. Press Ctrl+J.

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?

[Request] Always show the full destination path for downloads, without requiring hovering over

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

  1. Opening the add-on's Options page, either by double-clicking its entry or by clicking the Options button in Add-ons Manager, momentarily flashes the Menu Bar.
  2. Download Panel Tweaks has an option to 'Sort active downloads to the top' - it would be great if it can be implemented into this one.
  3. Would it be possible to have an option / context-menu entry to delete only the finished downloads, while leaving the cancelled / failed downloads?

Add "Clear Downloads" to floating panel.

Since the apperance of the download floating panel I've been waiting for Mozilla to add the "Clear downloads" option to it... but nothing yet. Why not implement this feature within this amazing addon?

firefox-clear-downloads

Add ability to not remove finished downloads from panel

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.

Download panel width option doesn't work with NASA Night Launch theme

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

(

var containerSelector = parseFloat(Services.appinfo.version) >= 20
)
But seems like NASA Night Launch still use #downloadsListBox to set panel width.

widget-overflow panel is not closed correctly

By default, when opening the downloads panel from within the widget overflow panel, the latter panel should be closed first. But with Download Panel Tweaker installed, the widget overflow panel stays open. Is it a bug?

firefox_2016-11-16_09-04-26

Incompatibility with OmniSidebar (easy to fix)

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

Show full patch to file in tooltip for file name

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.

Limit the panel height to screen area.

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)

Add more information about selected download (referrer, source URI, etc.).

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.

"Remove From History" gets confused with duplicate entries

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)

Menu bar shown when accessing options

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.

Enhanced options for various download commands

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

Don't close panel when I open a file option

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.

Remember downloads between sessions.

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.

Add ability to delete a finished download from disk

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.

New style changes in FF 52

In FF 52 the download panel was recently updated, so the Compact and Very compact styles have multiple issues and may need updating to look more "compact" again.

Compact:
2016-10-17_06-36-58

Very compact:
2016-10-17_06-37-01

Add pause button to the panel

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.

Some suggestions

I just wanted to mention a few (minor) suggestions, as well as other things:

  • Make progress bar have completely square corners? It seems to be missing 1 pixel from all the corners (using Windows 8). It also looks like it introduces some dark-colored pixels when using the very compact style.
  • Increase the top margin of the cancel button to have it appear more centered with the progress bar? Increasing by 4/5px looks alright.
  • Include your downloadPercentage.css tweak, and optionally display the percentage on the same line as the other stats?

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.

Doesn't work in current Nightly x64

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

Add ability to not highlight toolbar button with new finished downloads

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.