Javascript return Download URL Google Chrome

Hi everyone!

Today I'm trying to use Javascript in Google Chrome to make it return the download link as shown in Google Chrome Downloads page.

I created this script to do this:
(function () {

return document.querySelector("body > downloads-manager").shadowRoot.querySelector("#frb0").shadowRoot.querySelector("#url")

})();

It looks like the Javascript code isn't run and doesn't return a value.

Can somebody help me with this script?

Thanks!

Are you trying to get the local file location, or the remote location it came from?

Looks like a complicated one-line script. :wink:
I'd suggest that you develop and test your script in the Chrome Dev JavaScript console. Just right-click on the download link in the browser, and select "Inspect".
Try just one simple command at a time so you can see the results before moving to the next command.