You are not logged in.

#876 2012-05-06 09:01:04

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: luakit browser framework (almost with jQuery!)

el mariachi wrote:

Oh I see! yes it's awesome stuff! big_smile well if anyone know how to make transmission open "magnet:" links do tell big_smile

Now that I'm sharing stuff, here's how I load torrents and magnet links into transmissiond. I use transmission-remote-cli from the AUR to do this.
The following code pieces need to go into the ~/.config/luakit/rc.lua

-- torrent hook
webview.init_funcs.torrent_hook = function (view, w)
    view:add_signal("navigation-request", function (v, uri)
        if string.find(uri, "%.torrent$") then
            luakit.spawn(string.format("transmission-remote-cli %q", uri))
            return false
        end 
    end)
end

This _HAS_ to be before require "downloads"!

-- magnet: hook
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-remote-cli", uri)
            luakit.spawn(cmd)
            return false
        end
    end)
end

This can go on the bottom of the rc.lua

Offline

#877 2012-05-06 20:38:37

rlevArch
Member
Registered: 2011-12-04
Posts: 35

Re: luakit browser framework (almost with jQuery!)

Army wrote:

Dude that quote is old big_smile No I didn't implement this, because it doesn't make sense anymore (my internet is too slow for youtube). But I know how it can be done, although it's not perfect.

webview.init_funcs.youtube_hook = function (view, w)
    view:add_signal("navigation-request", function (v, uri)
        if string.find(uri, "youtube%.com/watch") then
            luakit.spawn(string.format("youtube-viewer %q", uri))
            return false
        end 
    end)
end

Put this into the ~/.config/luakit/rc.lua, somewhere after the last "require" line (require "go_up").

Sweet! Just tested it and it works great!

Offline

#878 2012-05-09 02:39:42

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: luakit browser framework (almost with jQuery!)

I added this to my rc.lua but after a while (or if I open a new tab, etc) it stops private browsing

require "binds"
local add_cmds = add_cmds
local cmd = lousy.bind.cmd
add_cmds({
    cmd("nopriv[ate]", function (w)
            w:get_current():set_property("enable-private-browsing", false)
            w:notify("Non-private browsing.")
     end),
    cmd("priv[ate]", function (w)
            w:get_current():set_property("enable-private-browsing", true)
            w:notify("Private browsing.")
     end),
})

my domain_props are empty (block quote)

domain_props = { --[[
    ["all"] = {
        ["enable-scripts"]          = false,
        ["enable-plugins"]          = false,
        ["enable-private-browsing"] = false,
        ["user-stylesheet-uri"]     = "",
    },
    ["youtube.com"] = {
        ["enable-scripts"] = true,
        ["enable-plugins"] = true,
    },
    ["bbs.archlinux.org"] = {
        ["user-stylesheet-uri"]     = "file://" .. luakit.data_dir .. "/styles/dark.css",
        ["enable-private-browsing"] = true,
    }, ]]
}

any idea how to fix this?

also, I have a separate issue, where if I go to 'www.google.com/ig', when the page first loads it asks me to save a file 'talk_xpc_blank.html' - any ideas on this one?

edit: the latter problem (with iGoogle) seems to be with Privoxy and not an issue with LUAKit (when I disabled Privoxy, I didn't get the popup to download the file anymore)

Last edited by HiImTye (2012-05-09 03:54:11)

Offline

#879 2012-05-09 06:47:17

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: luakit browser framework (almost with jQuery!)

Yeah privoxy can cause such things, that's why I got rid of it. Although I have to say that the current version is a lot better and it doesn't cause those problems anymore here. Are you sure that you use the latest version of privoxy?

Offline

#880 2012-05-09 15:59:14

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: luakit browser framework (almost with jQuery!)

tye@T:~$ apt-cache policy privoxy
privoxy:
  Installed: 3.0.19-1~ppa1~oneiric1

that's the version I'm using, from the Ubun-tor repository
I'm also using an AdBlock compatible script that I put here: http://ubuntuforums.org/showthread.php?t=1974461 - it needs some work but I'll get to it later

Offline

#881 2012-05-09 16:38:41

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: luakit browser framework (almost with jQuery!)

That's the most recent version, yes. After thinking about it a bit more, could it be that you configured privoxy to be very ... strict? (I don't know a better word at the moment). Maybe you should check your settings and include exceptions in your user.local file for webpages which cause problems.

Offline

#882 2012-05-10 09:27:20

myle
Member
Registered: 2011-08-11
Posts: 35

Re: luakit browser framework (almost with jQuery!)

I am a little bit confused about what I should use in order to obtain the functionality of adblock.
Google returned:
https://bitbucket.org/cf8/dotfiles/src/ … dblock.lua

but here I have read other suggestions. Any conclusion?

Offline

#883 2012-05-10 16:29:18

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: luakit browser framework (almost with jQuery!)

Just try it, if it works, keep it, because the easylist filterlists are very good!

Offline

#884 2012-05-11 20:35:54

nXqd
Member
Registered: 2010-07-01
Posts: 173
Website

Re: luakit browser framework (almost with jQuery!)

I just retry using luakit today, but I find that the way luakit generate numbers is not effective compared to vimium ( chrome extension ). Is there any way we can generate characters instead of number and I notice with vimium some characters stay the same with same function ( like S is always for the homepage link )

thanks


When you live for a strong purpose, then hard work isn't an option. It's a necessity. - Steve Pavlina
dotFiles

Offline

#885 2012-05-11 21:33:11

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: luakit browser framework (almost with jQuery!)

You can configure this in the rc.lua. There's a commented line in it which shows how it can be done.

Offline

#886 2012-05-12 04:49:49

sinplomo
Member
Registered: 2011-09-19
Posts: 4

Re: luakit browser framework (almost with jQuery!)

I have a problem browsing some websites, and I cant figure why this is hapenning, I think that its something related to webkit...

For example this is how this website its supossed to look (using chromium, webkit too) :

http://i46.tinypic.com/kf2r6s.png


And this is how its looks in luakit:

http://i46.tinypic.com/29aure1.png



Any ideas?


moderator edit: Hi sinplomo, the images are too large and I have replaced them with links. Please read Forum Etiquette: Pasting Pictures and Code. Thanks. --fsckd

Last edited by fsckd (2012-05-12 18:30:15)

Offline

#887 2012-05-12 11:09:36

bootleg
Member
Registered: 2010-12-08
Posts: 38

Re: luakit browser framework (almost with jQuery!)

I think this is webkit related: I tried your example in luakit, midori and dwb and they all gave me the same result. Chromium is using some custom webkit I think.

Offline

#888 2012-05-13 09:19:13

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: luakit browser framework (almost with jQuery!)

Army wrote:

That's the most recent version, yes. After thinking about it a bit more, could it be that you configured privoxy to be very ... strict? (I don't know a better word at the moment). Maybe you should check your settings and include exceptions in your user.local file for webpages which cause problems.

I completely whitelisted iGoogle and no change, it's strange

any thoughts on the other problem, regarding private browsing?

Offline

#889 2012-05-13 23:25:03

ObliviousGmn
Member
Registered: 2011-09-14
Posts: 49
Website

Re: luakit browser framework (almost with jQuery!)

[deleted, Someone please remove this post]

Last edited by ObliviousGmn (2012-05-18 00:17:16)

Offline

#890 2012-05-15 10:13:01

Vain
Member
Registered: 2008-10-19
Posts: 179
Website

Re: luakit browser framework (almost with jQuery!)

I switched to firefox/pentadactyl a while back because follow mode was too slow in luakit. Yesterday, I gave luakit-git another try and guess what? Everything’s fine. Weeee! smile

“Thank you” to whoever fixed this.

Offline

#891 2012-05-16 20:31:53

ObliviousGmn
Member
Registered: 2011-09-14
Posts: 49
Website

Re: luakit browser framework (almost with jQuery!)

Has anyone else been experiencing this? Some images on not all. Get distorted.
Assuming is probably the webkit?

Turns it out it was Cairo.. Had to downgrade.

Last edited by ObliviousGmn (2012-05-17 23:32:07)

Offline

#892 2012-05-18 10:03:12

Vain
Member
Registered: 2008-10-19
Posts: 179
Website

Re: luakit browser framework (almost with jQuery!)

– edit: This no longer works in current luakit.


