OtterBrowser / otter-browser

Otter Browser aims to recreate the best aspects of the classic Opera (12.x) UI using Qt5
https://otter-browser.org
GNU General Public License v3.0
1.8k stars 275 forks source link

Gopher support #1050

Open dertuxmalwieder opened 8 years ago

dertuxmalwieder commented 8 years ago

I'd like to request support for the Gopher protocol, maybe as a module. I am willing to help to contribute it myself if I figure out how Otter determines a page's protocol... :)

Emdek commented 7 years ago

@dertuxmalwieder, why not, I'm not familiar with gopher but it seems that it will require translation of replies into HTML plus some other stuff, so probably it would be best to have it as some sort of module that would be used by web backends for producing HTML etc. We could use it as example for other protocols in future.

dertuxmalwieder commented 7 years ago

Actually, it's not even "some other stuff". :-)

Emdek commented 7 years ago

@dertuxmalwieder, so basically just detecting reply that needs to be transformed and translating it?

dertuxmalwieder commented 7 years ago

Yep. You'll send a very basic "request" to the Gopher server (usually running on port 70), i.e. the URL, and it will reply with a "Gopher page" that just needs to be translated into HTML. Should be achievable with simple search&replace.

Wikipedia example. The first line is the request, the rest is the Gopher page, each line being "an item".

Emdek commented 7 years ago

@dertuxmalwieder, I see, in fact I've visited that article while determining fate of this ticket. If you are still willing to give it a try then I think that the easiest way to create initial implementation (specific to QtWebKit) would be to hook it here: https://github.com/OtterBrowser/otter-browser/blob/master/src/modules/backends/web/qtwebkit/QtWebKitNetworkManager.cpp#L693 Take a look at implementation of LocalListingNetworkReply and QtWebKitFtpListingNetworkReply (these two are a bit similar since both deal with file listing, you can also use some sort of template file if it makes sense) or at least read documentation of QNetworkReply. We can later try to create full blown generic implementation that could be supported also in QtWebEngine backend.

dertuxmalwieder commented 7 years ago

Looks like I could - more or less - copy the FTP implementation and rip out most of its commands. :-)

I'm still willing to give it a try, of course. I haven't had much spare time yet (and Otter keeps evolving)... but it's still on my list.

Emdek commented 7 years ago

@dertuxmalwieder, yeah, we can discuss details on IRC when you will have some time. One of the topics I would like to care take of in next weeks would be enabling protocol handlers configuration (currently destined to become Programs section in Advanced, but that might change during redesign needed by transition to about:preferences) so it could be useful to take such handler modules into account.

dertuxmalwieder commented 7 years ago

I'll be on the IRC in approx. eight hours. I'll ping you. :)

Emdek commented 7 years ago

@dertuxmalwieder, OK, but eight hours from now might be a bit late to catch me on IRC...

dertuxmalwieder commented 7 years ago

Well, I randomly see you talking when I'm online. Don't worry, I'll get you some day.

Emdek commented 7 years ago

@dertuxmalwieder, OK.

smaragdus commented 4 years ago

Any development about adding Gopher support to Otter? I have just checked Dooble (a browser which I do not like) and as of version 2020.07.07 Gopher is still supported. I wonder whether some part of Dooble code might be used to implement Gopher support in Otter.

dertuxmalwieder commented 4 years ago

Very different code bases make that relatively hard.

Emdek commented 4 years ago

Patches are welcome. ;-)