gyng / save-in

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

Invalid options are not validated when imported #89

Open tombones opened 6 years ago

tombones commented 6 years ago

Unfortunately, I haven't been able to save any images using this extension since I updated to the latest version. At first I thought it might be a symlink issue, but it doesn't even let me save directly to the download folder.

The only setting I changed since updating was "Prompt when a duplicate filename is encountered". Strangely, this is labeled "Chrome" and I no longer appear to be able to change the setting (it was formerly set to "rename" I think). Not sure if this is related, but I thought it was worth mentioning.

Please let me know if you need any other info to help troubleshoot.

tombones commented 6 years ago

It appears the "when a duplicate filename is encountered" setting was indeed the culprit.

TL;DR: It appears the "when a duplicate filename is encountered (Chrome)" option becomes temporarily accessible the first time you open the settings page after installing or updating the extension in Firefox. If you change that option from the default (Uniquify) to "Prompt", the addon will no longer save files. You can fix this by removing the addon from Firefox and re-installing it, then immediately opening the settings page and changing the "when a duplicate filename is encountered (Chrome)" option back to "Uniquify".

gyng commented 6 years ago

Thanks for the through report. The time spent must have been quite frustrating. I'll see if I can add some validation to settings, since this can happen with imported settings too.

tombones commented 6 years ago

Thankfully the first thing I thought to try fixed it, so it wasn't too bad. Is there any way to enable that option in Firefox Quantum (at least the "prompt" setting), or is it completely unsupported right now?

gyng commented 6 years ago

Yeah, that's right. "prompt" is unsupported in Firefox.

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