You are not logged in.

#326 2011-04-18 17:15:16

jakob
Member
From: Berlin
Registered: 2005-10-27
Posts: 419

Re: luakit browser framework (almost with jQuery!)

Hey mason, thank for your fast and friendly reply and help! I’m always looking forward when doing a git pull to new functions or when checking this forum!

I added the “local key” definition as you suggested and now don’t get my last reported error any more.

However, luakit is still not starting properly with my userconf.lua, instead I get the following error:

jakob@schreibtisch> luakit                                     ~/.config/luakit
/etc/xdg/luakit/webview.lua:12: bad argument #2 to 'set_property' (string expected, got nil)

Reading line 12 of webview.lua, it’s obviously the useragent which doesn’t seem to be set with this configuration somehow. I can fix this problem by inserting the “make useragent“ section from globals.lua after my “default search engine” definition. But that certainly is not a proper solution, is it?

May this have anything to do with the fact that a “true” has to be set somewhere at the end of custom definitions in order to really insert them (as you recommended with the add_binds func to bratmaxe)?

Anyway, here is my userconf.lua:

------------------------------------------------------------------- binds.lua
local key = lousy.bind.key
menu_binds = {
-- Navigate items:
    key({},          "h",       function (w) w.menu:move_down() end),
}

-- Scrolling
add_binds("normal", {
    key({},          "h",           function (w) w:scroll_vert(more)  end),
    key({},          "l",           function (w) w:scroll_horiz(less) end),
    key({},          "q",           function (w) w:scroll_horiz(more) end),

-- “v” downloads flash videos and plays them in mplayer when finished (cclive)
    key({},             "v",        function (w) local uri = (w:get_current() or {}).uri if uri then luakit.spawn("urxvt -e cclive -f best --filename-format '%t.%s' --output-dir " .. os.getenv("HOME") .. " --exec='mplayer %f' '" .. uri .. "'") end end),

-- Close window with “j”
    key({},         "j",            function (w) w:close_win() end),
}, true)
------------------------------------------------------------------ globals.lua
-- Global variables for luakit
globals = {
    http_proxy          = "http://127.0.0.18118",
    default_window_size = "1024x1024",
}

-- Search engines
search_engines = {
    luakit      = "http://luakit.org/search/index/luakit?q=%s",
    g   = "http://google.com/search?q=%s",
    ddg = "http://duckduckgo.com/?q=%s",
    ew  = "http://en.wikipedia.org/wiki/Special:Search?search=%s",
    imdb = "http://imdb.com/find?s=all&q=%s",
    bbc = "http://search.bbc.co.uk/cgi-bin/search/results.pl?scope=all&edition=i&q=%s&go.x=0&go.y=0&go=go",
    brit = "http://www.britannica.com/search?query=%s&ct=&searchSubmit.x=0&searchSubmit.y=0",
    cam = "http://dictionary.cambridge.org/results.asp?searchword=%s&x=0&y=0",
    cnn = "http://search.cnn.com/pages/search.jsp?query=%s",
    gi  = "http://images.google.com/images?safe=off&q=%s",
    gm  = "http://maps.google.com/maps?q=%s",
    gbook  = "http://books.google.com/books?q=%s&btnG=Search+Books&as_brr=0",
    urb = "http://www.urbandictionary.com/define.php?term=%s",
    nyt = "http://query.nytimes.com/search/query?query=%s&srchst=nyt",
    oed = "http://www.oed.com/search?searchType=dictionary&q=%s&_searchBtn=Search",
    yt  = "http://www.youtube.com/results?search_query=%s&search=Search",
    webster = "http://www.m-w.com/dictionary/%s",
    webstert = "http://www.m-w.com/cgi-bin/thesaurus?book=Thesaurus&va=%s",
    thes = "http://thesaurus.com/browse/%s",
    leo = "http://dict.leo.org/?lp=ende&search=%s",
    ling = "http://www.linguee.de/deutsch-englisch/search?sourceoverride=none&source=auto&query=%s",
}

-- Set google as fallback search engine
search_engines.default = search_engines.g

------------------------------------------------------------------------rc.lua
-- Allow pages to open new tab only (now new windows!)
webview.init_funcs.window_decision = function (view, w)
    view:add_signal("new-window-decision", function (v, uri, reason)
        w:new_tab(uri)
        return true
    end)
