davidwilliam Posted November 12, 2019 Share Posted November 12, 2019 I try to use Tampermonkey to get download url but it does not get download url using window.location.href Is that not possible? I could not find any infomation about getting download url I Just want get download url to see it without having to open downloads, console or fiddler 2 Link to comment Share on other sites More sharing options...
Makwana Prahlad Posted December 2, 2019 Share Posted December 2, 2019 Hello, @davidwilliam Please try this code it works : var file_path = 'host/path/file.ext'; var a = document.createElement('A'); a.href = file_path; a.download = file_path.substr(file_path.lastIndexOf('/') + 1); document.body.appendChild(a); a.click(); document.body.removeChild(a); I hope above code will be useful for you. Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now