You are not logged in.

#1 2014-01-01 10:52:47

pok0j
Member
Registered: 2013-06-07
Posts: 5

Luakit and magnet links - "Unable to load page"

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)
end

Thanks in advance.

Offline

#2 2014-03-17 09:39:24

martin92
Member
Registered: 2014-03-17
Posts: 3

Re: Luakit and magnet links - "Unable to load page"

try it with

w:navigate(w.view.uri) 

before "refurn false".
This will reload the current Page...

Offline

#3 2014-06-03 16:57:23

zoqaeski
Member
From: /earth/australia/.
Registered: 2009-09-30
Posts: 133

Re: Luakit and magnet links - "Unable to load page"

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)
end

Edit: 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

Board footer

Powered by FluxBB