MozillaZine

print download history

Discussion of general topics about Mozilla Firefox
firestorm31

User avatar
 
Posts: 26
Joined: January 2nd, 2013, 4:47 pm
Location: New Orleans, LA

Post Posted August 2nd, 2019, 8:55 pm

is there an extension that would let me print download history to the printer?
Dilbert Firestorm

morat
 
Posts: 3337
Joined: February 3rd, 2009, 6:29 pm

Post Posted August 3rd, 2019, 5:55 am

I didn't find a downloads addon on AMO just for printing.

AMO search for "downloads"
http://addons.mozilla.org/firefox/search/?q=downloads

It's possible to create such an addon with the downloads API.

Here is how to print the downloads page using the web console.

Instructions:

* open about:downloads page
* open web console i.e. tools > web developer > web console
* copy and paste code into web console, then press enter to run
* select downloads print tab, then print normally

Code: Select all
(function () {
  var a = document.querySelectorAll(".downloadTarget");
  var b = document.querySelectorAll(".downloadDetailsNormal");
  var c = [];
  var d = [];
  for (var i = 0; i < a.length; i++) c.push(a[i].value + "\n" + b[i].value);
  d.push('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">', "<html>", "<head>");
  d.push('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">');
  d.push("<title>Downloads Print</title>", "</head>", "<body>");
  d.push("<pre>", c.join("\n\n"), "</pre>", "</body>", "</html>");
  open("data:text/html;charset=utf-8;base64," +
    btoa(unescape(encodeURIComponent(d.join("\n")))));
})();
Last edited by morat on August 9th, 2019, 1:03 pm, edited 1 time in total.

firestorm31

User avatar
 
Posts: 26
Joined: January 2nd, 2013, 4:47 pm
Location: New Orleans, LA

Post Posted August 3rd, 2019, 10:03 am

it worked sort of. it printed what was viewable. it showed 5 files.

but I don't want it to print the whole download history. just a list of them from the search download history. I made a lot of image downloads the other nite. noticed after counting, I missed a file. would like to see what file I missed.
Dilbert Firestorm

therube

User avatar
 
Posts: 19961
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Post Posted August 3rd, 2019, 12:01 pm

Might see what Nirsoft's FirefoxDownloadsView can do?
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript

morat
 
Posts: 3337
Joined: February 3rd, 2009, 6:29 pm

Post Posted August 3rd, 2019, 12:56 pm

You can tweak the code to work with the search downloads textbox in the library window.

Instructions:

* open downloads in library window i.e. tools > downloads
* enter a query in search downloads textbox to filter list
* open about:debugging page, then check enable addon debugging
* open browser console i.e. tools > web developer > browser console
* copy and paste code into browser console command line, then press enter to run
* select downloads print tab, then print normally

Code: Select all
(function () {
  var win = Services.wm.getMostRecentWindow("Places:Organizer");
  var a = win.document.querySelectorAll(".download-state:not([hidden]) .downloadTarget");
  var b = win.document.querySelectorAll(".download-state:not([hidden]) .downloadDetailsNormal");
  var c = [];
  var d = [];
  for (var i = 0; i < a.length; i++) c.push(a[i].value + "\n" + b[i].value);
  d.push('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">', "<html>", "<head>");
  d.push('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">');
  d.push("<title>Downloads Print</title>", "</head>", "<body>");
  d.push("<pre>", c.join("\n\n"), "</pre>", "</body>", "</html>");
  var win = Services.wm.getMostRecentWindow("navigator:browser");
  win.gBrowser.addTab("data:text/html;charset=utf-8;base64," +
    btoa(unescape(encodeURIComponent(d.join("\n")))), {
    triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
  });
})();
Last edited by morat on August 9th, 2019, 1:01 pm, edited 1 time in total.

firestorm31

User avatar
 
Posts: 26
Joined: January 2nd, 2013, 4:47 pm
Location: New Orleans, LA

Post Posted August 3rd, 2019, 10:17 pm

therube wrote:Might see what Nirsoft's FirefoxDownloadsView can do?


that program did the trick. it won't print. but it will let you search, save it to the csv delimited file and export it to a spread sheet of your choice which in this case is Apache Open Office; delete some columns and then print.
Dilbert Firestorm

firestorm31

User avatar
 
Posts: 26
Joined: January 2nd, 2013, 4:47 pm
Location: New Orleans, LA

Post Posted August 4th, 2019, 10:47 am

oh btw, thanx for the help.
Dilbert Firestorm

dickvl

User avatar
 
Posts: 52780
Joined: July 18th, 2005, 3:25 am

Post Posted August 12th, 2019, 4:11 pm

There is also this place query possible to get a list of all downloads.
place:transition=7&sort=4

If you copy the content of this smart folder to the clipboard then you get "A HREF" HTML code (flavor: text/html) that you can paste in an HTML capable editor.

morat
 
Posts: 3337
Joined: February 3rd, 2009, 6:29 pm

Post Posted August 13th, 2019, 11:42 am

The smart folder trick works well.

Remember to restart for the smart folder to take effect.

Online html editor
http://html-online.com/editor/

Return to Firefox General


Who is online

Users browsing this forum: No registered users and 2 guests