[gopher] luakit web-browser and gopher
Peter Tynan
happy at sdf.lonestar.org
Thu Dec 6 13:05:37 UTC 2012
I found that recently I've been using the luakit web-browser a lot,
it's one of those "lightweight" keyboard driven types but unusually
not totally mouse hostile. Despite having never messed with lua before
I started to think it might be nice if it could do something with
gopher links - a sort of overbite for luakit...
Sometime later and I've got this far
--------------------
-- Gopher handler --
--------------------
webview.init_funcs.gopher_hook = function (view, w)
view:add_signal("navigation-request", function (v, uri)
local uri = w.view.hovered_uri
if string.match(string.lower(uri), "gopher.floodgap.com") thn
else
if string.match(string.lower(uri), "gopher:") then
local gopher = "http://gopher.floodgap.com/gopher/gw?a=" .. uri
uri = (string.format(gopher))
w:navigate(string.format(gopher))
return false
end
end
end)
end
With the above code in my userconf.lua direct gopher links will open
using the floodgap proxy providing I open the link in the same tab (it
all goes a bit odd if one tries to open a gopher link in a new tab or
window). This works well enough for me - but I'm sure a luahead could
do much better.
NB: Cameron Kaiser, sorry about all the malformed requests floodgap
was getting the other week when I was working on this.
Peter
(\___/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
Alte Amplius et Sine Ratione
gopher://sdf.lonestar.org/1/users/happy/
More information about the Gopher-Project
mailing list