gyng / save-in

WebExtension for saving media, links, or selections into user-defined directories
MIT License
201 stars 25 forks source link

Add Skip to Uniquify/Overwrite/Prompt #94

Open Sopor opened 5 years ago

Sopor commented 5 years ago

It would be nice if the Uniquify/Overwrite/Prompt also have a Skip option.

gyng commented 5 years ago

@Sopor- can you elaborate? I don't think I quite understand what "skip" would do when there are conflicting filenames.

Sopor commented 5 years ago

You already have Show notification on failed download and some other notification, so if a file i want to download already exists it should skip downloading it and only show a message Skipping $FILENAME$ because it already exists.. If someone want to not show any message at all there could be an option to turn it off completely by adding the option Show notification on skipped download.

gyng commented 5 years ago

This will depend on browser support as extensions have no access to the file system. Unfortunately, the API does not seem to support a "skip", so this won't be possible until browsers implement it.

See: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/downloads/FilenameConflictAction

Sopor commented 5 years ago

So it is not possible to detect when a file name exists and do something else? For example, don't open the save as window?

gyng commented 5 years ago

@Sopor- No, it's not possible at this moment. The web extension API simply does not give extensions access to the file system for security and privacy reasons. The best that can be done is "prompt", which will open a naming window on a conflicting filename, but that is only supported in Chrome.

I can keep a list of downloaded URLs to check against, but I don't think that will be very useful.

gyng commented 5 years ago

Tagging bugzilla issue https://bugzilla.mozilla.org/show_bug.cgi?id=1425515