I don’t know if something like this has been posted before. Thought I’d might share it anyway. smile

On a german keyboard, the home row reads as: “a, s, d, f” on the left side and “j, k, l, ö” on the right side. In Firefox/Pentadactyl, I was able to use that “ö” (UTF-8!) in follow-mode-labels. In Luakit, that’s not possible because Lua isn’t really aware of UTF-8. Hence, we need a little workaround.

The following code is roughly equivalent to using “follow.style = s.upper(s.sort(s.charset("asdfjklö")))” (which, of course, wouldn’t work because of the “ö”).

-- Create follow labels containing utf8 characters.
-- Basic idea: The charset is stored in a table rather than a string. This
-- allows to iterate over each character (lua can't do this on its own becuase
-- it's not utf8 aware).
local followcharset = { "a", "s", "d", "f",  "j", "k", "l", "ö" }

-- Copied from follow.lua.
local function max_hint_len(size, base)
    local floor, len = math.floor, 0
    while size > 0 do size, len = floor(size / base), len + 1 end
    return len
end

-- string.upper() plus some special german utf8 characters.
local function germanupper(t)
    local t = string.upper(t)
    t = string.gsub(t, "ö", "Ö")
    t = string.gsub(t, "ä", "Ä")
    t = string.gsub(t, "ü", "Ü")
    return t
end

follow.style = {
    make_labels = function (size)
        -- Basic follow.charset(), but read characters from our table.
        local base = #followcharset
        local digits = max_hint_len(size, base)
        local labels, blanks = {}, {}
        for n = 1, digits do
            table.insert(blanks, followcharset[1])
        end
        for n = 1, size do
            local t, d = {}
            repeat
                d, n = (n % base) + 1, math.floor(n / base)
                table.insert(t, 1, followcharset[d])
            until n == 0
            table.insert(labels, table.concat(blanks, "", #t + 1) .. table.concat(t, ""))
        end

        -- sort(). May not be 100% accurate but it's better than nothing.
        table.sort(labels)

        -- Run upper() on all labels.
        for i, l in ipairs(labels) do
            labels[i] = germanupper(l)
        end

        return labels
    end,

    parse_input = function (text)
        -- Run upper() on user input.
        return "", germanupper(text)
    end
}

Include this somewhere below “require "follow"”.

Screenshot:

luakit-utf8-labels.png

Last edited by Vain (2012-08-22 08:21:16)

Offline

#893 2012-05-20 01:52:30

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: luakit browser framework (almost with jQuery!)

so I didn't fix the problem (being prompted to download a file every time iGoogle loads) but I found a workaround of going to http://www.google.com/ig/settings and then in the top options, after the 'Chat' header selecting the 'Hide Chat' bullet

also, to add luakit as your default browser, open $HOME/.local/share/applications/mimeapps.list and add the following lines after [Added Associations] (I just copied the firefox ones and subbed in luakit where firefox was)
LUAKit MIME GVim
make sure that there's an 'luakit.desktop' in any of the '/share/applications/' folders

find /usr/share/applications/ /usr/local/share/applications/ $HOME/.local/share/applications/ -type f 2>/dev/null | grep luakit.desktop

then just set it using whatever front end you use (in Gnome-Shell it's in 'System Info')

Last edited by HiImTye (2012-05-20 01:58:34)

Offline

#894 2012-05-23 14:42:42

Ulrar
Member
Registered: 2012-05-23
Posts: 2

Re: luakit browser framework (almost with jQuery!)

I'm sorry if it has already been asked, but I can't find a thread search function on this forum.

Just switched to luakit, and I realy like it so far, but I can't find how to start a selection ?
yy copy the uri, yt the title, but how do I select some text on the page ?
(Ofcourse without the mouse)

Another question, It seems like the hint mode don't detect the 'Javascript' links, you know, all the links just here to show a menu or things like that.
Is there some special thing to do to select them ? Be forced to tab a hundred time to get the link is not realy useable.

Thanks

Last edited by Ulrar (2012-05-23 14:58:17)

Offline

#895 2012-05-28 20:46:05

korkadapa
Member
Registered: 2008-08-27
Posts: 32

Re: luakit browser framework (almost with jQuery!)

I'm sorry if these questions have been asked before, but I couldn't find anything.

I'm wondering if it's possible to bind "Follow Hints" to something else than f and F? I can't seem to find it in bind.lua?

Also, if I select an input field with "Follow Hints", the browser goes into "Input Mode" but the input field doesn't seem to be in focus. Am I doing something wrong or is this a bug?

Thanks

Offline

#896 2012-05-28 23:00:26

bootleg
Member
Registered: 2010-12-08
Posts: 38

Re: luakit browser framework (almost with jQuery!)

Default follow hints bindings are in '/usr/share/luakit/lib/follow/binds.lua'. You can add your own bindings in your regular binds.lua.

To focus input fields consider using the 'go_input' lib ('gi' by default).

Last edited by bootleg (2012-05-28 23:00:59)

Offline

#897 2012-06-05 22:06:00

nXqd
Member
Registered: 2010-07-01
Posts: 173
Website

Re: luakit browser framework (almost with jQuery!)

Hey guys, anyone has problem when browsing travian site ( text game ). If anyone plays it here, enter http://ts8.travian.com/karte.php. I can't move the map by dragndrop

PS: I experience another error when surfering facebook message section. It doesn't display right and it keeps scrolling, I can't read the messages. Anyone has the same problem ?

Last edited by nXqd (2012-06-06 22:26:41)


When you live for a strong purpose, then hard work isn't an option. It's a necessity. - Steve Pavlina
dotFiles

Offline

#898 2012-06-06 11:17:41

jk121960
Member
From: Palos Hills, Illinois
Registered: 2011-12-09
Posts: 254

Re: luakit browser framework (almost with jQuery!)

Hi, I hadn't seen a reference to it on google, is anyone else having a problem with form control rendering in luakit and actually in the other 'vu' micro browsers like jumanji, dwb etc? My controls all render black with a large square border and it makes some controls very hard to use or it covers up adjacent text. I have a dark theme based on Aurora-Midnight slightly manipulated with lxappearance, I also for KDE apps have the system-settings widget rendering set to gtk+.  Does anyone know if there is something just not set right, is everyone else experiencing this?

thanks in advance for any help.

--jerry


Arch Awesome, Ranger & Vim the coding triple threat.

Offline

#899 2012-06-06 22:27:30

nXqd
Member
Registered: 2010-07-01
Posts: 173
Website

Re: luakit browser framework (almost with jQuery!)

jk121960 wrote:

Hi, I hadn't seen a reference to it on google, is anyone else having a problem with form control rendering in luakit and actually in the other 'vu' micro browsers like jumanji, dwb etc? My controls all render black with a large square border and it makes some controls very hard to use or it covers up adjacent text. I have a dark theme based on Aurora-Midnight slightly manipulated with lxappearance, I also for KDE apps have the system-settings widget rendering set to gtk+.  Does anyone know if there is something just not set right, is everyone else experiencing this?

thanks in advance for any help.

--jerry

Can you post a picture, I haven't experienced something like this before smile


When you live for a strong purpose, then hard work isn't an option. It's a necessity. - Steve Pavlina
dotFiles

Offline

#900 2012-06-06 23:52:28

jk121960
Member
From: Palos Hills, Illinois
Registered: 2011-12-09
Posts: 254

Re: luakit browser framework (almost with jQuery!)

nXqd wrote:
jk121960 wrote:

Hi, I hadn't seen a reference to it on google, is anyone else having a problem with form control rendering in luakit and actually in the other 'vu' micro browsers like jumanji, dwb etc? My controls all render black with a large square border and it makes some controls very hard to use or it covers up adjacent text. I have a dark theme based on Aurora-Midnight slightly manipulated with lxappearance, I also for KDE apps have the system-settings widget rendering set to gtk+.  Does anyone know if there is something just not set right, is everyone else experiencing this?

thanks in advance for any help.

--jerry

Can you post a picture, I haven't experienced something like this before smile


thanks for the post and I had to find a site to shove my image on, here is a portion of my gmail settings page, I appreciate any help this is annoying but all of the 'vi' style browsers do this on my box. Luakit, Jumanji, DWB, xxxterm etc.

thanks

--jerry

gmail settings page


Arch Awesome, Ranger & Vim the coding triple threat.

Offline

Board footer

Powered by FluxBB