end

Best wishes,

Jakob

edit: with adding the local scroll_step and more, less definitions, I am now again able to scroll with my customized scrolling keys. I‘m slowly learning this kind of configuration…

Another thing: Is there a command line switch allowing other applications to send uris to running instances of luakit? Currently, if I click a link in Thunderbird, it opens a new instance of luakit.

Last edited by jakob (2011-04-18 18:13:39)

Offline

#327 2011-04-18 22:17:24

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

jakob wrote:

Hey mason, thank for your fast and friendly reply and help! I’m always looking forward when doing a git pull to new functions or when checking this forum!

I added the “local key” definition as you suggested and now don’t get my last reported error any more.

However, luakit is still not starting properly with my userconf.lua, instead I get the following error:

jakob@schreibtisch> luakit                                     ~/.config/luakit
/etc/xdg/luakit/webview.lua:12: bad argument #2 to 'set_property' (string expected, got nil)

Reading line 12 of webview.lua, it’s obviously the useragent which doesn’t seem to be set with this configuration somehow. I can fix this problem by inserting the “make useragent“ section from globals.lua after my “default search engine” definition. But that certainly is not a proper solution, is it?

May this have anything to do with the fact that a “true” has to be set somewhere at the end of custom definitions in order to really insert them (as you recommended with the add_binds func to bratmaxe)?

Anyway, here is my userconf.lua:

------------------------------------------------------------------- binds.lua
local key = lousy.bind.key
menu_binds = {
-- Navigate items:
    key({},          "h",       function (w) w.menu:move_down() end),
}

-- Scrolling
add_binds("normal", {
    key({},          "h",           function (w) w:scroll_vert(more)  end),
    key({},          "l",           function (w) w:scroll_horiz(less) end),
    key({},          "q",           function (w) w:scroll_horiz(more) end),

-- “v” downloads flash videos and plays them in mplayer when finished (cclive)
    key({},             "v",        function (w) local uri = (w:get_current() or {}).uri if uri then luakit.spawn("urxvt -e cclive -f best --filename-format '%t.%s' --output-dir " .. os.getenv("HOME") .. " --exec='mplayer %f' '" .. uri .. "'") end end),

-- Close window with “j”
    key({},         "j",            function (w) w:close_win() end),
}, true)
------------------------------------------------------------------ globals.lua
-- Global variables for luakit
globals = {
    http_proxy          = "http://127.0.0.18118",
    default_window_size = "1024x1024",
}

-- Search engines
search_engines = {
    luakit      = "http://luakit.org/search/index/luakit?q=%s",
    g   = "http://google.com/search?q=%s",
    ddg = "http://duckduckgo.com/?q=%s",
    ew  = "http://en.wikipedia.org/wiki/Special:Search?search=%s",
    imdb = "http://imdb.com/find?s=all&q=%s",
    bbc = "http://search.bbc.co.uk/cgi-bin/search/results.pl?scope=all&edition=i&q=%s&go.x=0&go.y=0&go=go",
    brit = "http://www.britannica.com/search?query=%s&ct=&searchSubmit.x=0&searchSubmit.y=0",
    cam = "http://dictionary.cambridge.org/results.asp?searchword=%s&x=0&y=0",
    cnn = "http://search.cnn.com/pages/search.jsp?query=%s",
    gi  = "http://images.google.com/images?safe=off&q=%s",
    gm  = "http://maps.google.com/maps?q=%s",
    gbook  = "http://books.google.com/books?q=%s&btnG=Search+Books&as_brr=0",
    urb = "http://www.urbandictionary.com/define.php?term=%s",
    nyt = "http://query.nytimes.com/search/query?query=%s&srchst=nyt",
    oed = "http://www.oed.com/search?searchType=dictionary&q=%s&_searchBtn=Search",
    yt  = "http://www.youtube.com/results?search_query=%s&search=Search",
    webster = "http://www.m-w.com/dictionary/%s",
    webstert = "http://www.m-w.com/cgi-bin/thesaurus?book=Thesaurus&va=%s",
    thes = "http://thesaurus.com/browse/%s",
    leo = "http://dict.leo.org/?lp=ende&search=%s",
    ling = "http://www.linguee.de/deutsch-englisch/search?sourceoverride=none&source=auto&query=%s",
}

-- Set google as fallback search engine
search_engines.default = search_engines.g

