AlttiRi / twitter-click-and-save

[userscript] Adds buttons to save images and videos in Twitter, also does some other enhancements. (Twitter image and video downloader)
https://greasyfork.org/en/scripts/430132
GNU General Public License v3.0
104 stars 9 forks source link

Feature request: Prompt a download location instead of downloading directly #39

Open Developer2K opened 8 months ago

Developer2K commented 8 months ago

I think it would be at least be a great option to prompt a download location instead of downloading directly.

AlttiRi commented 8 months ago

It uses the default browser's settings "Ask where to save each file before downloading".


Also, GM_download with subpaths aren't supported in ViolentMonkey.

Although, there is a browser's File System Access API to prompt "Save as...". But it's still experimental, Chrome only. https://developer.mozilla.org/en-US/docs/Web/API/window/showSaveFilePicker

let fileHandle = await self.showSaveFilePicker({    
  suggestedName: `Example File System Access API Text File (${Date.now()}).txt`,
  types: [{
    description: "Text documents",
    accept: {
      "text/plain": [".txt"],
    },
  }],
});
let writable = await fileHandle.createWritable();
await writable.write(new Blob(["Current date: " + new Date()]));
await writable.close();

I think it's more effective to not spend time and attention to "Save as..." dialog, one click and a file is downloaded. Just sometimes sort your files, if you need. More over, Twitter's files are prefixed with [twitter], so it's not a problem so select them among other files in the download folder.

Developer2K commented 8 months ago

It uses the default browser's settings "Ask where to save each file before downloading".

Apologies for not checking this first. Thank you for the reply, I'll use this method.