Skip to content

Instantly share code, notes, and snippets.

@licensed
Created October 31, 2017 20:11
Show Gist options
  • Save licensed/41e609e6b8f8cfe412d7a3dc30698066 to your computer and use it in GitHub Desktop.
Save licensed/41e609e6b8f8cfe412d7a3dc30698066 to your computer and use it in GitHub Desktop.
Save chrome download list
#01: Open console Ctrl+Shift+J
#02: Past the code below
#03: Save the list
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=""
@ProximaNova
Copy link

Bug fixed: truncated links

Only show the full links:

//Open the console Ctrl+Shift+J. Paste the code below and press enter. Save the list.

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

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

[].forEach.call(ditems, function(el) {
el.shadowRoot.querySelector("#name").removeAttribute("hidden");
el.shadowRoot.querySelector("#name").style.display = "block";
el.shadowRoot.querySelector("#url").innerHTML = el.shadowRoot.querySelector("#url").href;
var br = document.createElement("br");
var hr = document.createElement("hr");
div.appendChild(el.shadowRoot.querySelector("#name"));
div.appendChild(el.shadowRoot.querySelector("#url"));
div.appendChild(br);
div.appendChild(hr);
});

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment