bandwidth-hero icon indicating copy to clipboard operation
bandwidth-hero copied to clipboard

Images are saved as .htm files

Open fu510n opened this issue 5 years ago • 2 comments

Thanks for this great addon.

I have only found 1 minor issue so far:

All images get saved as myherokuservername.htm and not imagename.jpg or whatever.

I can simply rename them afterwards, but I'm curious if I'm alone with this issue, or is it a known side-efffect?

I have only tested this behaviour in Firefox Android (latest stable) as I don't have access to a computer at the moment.

Thanks

fu510n avatar Mar 21 '19 12:03 fu510n

I could maybe try fixing this on the proxy server by setting the content-disposition 'filename' header, but then even if it works you'd be downloading a potentially very lossy .webp file. We should allow passthrough to the original image for this case, but idk how to distinguish, there needs to be something in the request headers...

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition

Update*: Tried setting the Content-Disposition headers they do not seem to help very much on Firefox for Android. Does seem to help preserve the original filename on Firefox for desktop where it was already getting the .webp file extension right...

changhaitravis avatar Mar 22 '19 15:03 changhaitravis

same problem: the original file name is not used in a "save image" dialog

proposed solution: use a different URL scheme, like

https://proxy-domain/https/original-domain/path/to/file.jpg.c20.webp

url-encoding the original url is not necessary

the original url can be simply appended to the proxy prefix only replace https:// with https/ and append .webp

move the parameters l=20 and bw=0 to the suffix with "c" = color and "b" = black/white

optional parameters can be prepended to the path, like

https://proxy-domain/key1=value1/key2=value2/https/original-domain/path/to/file.jpg.c20.webp

We should allow passthrough to the original image

why not do this client-side? just add the context menu items "view original" and "save original" ideally using only one line of the context menu

milahu avatar Sep 26 '19 07:09 milahu