------------------------------------------------------------------------rc.lua
-- Allow pages to open new tab only (now new windows!)
webview.init_funcs.window_decision = function (view, w)
    view:add_signal("new-window-decision", function (v, uri, reason)
        w:new_tab(uri)
        return true
    end)
end

Best wishes,

Jakob


The problem is you've re-defined the globals table in your userconf, do:

-- Global variables for luakit
globals = lousy.util.table.join(globals, {
    http_proxy          = "http://127.0.0.18118",
    default_window_size = "1024x1024",
})

Or:

-- Global variables for luakit
globals.http_proxy = "http://127.0.0.18118",
globals.default_window_size = "1024x1024",

Or edit a local copy of globals.lua in ~/.config/luakit smile

jakob wrote:

edit: with adding the local scroll_step and more, less definitions, I am now again able to scroll with my customized scrolling keys. I‘m slowly learning this kind of configuration…

Several parts of webview.lua, window.lua & binds.lua rely on some default values in the globals table. Using the above method to modify the globals table will fix these problems of yours. 

jakob wrote:

Another thing: Is there a command line switch allowing other applications to send uris to running instances of luakit? Currently, if I click a link in Thunderbird, it opens a new instance of luakit.

Not at the moment, you might like to check out Husios luakit fork which has a dbus branch (lagging slightly) here https://github.com/husio/luakit which supports opening windows in existing instances. Personally in the stock luakit I'd like to attempt a luasocket solution but I haven't tried it yet.

Last edited by mason.larobina (2011-04-18 22:21:52)

Offline

#328 2011-04-20 14:51:09

bratmaxe
Member
From: Germany
Registered: 2010-11-07
Posts: 71

Re: luakit browser framework (almost with jQuery!)

bratmaxe wrote:

Now I stop questioning...

This information is outdated tongue

I really like the idea of having a userconf with customazitions but if i change global values the way you recommended to jakob, I run into the same issue as with the keybindings: New values are simply ignored. Any trick about that available? Could not figure it out myself, unfortunatly I'm not experienced with lua...

Offline

#329 2011-04-20 19:21:53

jakob
Member
From: Berlin
Registered: 2005-10-27
Posts: 419

Re: luakit browser framework (almost with jQuery!)

Hello, it’s me again (what surprise!)

I couldn’t figure out how to implement this “join“ function in order to not overwrite my add_binds-table. I think what brings me in trouble here is the "normal" sub-table. Here is the crucial part of the config and the corresponding error:

