Created
October 31, 2017 20:11
-
-
Save licensed/41e609e6b8f8cfe412d7a3dc30698066 to your computer and use it in GitHub Desktop.
Save chrome download list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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="" |
This fetches only 50 links. Chrome seems to hide items when we scroll.
Oh, i think this code stops to work correctly. I am sorry.
Can you fix it?
…On Tue, 7 Jan 2020, 22:47 Ricardo Dantas, ***@***.***> wrote:
This fetches only 50 links. Chrome seems to hide items when we scroll.
Oh, i think this code stops to work correctly. I am sorry.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/41e609e6b8f8cfe412d7a3dc30698066?email_source=notifications&email_token=AD5KRPWPBBOXFMEB3JH5KY3Q4S2JFA5CNFSM4KD4EZ6KYY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAF7BVA#gistcomment-3130192>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD5KRPS4AZAUBBZWHSXQTHDQ4S2JFANCNFSM4KD4EZ6A>
.
Edit which allows you to save the filenames too:
//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(el0) {
el0.shadowRoot.querySelector("#name").removeAttribute("hidden");
el0.shadowRoot.querySelector("#name").style.display = "block";
});
[].forEach.call(ditems, function(el) {
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="";
This code maybe could be shorter, but whatever.
There is still the problem that this only shows 8 items from the list.
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
This fetches only 50 links. Chrome seems to hide items when we scroll.