You are not logged in.
Hi,
I've got luakit with working magnet links handling, but there's one annoying issue. Everytime I open magnet link luakit opens transmission and goes to "Unable to load page" page. Is there any chance to disable this behaviour? It also spawns new tab to execute transmission. It would be nice to make it "more in the background".
webview.init_funcs.magnet_hook = function (view, w)
view:add_signal("navigation-request", function (v, uri)
if string.match(uri, "^magnet:") then
local cmd = string.format("%s %q", "transmission-gtk", uri)
luakit.spawn(cmd)
return false
end
end)
endThanks in advance.
Offline
try it with
w:navigate(w.view.uri) before "refurn false".
This will reload the current Page...
Offline
Also try changing your code to the following and it'll open magnet links and mailto links using xdg-open. * Note I haven't really tested this, as I have been modifying the webview.lua file.
webview.init_funcs.navigation_request_decision = function (view, w)
view:add_signal("navigation-request", function (v, uri)
if string.match(string.lower(uri), "^magnet:") then
luakit.spawn(string.format("%s %q", "xdg-open", uri))
return false
elseif string.match(string.lower(uri), "^mailto:") then
luakit.spawn(string.format("%s %q", "xdg-open", uri))
return false
end
end)
endEdit: Any queries about luakit should probably be directed to its main thread in Community Contributions. The project isn't particularly active but occasionally the devs check there.
Last edited by zoqaeski (2014-06-03 17:00:44)
Offline