I am making an extension for Google Chrome which uses the Downloads API.
I want to download a .jpg file from a website.
I have used these permissions in the manifest:
"permissions": ["downloads", "*://www.thatsite.com/*"]
and the command i am using is:
chrome.downloads.download({"url":"https://www.thatsite.com/images/image1.jpg"});
This gives the following error
“Error during downloads.download: Invalid URL.”
Any ideas how to solve this??
I tried with following code, and it is working as expected. I hope you are not on Stable Channel.
Put your complete code, the problem is entirely with URL.
You can refer following code as a reference
Reference
manifest.json
Registered browser action and permissions with manifest file.
popup.html
Added
<script>file to comply with CSP.popup.js
Simply passed URL to
download API.