I may have missed it, but I'd like to assign the action Save Link As… to a gesture. This is the action available in the context menu after right-clicking a link.
Please add this crucial guesture, its the only one I'm missing while transitioning from FireGuestures.
@Robbendebiene as I don't have a test setup I don't want to create a PR, but this snippet should do the trick (more or less copied together from you other actions).
SaveLinkAs: function (data, settings) {
let url = null;
if (isURL(data.textSelection)) url = data.textSelection;
else if (data.link && data.link.href) url = data.link.href;
if (url) {
chrome.downloads.download({
url: url,
saveAs: true
}, (downloadId) => {});
}
}
@leonard84 Yes, this should work in the most cases. However (similar to the "Save Image" action) I'm not able to get the right file extension, so you would have to set it manually.
@Robbendebiene I thought the browser takes care of it, if you omit the filename https://developer.chrome.com/extensions/downloads#method-download
Maybe chrome does, but Firefox does not. Normally onDeterminingFilename is the way to go, but currently Firefox does not support it.
I'm not sure if helpful, but Foxy Gestures can assign a gesture to Save Link As. There might be something in their code that is useful.
I'll add this command soon. Even though the problem I mentioned above still exists.
Available in Gesturefy 2.1.0
Thank you! Works very well.