menu_binds = lousy.util.table.join(menu_binds, {
-- Navigate items:
    key({},          "h",       function (w) w.menu:move_down() end),
},true)
-- Scrolling
add_binds = lousy.util.table.join(add_binds("normal", {
    key({},          "h",           function (w) w:scroll_vert(more)  end),
    key({},          "l",           function (w) w:scroll_horiz(less) end),
    key({},          "q",           function (w) w:scroll_horiz(more) end),

-- “v” downloads flash videos and plays them in mplayer when finished (cclive)
    key({},             "v",        function (w) local uri = (w:get_current() or {}).uri if uri then luakit.spawn("urxvt -e cclive -f best --filename-format '%t.%s' --output-dir " .. os.getenv("HOME") .. " --exec='mplayer %f' '" .. uri .. "'") end end),

-- Close window with “J”
    key({},         "J",            function (w) w:close_win() end),
}))
------------------------------------------------------------------ globals.lua
--- Global variables for luakit
globals = lousy.util.table.join(globals, {
    http_proxy          = "http://127.0.0.1:8118",
    default_window_size = "1024x1024",
}
jakob@schreibtisch> luakit                                 ~/.config/luakit
/usr/share/luakit/lib/lousy/util.lua:104: bad argument #1 to 'pairs' (table expected, got boolean)
E: luakit: main:177: no windows spawned by rc file, exiting
zsh: exit 1     luakit

Is there a way to define custom binds in the fashion of globals.http_proxy as you suggested above with add_binds ("normal")?

Germans are taking extra lessons smile

Thank you very much in advance for helping out and with best wishes,

Jakob

Offline

#330 2011-04-22 11:08:04

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

jakob wrote:

Hello, it’s me again (what surprise!)

I couldn’t figure out how to implement this “join“ function in order to not overwrite my add_binds-table. I think what brings me in trouble here is the "normal" sub-table. Here is the crucial part of the config and the corresponding error:

menu_binds = lousy.util.table.join(menu_binds, {
-- Navigate items:
    key({},          "h",       function (w) w.menu:move_down() end),

},true)

lousy.util.table.join takes a list of table arrays and joins them together, `true` is not a table.

Also because menu_binds is a table this will work:

-- Insert at start of menu_binds table
table.insert(menu_binds, 1, key({}, "h", function (w) w.menu:move_down() end))
jakob wrote:
-- Scrolling
add_binds = lousy.util.table.join(add_binds("normal", {
    key({},          "h",           function (w) w:scroll_vert(more)  end),
    key({},          "l",           function (w) w:scroll_horiz(less) end),
    key({},          "q",           function (w) w:scroll_horiz(more) end),

-- “v” downloads flash videos and plays them in mplayer when finished (cclive)
    key({},             "v",        function (w) local uri = (w:get_current() or {}).uri if uri then luakit.spawn("urxvt -e cclive -f best --filename-format '%t.%s' --output-dir " .. os.getenv("HOME") .. " --exec='mplayer %f' '" .. uri .. "'") end end),

-- Close window with “J”
    key({},         "J",            function (w) w:close_win() end),
}))

A few things: add_binds doesn't return anything which may cause lousy.util.table.join to error. And as mentioned in a previous post to replace bindings you give the add_binds function true for the third argument (to place them at the beginning of the binds list for that mode or modes). So this will work:

-- Scrolling
add_binds("normal", {
    key({},          "h",           function (w) w:scroll_vert(more)  end),
    key({},          "l",           function (w) w:scroll_horiz(less) end),
    key({},          "q",           function (w) w:scroll_horiz(more) end),

-- “v” downloads flash videos and plays them in mplayer when finished (cclive)
    key({},             "v",        function (w) 
        local uri = (w:get_current() or {}).uri 
        if uri then 
            luakit.spawn("urxvt -e cclive -f best --filename-format '%t.%s' --output-dir " .. os.getenv("HOME") .. " --exec='mplayer %f' '" .. uri .. "'") 
        end 
    end),

-- Close window with “J”
    key({},         "J",            function (w) w:close_win() end),
}, true) -- Place before all other binds
jakob wrote:
------------------------------------------------------------------ globals.lua
--- Global variables for luakit
globals = lousy.util.table.join(globals, {
    http_proxy          = "http://127.0.0.1:8118",
    default_window_size = "1024x1024",
}

This should work fine.

jakob wrote:
jakob@schreibtisch> luakit                                 ~/.config/luakit
/usr/share/luakit/lib/lousy/util.lua:104: bad argument #1 to 'pairs' (table expected, got boolean)
E: luakit: main:177: no windows spawned by rc file, exiting
zsh: exit 1     luakit

Is there a way to define custom binds in the fashion of globals.http_proxy as you suggested above with add_binds ("normal")?

Germans are taking extra lessons smile

Thank you very much in advance for helping out and with best wishes,

Jakob

Let me know how this goes or if you have any other problems, I have as much time as you need (though I would recommend picking up a quick tutorial on Lua types & etc).

Last edited by mason.larobina (2011-04-22 11:08:50)

Offline

#331 2011-04-22 14:36:02

moneylcj
Member
Registered: 2011-04-07
Posts: 14

Re: luakit browser framework (almost with jQuery!)

when we add the next line to ~/.gtkrc-2.0
gtk-key-theme-name = "Emacs"

when we type something in gtk-app's textbox we can use emacs keybindings. but in luakit the emacs keybindings can't work, some know how  make it to work?
thank you.

Offline

#332 2011-04-22 17:34:08

damnick
Member
From: Greece, Athens
Registered: 2011-04-22
Posts: 2
Website

Re: luakit browser framework (almost with jQuery!)

Great browser, but i can't find some things:

1. How can i enable the developer tools (inspect element etc)?

2. Where the passwords are stored?

3. How can i open a url from urxvt or alpine to a new tab and not in a new window?

4. How can i run from a keybinding a javascript?

Offline

#333 2011-04-23 18:02:41

gaunt
Member
Registered: 2009-12-13
Posts: 62

Re: luakit browser framework (almost with jQuery!)

To add one more question for the devs smile

I notice that there was a noscript-like fork of luakit (here), along with a pull request, last year.  I can't find any more information on that - was it ever merged in, or did it get rejected, and if so, was there a specific reason for rejection?

Thanks for the great browser!

Offline

#334 2011-04-23 21:02:16

Cristhyano
Member
Registered: 2011-04-18
Posts: 16

Re: luakit browser framework (almost with jQuery!)

Here in Brazil we use a lot of orkut.com. The problem is with luakit and midori, the website displays the older version and says that my browser doesn't support it. With Jumanji it displays the new version, there's no compatibility problem.
Some people said to me it's due to the useragent, but i don't know how to edit it in globals.lua to solve this. Anyone knows?

Offline

#335 2011-04-24 08:53:03

kli
Member
Registered: 2011-04-03
Posts: 7

Re: luakit browser framework (almost with jQuery!)

Cristhyano wrote:

Here in Brazil we use a lot of orkut.com. The problem is with luakit and midori, the website displays the older version and says that my browser doesn't support it. With Jumanji it displays the new version, there's no compatibility problem.
Some people said to me it's due to the useragent, but i don't know how to edit it in globals.lua to solve this. Anyone knows?

Change the user agent string to the one of Safari 4 's and you will have no problems.

Offline

#336 2011-04-24 13:19:54

Cristhyano
Member
Registered: 2011-04-18
Posts: 16

Re: luakit browser framework (almost with jQuery!)

kli wrote:
Cristhyano wrote:

Here in Brazil we use a lot of orkut.com. The problem is with luakit and midori, the website displays the older version and says that my browser doesn't support it. With Jumanji it displays the new version, there's no compatibility problem.
Some people said to me it's due to the useragent, but i don't know how to edit it in globals.lua to solve this. Anyone knows?

Change the user agent string to the one of Safari 4 's and you will have no problems.

Do you mind showing me? I have no clue about how to do that.

Offline

#337 2011-04-24 13:39:28

kli
Member
Registered: 2011-04-03
Posts: 7

Re: luakit browser framework (almost with jQuery!)

Sure.
Edit globals.lua
Best way is  to copy it from /etc/xdg/luakit to /home/user/.config/luakit first.
Look for the line :
globals.useragent = .....    ## about line 23
And change the string between the quotation marks to :
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16

Reload config/restart Luakit, and cross fingers :-)

To see if it works navigate to Opera's download site, and you will be offered to download the latest version for Mac :-)

Last edited by kli (2011-04-24 13:45:59)

Offline

#338 2011-04-24 14:08:48

Cristhyano
Member
Registered: 2011-04-18
Posts: 16

Re: luakit browser framework (almost with jQuery!)

Holy fucking jesus christ it's working.
I love you.

There's no way of doing this without telling i'm on a mac?
Jumanji doesn't do that. But it's ok this way anyway, i don't download any apps from the interwebs.

Last edited by Cristhyano (2011-04-24 14:10:19)

Offline

#339 2011-04-24 14:13:20

Cristhyano
Member
Registered: 2011-04-18
Posts: 16

Re: luakit browser framework (almost with jQuery!)

Just did it copying the user agent from firefox 4. Thanks for the tip, dude.

But there's another problem. It's not a problem for me at all, i can use mouse, but in orkut.com and probably some other sites, the mouse is necessary. The keybindings to navigate doesn't work. H, j, k, l, the arrows, page up, page down, everything doesn't do a thing.
It's not a problem for me, but i'm telling because maybe it's something easy to fix.

Last edited by Cristhyano (2011-04-24 23:31:13)

Offline

#340 2011-04-25 16:48:18

damnick
Member
From: Greece, Athens
Registered: 2011-04-22
Posts: 2
Website

Re: luakit browser framework (almost with jQuery!)

Cristhyano wrote:

Just did it copying the user agent from firefox 4. Thanks for the tip, dude.

But there's another problem. It's not a problem for me at all, i can use mouse, but in orkut.com and probably some other sites, the mouse is necessary. The keybindings to navigate doesn't work. H, j, k, l, the arrows, page up, page down, everything doesn't do a thing.
It's not a problem for me, but i'm telling because maybe it's something easy to fix.

Try to change your keyboard layout to english and the keys h,j,k,l will work

Offline

#341 2011-04-25 19:24:55

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

Cristhyano wrote:

Just did it copying the user agent from firefox 4. Thanks for the tip, dude.

But there's another problem. It's not a problem for me at all, i can use mouse, but in orkut.com and probably some other sites, the mouse is necessary. The keybindings to navigate doesn't work. H, j, k, l, the arrows, page up, page down, everything doesn't do a thing.
It's not a problem for me, but i'm telling because maybe it's something easy to fix.

This is a known problem on any sites using frames as the scrolling binds only scroll the main webkit frame. I don't know if it is possible to scroll the focused frame (at the moment we can only scroll the main frame because we are wrapping the webview in a GtkScrolledWindow widget).

We may have to move to javascript scrolling binds. If anybody has any javascript snippets that can do that let me know.

Offline

#342 2011-04-25 22:08:00

Cristhyano
Member
Registered: 2011-04-18
Posts: 16

Re: luakit browser framework (almost with jQuery!)

At least the scrollbar shows up normally on that sites.

Offline

#343 2011-05-01 13:18:38

jakob
Member
From: Berlin
Registered: 2005-10-27
Posts: 419

Re: luakit browser framework (almost with jQuery!)

Hello,

I’m sad to say that I wasn’t able to figure it out really…

mason.larobina wrote:

lousy.util.table.join takes a list of table arrays and joins them together, `true` is not a table.
Also because menu_binds is a table this will work:

-- Insert at start of menu_binds table
table.insert(menu_binds, 1, key({}, "h", function (w) w.menu:move_down() end))

I didn’t really get what “start of menu_binds table” meant considering me wanting to keep customizations separated in my userconf.lua.
For the add_binds you said “Place before all other binds“:

mason.larobina wrote:
-- Scrolling
add_binds("normal", {
[…]
}, true) -- Place before all other binds

This is why I extracted my bind-customizations for menu_binds and add_binds to a userbinds.lua file which was sourced before the binds.lua but it did not work out.

I now ended up with amending binds.lua and keep other settings in userconf.lua. doing a short diff on the binds.lua after an update is not too much of an effort anyway…

mason.larobina wrote:

Let me know how this goes or if you have any other problems, I have as much time as you need (though I would recommend picking up a quick tutorial on Lua types & etc).

I really appreciate your help but won’t be able to dive into some lua documentation some time soon, since my workload from university is far too high at the moment… luakit now works as I want it to, which is the most important thing for me smile

Thanks again for your efforts creating this fantastic browser and also maintaining this very personal level of assistance in the forums here.

Best,

Jakob

Last edited by jakob (2011-05-01 13:22:26)

Offline

#344 2011-05-01 15:20:32

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

jakob wrote:

Hello,

I’m sad to say that I wasn’t able to figure it out really…

mason.larobina wrote:

lousy.util.table.join takes a list of table arrays and joins them together, `true` is not a table.
Also because menu_binds is a table this will work:

-- Insert at start of menu_binds table
table.insert(menu_binds, 1, key({}, "h", function (w) w.menu:move_down() end))

I didn’t really get what “start of menu_binds table” meant considering me wanting to keep customizations separated in my userconf.lua.

Have a quick peek at the table.insert function. The `table.insert(menu_binds, 1, key(..))` call will insert the new key binding at position 1 which pushes all other bindings up one notch. That's what I mean by "Insert at start of menu_binds table".

jakob wrote:

For the add_binds you said “Place before all other binds“:

mason.larobina wrote:
-- Scrolling
add_binds("normal", {
[…]
}, true) -- Place before all other binds

This is why I extracted my bind-customizations for menu_binds and add_binds to a userbinds.lua file which was sourced before the binds.lua but it did not work out.

Before binds.lua? You'd probably get errors because the add_binds function is defined in binds.lua, try requiring it after.

The comment "Place before all other binds" might have confused you, I didn't mean call the add_binds function before all other bindings. I mean calling add_binds with `true` as the third argument makes the add_binds function insert all your custom binds before all previous bindings (I.e. to the beginning of the binds list).

jakob wrote:

I now ended up with amending binds.lua and keep other settings in userconf.lua. doing a short diff on the binds.lua after an update is not too much of an effort anyway…

mason.larobina wrote:

Let me know how this goes or if you have any other problems, I have as much time as you need (though I would recommend picking up a quick tutorial on Lua types & etc).

I really appreciate your help but won’t be able to dive into some lua documentation some time soon, since my workload from university is far too high at the moment… luakit now works as I want it to, which is the most important thing for me smile

If you ever get stuck again drop by IRC (or email, or github, or here) and I'll help configure luakit for you (or anyone).

Offline

#345 2011-05-01 16:02:14

bratmaxe
Member
From: Germany
Registered: 2010-11-07
Posts: 71

Re: luakit browser framework (almost with jQuery!)

I hate stealing your time mason.larobina, and my problem is not very important, so I really do not claim for an answer smile
But my last question was imprecise, so I would just like to correct it: Changing globals by the userconf works as expected, except the scroll_step. My userconf globals-part looks like that:

globals = lousy.util.table.join(globals, {

    scroll_step         = 160,
    load_etc_hosts      = false,
})

But the scroll_step remains 40.

Offline

#346 2011-05-01 16:14:12

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

bratmaxe wrote:

I hate stealing your time mason.larobina, and my problem is not very important, so I really do not claim for an answer smile
But my last question was imprecise, so I would just like to correct it: Changing globals by the userconf works as expected, except the scroll_step. My userconf globals-part looks like that:

globals = lousy.util.table.join(globals, {

    scroll_step         = 160,
    load_etc_hosts      = false,
})

But the scroll_step remains 40.

Turns out that's my fault for trying to "cache" the scroll step strings. See where global.scroll_step is used at the top of binds.lua to see what I mean. I may do something about that by the next release.

Offline

#347 2011-05-01 19:50:59

DoctorSamulus
Member
Registered: 2010-11-04
Posts: 53

Re: luakit browser framework (almost with jQuery!)

Has luakit been locking up for anyone else lately? Ever since I upgraded libwebkit yesterday luakit seems to randomly lock up my entire x  while spitting out the error message:

 (luakit:10338): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed 

Over and over again. I had to switch to a tty and kill it before my system returned to normal. In both luakit-git and luakit stable this happened.

Offline

#348 2011-05-01 20:01:32

kazuo
Member
From: São Paulo/Brazil
Registered: 2008-03-18
Posts: 413
Website

Re: luakit browser framework (almost with jQuery!)

DoctorSamulus wrote:

Has luakit been locking up for anyone else lately? Ever since I upgraded libwebkit yesterday luakit seems to randomly lock up my entire x  while spitting out the error message:

 (luakit:10338): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed 

Over and over again. I had to switch to a tty and kill it before my system returned to normal. In both luakit-git and luakit stable this happened.

I have it too. And its looks like it only happens when I right click (old habit from using 'search for the selection' from firefox).

I think that I read about problems with right click, but I can't find it now...

EDIT: Found the reference. It's is on page 13 of this thread.

I'm using libwebkit-1.4.0 (from repos) I'm gonna try to downgrade to 1.3.9 and/or update to svn/nightly.

Last edited by kazuo (2011-05-01 20:08:59)

Offline

#349 2011-05-01 22:10:06

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

kazuo wrote:
DoctorSamulus wrote:

Has luakit been locking up for anyone else lately? Ever since I upgraded libwebkit yesterday luakit seems to randomly lock up my entire x  while spitting out the error message:

 (luakit:10338): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed 

Over and over again. I had to switch to a tty and kill it before my system returned to normal. In both luakit-git and luakit stable this happened.

I have it too. And its looks like it only happens when I right click (old habit from using 'search for the selection' from firefox).

I think that I read about problems with right click, but I can't find it now...

EDIT: Found the reference. It's is on page 13 of this thread.

I'm using libwebkit-1.4.0 (from repos) I'm gonna try to downgrade to 1.3.9 and/or update to svn/nightly.

Yes the update to 1.4.0 is the cause of that. Sadly I don't know if it is something we are doing wrong or if it's a regression in webkit-gtk.

Offline

#350 2011-05-01 22:30:22

portix
Member
Registered: 2009-01-13
Posts: 757

Re: luakit browser framework (almost with jQuery!)

This doesn't happen if one changes the populate_popup function to

    populate_popup = function (view, w)
        view:add_signal("populate-popup", function (v)
        end)
    end,

so that only the default popup is shown, so i guess this is not webkit related.

Edit: There seems to be a problem with submenus, it also doesn't happen without submenus in webview.lua.

Last edited by portix (2011-05-01 22:54:52)

Offline

Board footer

Powered by FluxBB