Rob--W / open-in-browser

A browser extension that offers the ability to open files directly in the browser instead of downloading them.
Other
83 stars 15 forks source link

Support all/more protocols? (FTP) #60

Open Vagmer opened 4 years ago

Vagmer commented 4 years ago

Sometimes it is most preferable to browse FTP with the browser... The extension doesn't function for files accessed by FTP, so that when clicking a link to (for example) an image file on a FTP server, the normal Firefox download dialog is shown directly instead, rather than the addon's dialog which would allow viewing the image within the browser. Is it possible to support protocols other than HTTP?

Also, could you add explicit "Video" and "Audio" (or just one for both) file type options to the drop list (that already contains "Image", "PDF", etc) for "Open in browser as"?

Thanks for this addon! It is odd that this functionality is not native to the browser.

Rob--W commented 4 years ago

The extension uses the webRequest extension API to intercept requests. In Firefox, ftp requests are not visible to the extension via this API.

I thought that this used to work partially, but now it seems that ftp requests are not visible at all (tested in Firefox 69) - https://bugzilla.mozilla.org/show_bug.cgi?id=1312460

Also, could you add explicit "Video" and "Audio" (or just one for both) file type options to the drop list (that already contains "Image", "PDF", etc) for "Open in browser as"?

What are the use cases? Does the "MIME from file extension" or "Server sent MIME" options serve your needs?

Vagmer commented 4 years ago

Thanks for the quick reply. I see, that's too bad. Is there no workaround possible... even a manual one, to open an FTP resource in the browser?

What are the use cases? Does the "MIME from file extension" or "Server sent MIME" options serve your needs?

Yeah, those typically work, and when they don't, you can still manually type and select a video/audio type in "Other", and that works too. The use case is the same as the other explicit ones like "Web page", "Image", "PDF" - a shortcut for when there is no extension or a generic/irrelevant type or extension is given.

Rob--W commented 4 years ago

Is there no workaround possible... even a manual one, to open an FTP resource in the browser?

I don't think so, short of reading the FTP resource through a (HTTP) proxy.

richfelker commented 2 years ago

I hit this too for file:// URLs. I want to be able to open text files (with extensions other than .txt, like source code files) in the browser, as well as PDFs. This used to work, but since a recent Firefox upgrade, open-in-browser no longer seems to have access, and Firefox always prompts me to "download" (lol) or open with an external application (which I don't want).

Rob--W commented 2 years ago

I hit this too for file:// URLs. I want to be able to open text files (with extensions other than .txt, like source code files) in the browser, as well as PDFs. This used to work, but since a recent Firefox upgrade, open-in-browser no longer seems to have access, and Firefox always prompts me to "download" (lol) or open with an external application (which I don't want).

When/how did this work? Extensions in Firefox cannot intercept file://-requests.

richfelker commented 2 years ago

I thought it worked before. Maybe I'm misremembering and Firefox just previously did less-stupid things with synthesized MIME types, or allowed viewing of text/* rather than just text/plain or something, so that it worked without OIB.

Rob--W commented 2 years ago

I thought it worked before. Maybe I'm misremembering and Firefox just previously did less-stupid things with synthesized MIME types, or allowed viewing of text/* rather than just text/plain or something, so that it worked without OIB.

If you have a specific test case, please write down the specific steps. Then use mozregression (https://mozilla.github.io/mozregression/) to try and identify the cause of the behavioral change, and then report a bug at https://bugzilla.mozilla.org if needed.