Creating a browser extension to download multiple files (videos, audios, images) as a ZIP archive

I want to create a browser extension that allows users to input a list of links (videos, audios, images) and download all of them as a ZIP archive. I have looked into the chrome.downloads.download API, but it seems that it does not have the permission to save files directly to the user’s machine. Instead, it prompts the user for the download location if the “Ask where to save each file before downloading” setting is enabled (for example, in Edge, if I enable “Ask me what to do with each download,” it will ask me for the save location every time chrome.downloads.download is called).
To avoid this, I considered downloading all the files first, compressing them into a ZIP archive, and then allowing the user to download the single ZIP file. However, I couldn’t find any guidance on how to implement this approach.
My questions are:

How can I start implementing this feature of downloading multiple files as a ZIP archive in a browser extension?
Is there a more optimized way to achieve this functionality without downloading all files first and then compressing them?

I would appreciate any guidance or suggestions on how to proceed with this task. Please let me know if you need any clarification or additional information.