Google-chrome – How to export all downloads’ links from chrome://downloads

google-chrome

Some of the downloads fail sometime and I want to take all the links from Chrome Download list to a download manager.

If I save the chrome://downloads page I get an empty html file.

Is there a way that I can export all the downloads' links from Google Chrome Downloads page (you can access it by hitting Ctrl+J)?

Best Answer

I searched the web and Chrome Web Store unfortunately there are no extensions to do that.

Only when I tried to make a script I discovered that the things are not that straightforward because there are a lot of nested shadow DOM elements, nevertheless I managed to write it.

Below is the code you need to paste in console(Ctrl+Shift+J) to get all the links.

ditems = document.querySelector("downloads-manager").shadowRoot.querySelector("iron-list").querySelectorAll("downloads-item");

var div = document.createElement('div');

[].forEach.call(ditems, function (el) {
var br = document.createElement('br');
var hr = document.createElement('hr');
div.appendChild(el.shadowRoot.querySelector("#url"));
div.appendChild(br);
div.appendChild(hr);

});
document.body.innerHTML=""
document.body.appendChild(div);
document.head.style.innerHTML="";

After this you can save the resulting page with Ctrl+S.