support multiple link types beyond html and gopher #69
Labels
No Label
bug
compatibility
documentation
duplicate
enhancement
future release
help wanted
invalid
non-code
question
refactor
testing
this release
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cmccabe/linkulator2#69
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I think I posted as a tangential thought in another issue, but I can't find it now.
The idea is to expand linkulator beyond http and gopher links, to also support ssh, curl, finger and probably others.
Some examples:
This would entail modularizing the browser support because no one browser supports all of these protocols. The module change should include protocol/browser pairs, so that linkulator knows to call browser-A when a link of protocol-A is seen.
The representation of protocols is a bit tricky, but would require that each has a regex that uniquely identifies protocols based on the input URL. It may be as simple as:
I think it would be great if linkulator could handle any url type. Bombadillo can support:
The last one is configuration based. For rawtext you could build it with the config setting
webmode: lynx
. Then it will be on by default for system users.That leaves curl and ssh. It should be pretty easy to sub-process ssh. I dont know about that particular format for curl so not sure about that. wget could be convenient for some stuff if people want to download.
For finger to work w/ bombadillo the address should be formatted as:
finger://[username@]HOST
. If you enforce a scheme on every url (ssh://
,local://
,gopher://
,finger://
, etc) it makes the links extremely clear and makes it easy to pass them or parse them.Do you think it is best to extend linkulator's config file to have settings for each of the supported protocols? Or is it better to simply support the protocols and use a single browser (Bombadillo) to handle them?
Hmmm... I'm torn. Bombadillo requires specific structure to URLs to get them to load, but it should be fairly standard-ish. The systems mime db should actually do the job fairly well and opening based on defaults for a mime type might be a way to go.
Prompted by #102 by @samhunter, looking at this in more detail - these are the schemes actually in use:
The original functionality allows the user to open
http://
andgopher://
links with a single browser application. URLs with different schemes, likegemini://
, can be opened, with a warning.The proposed functionality is to allow the user to add individual schemes to their configuration, specifying which program should open URLs of that scheme.
I propose this works in the following way:
[URL Handlers]
will be added. New mandatory options to be added to this section arehttp
,gemini
,gopher
,telnet
andfinger
. These options are empty by default.[URL Handlers]
section. If it is found, it will try tocall
the value of that option, with the URL as an argument.http
is a special scheme option, and its value will be used when opening URLs with http and https.Examples:
To aid with the transition, temporary functionality will be added:
[User Settings]
section andbrowser
option will be read, but not written on exit.http
andgopher
have their values set to whatever the older option had.Some alternatives to the above proposal:
http
andhttps
as separate options$BROWSER
environment variable is set, and no values are configured for thehttp
option, the$BROWSER
environment variable is used. Or, the value ofhttp
is set to"$BROWSER"
instead to make it clear this is the value being used.