You are not logged in.

#1 2010-05-18 17:46:11

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

luakit browser framework (almost with jQuery!)

Edit: This information is out of date by a few years now, luakit works great now!, get tinkering!

Hey Guys,

As a project to teach myself C I've spent the last 3 weeks slapping the AwesomeWM Lua API on to a WebKit based micro-browser (in this case I chose surf) with the intention of creating a dynamic, easy to configure, easy to prototype, micro-browser configured and extended entirely by Lua.

I've got window creation and several functioning widgets working (webviews, textareas, hboxes, vboxes and a notebook widget for tabbing) but I've still got a long way to go.

With a bit of work on each of these widgets and the development of a "higher-level" Lua library like the AwesomeWM projects awful library the browser will be ready for every day use. The awful library (in case you are not familiar with it) provides a friendly wrapper around the AwesomeWM's raw C API, I plan on creating the same for Luakit.

I intend (like the awesome window manager) for Luakit to be more of a browser-framework and the actual look and behavior of the browser be crafted entirely by the users Lua config.

I have the project hosted here:

http://github.com/mason-larobina/luakit

And a public issue tracker and wiki setup here:

http://www.luakit.org/

Discussion about the direction of Luakit, feature suggestions, testers (down the track) and developers welcome.

Happy hacking!

Second Edit: Screenshots of luakit in action:

luakit.ssl.png luakit.following.png

luakit.keyword.following.png luakit.archlinux.colours.png

luakit.tabs.and.commands.png luakit.insert.text.png

luakit.searching.png

Last edited by mason.larobina (2012-06-10 02:22:08)

Offline

#2 2010-08-09 19:58:13

jwbirdsong
Member
From: Western KS USA
Registered: 2006-11-25
Posts: 173

Re: luakit browser framework (almost with jQuery!)

Now available in AUR
Git branch <---- best option for most ppl.
Stable <<------  NOW in community HERE
develop <---  DON'T let the name throw you.....  this branch is quite stable.

Hurry, while supplies last!!

Last edited by jwbirdsong (2011-05-09 00:49:12)


PLEASE read and try to FIX/FILE BUGS instead of assuming other have/will.

Offline

#3 2010-08-10 08:20:03

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: luakit browser framework (almost with jQuery!)

So many neat browsers to choose from,i love it!

Offline

#4 2010-08-11 14:19:18

0mark
Member
From: earth
Registered: 2010-06-09
Posts: 152
Website

Re: luakit browser framework (almost with jQuery!)

Interesting Project. I used to use uzbl for quite some time now, but i dont like the 'new' python event handler. I thought about forking a older uzbl without external event handler, but never made it. This could be what i looked for.


Ceterum autem censeo Systemdinem esse delendam

Offline

#5 2010-08-11 15:51:34

quigybo
Member
Registered: 2009-01-15
Posts: 221

Re: luakit browser framework (almost with jQuery!)

Very sexy, this looks like just the right balance between speed and customisability, filling the gap between uzbl and jumanji/surf nicely. A big +1 for the project, thanks. Now to brush up on my lua tongue

Edit: how do I go about loading and running javascript? Specifically I would like to get a link following script of some sort working.

Last edited by quigybo (2010-08-11 16:15:44)

Offline

#6 2010-08-12 02:04:25

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

Re: luakit browser framework (almost with jQuery!)

quigybo wrote:

Very sexy, this looks like just the right balance between speed and customisability, filling the gap between uzbl and jumanji/surf nicely. A big +1 for the project, thanks. Now to brush up on my lua tongue

Edit: how do I go about loading and running javascript? Specifically I would like to get a link following script of some sort working.

No need, I've already got link following working smile

luakit.following.png luakit.keyword.following.png

The changes can be found in the develop branch at:

http://github.com/mason-larobina/luakit

Enjoy!

Last edited by mason.larobina (2010-08-14 09:09:39)

Offline

#7 2010-08-12 02:16:19

Xlator
Member
Registered: 2009-11-14
Posts: 30

Re: luakit browser framework (almost with jQuery!)

So basically an improved jumanji? Looks incredible, will give it a go. If it works as beautifully on PPC as jumanji does, I will be thrilled. smile

Offline

#8 2010-08-12 02:49:00

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

Re: luakit browser framework (almost with jQuery!)

@mason.larobina: i guess you are using this script. I noticed, that there are some links that will not be recognized  with this script. Maybe you should take a look at http://bitbucket.org/portix/dwb/src/tip/data/hints.js, this script will work better. Just ignore or delete the  last 3 functions and there are  some variables that need to be added: hint_letter_seq, hint_font_size, hint_font_weight,  hint_font_family, hint_style, hint_fg_color, hint_bg_color. hint_active_color, hint_normal_color, hint_border, hint_opacity.

Offline

#9 2010-08-12 10:09:45

quigybo
Member
Registered: 2009-01-15
Posts: 221

Re: luakit browser framework (almost with jQuery!)

mason.larobina wrote:

No need, I've already got link following working smile

Even sexier. Thanks.

Offline

#10 2010-08-12 17:34:11

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

Re: luakit browser framework (almost with jQuery!)

portix wrote:

@mason.larobina: i guess you are using this script. I noticed, that there are some links that will not be recognized  with this script. Maybe you should take a look at http://bitbucket.org/portix/dwb/src/tip/data/hints.js, this script will work better. Just ignore or delete the  last 3 functions and there are  some variables that need to be added: hint_letter_seq, hint_font_size, hint_font_weight,  hint_font_family, hint_style, hint_fg_color, hint_bg_color. hint_active_color, hint_normal_color, hint_border, hint_opacity.

Thanks for pointing that out, I realise the script I pulled in is a few months old by now. Javascript isn't my language so I'll be a little while updating the script to support overlays and keyword matching like karottenreibe's port.

For the moment follow.js has worked for everything I've tried (except in gmail.com which is a known troublemaker) but I'll add it to my list of things to do or organise.

Offline

#11 2010-08-12 18:59:09

Jodell
Member
Registered: 2009-10-09
Posts: 285

Re: luakit browser framework (almost with jQuery!)

Can links be opened in a new window? I've tried but nothing happens.

Offline

#12 2010-08-12 20:23:02

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

Re: luakit browser framework (almost with jQuery!)

Jodell wrote:

Can links be opened in a new window? I've tried but nothing happens.

At the moment you can open a new window by binding a key to the new_window() function however new window requests from webkit won't work yet as we are not handling the "new-window-policy-decision-requested" webview event.

Offline

#13 2010-08-12 20:37:11

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

Re: luakit browser framework (almost with jQuery!)

luakit release 2010.08.13

http://luakit.org/news/1

Summary of changes from 2010.08.07 to 2010.08.13:

* Add -v,--verbose option to toggle debugging output
* Re-licensed MIT code to GPLv3
* Add eval_js(..) webview widget method
* Add eval_js_from_file(..) helper function to load and execute a script using the eval_js webview method
* Add luakit.selection(name) which returns the contents of either the "primary", "secondary" or "clipboard" selection
* Add xdg aware file finding functions to util.lua   
* Add :websearch [engine] [query] command
* Add p bind which opens the primary selection in the current tab or P to open in a new tab
* Add d to close current tab
* Add o, t & ,g as shortcuts for :open, :tabopen & :websearch google
* Add link hinting and following support
* Add Shift+Insert key binding to paste current primary selection in the input bar
* Add search history navigation
* Add proxy support
* Add ssl certificate validation options
* Add command line completion for command mode
* Add "link-hover" & "link-unhover" signal handlers to display and hide the hovered uri in the statusbar
* Add file downloading support with wget
* Add Control+w and Control-u readline bindings in the command mode
* Use util.escape to sanitise label widgets text
* Several bug fixes

Source download for 2010.08.13:

http://github.com/mason-larobina/luakit … 2010.08.13

Enjoy!

Offline

#14 2010-08-12 22:38:46

vae77
Member
Registered: 2010-07-02
Posts: 75
Website

Re: luakit browser framework (almost with jQuery!)

Very interesting, great job, thanks smile

Offline

#15 2010-08-13 01:24:59

Borosai
Member
From: Sandy Appendix, U.S.A.
Registered: 2006-06-15
Posts: 227

Re: luakit browser framework (almost with jQuery!)

I will definitely try this out... soon... ish.

Offline

#16 2010-08-13 12:01:17

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: luakit browser framework (almost with jQuery!)

Posting from luakit:

how do I auto-enter insert mode when focusing a text box?
how can I scroll by pages? actually, if I'm not focused on a text box and enter insert mode, then page up/down, (shift) space work normally. this probably isn't intended behavior.
when I'm editing text and exit insert mode, I expect vim's normal mode commands to work xD. someone's already ported vi to javascript actually: http://gpl.internetconnection.net/vi/
I need mouse bindings to get new tab on middle click, rocker / mouse gestures.
the rc.lua seems really big. some of these functions could be pushed out into a library.

Offline

#17 2010-08-14 00:14:44

Chippeur
Member
Registered: 2010-01-25
Posts: 19

Re: luakit browser framework (almost with jQuery!)

Interesting browser, I like it smile

I'm not a vi addicted so I try to change some keys, but I didn't find how to use the "Shift" key.
The following line does nothing.

bind.key({ "Control", "Shift" }, "Tab",   function (w, b) w:prev_tab(1) end),

Edit: Hum Shift + Up is ok, maybe we can't set two modifiers ?

2 others things :
- Backspace does nothing, delete the last char would be perfect
- Without the verbose/debug (-v) mode a line is printing for each visited page. (like that: Requested link: https://www.google.com/ (text/html)...)

Last edited by Chippeur (2010-08-14 00:50:31)


Sorry in advance for my poor english...

Offline

#18 2010-08-14 06:24:57

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

Re: luakit browser framework (almost with jQuery!)

Chippeur wrote:

Interesting browser, I like it smile

I'm not a vi addicted so I try to change some keys, but I didn't find how to use the "Shift" key.
The following line does nothing.

bind.key({ "Control", "Shift" }, "Tab",   function (w, b) w:prev_tab(1) end),

Edit: Hum Shift + Up is ok, maybe we can't set two modifiers ?

Ah, you've discovered something interesting. When you hold down Control+Shift and press Tab you are actually getting an ISO_Left_Tab key.

Your bind is now:

bind.key({ "Control", "Shift" }, "ISO_Left_Tab",   function (w, b) w:prev_tab(1) end),

Put this in your "key-press" signal handler to get the modifier table & key name for each key press:

print(table.concat(mods, "|"), key)
Chippeur wrote:

2 others things :
- Backspace does nothing, delete the last char would be perfect

What do you mean? In form fields or the input bar? Backspace works fine for me in the input bar & it works fine in insert mode.

Chippeur wrote:

- Without the verbose/debug (-v) mode a line is printing for each visited page. (like that: Requested link: https://www.google.com/ (text/html)...)

Alright fixed. I'll push in a little while.

Offline

#19 2010-08-14 07:34:44

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: luakit browser framework (almost with jQuery!)

mason.larobina wrote:
Chippeur wrote:

    2 others things :
    - Backspace does nothing, delete the last char would be perfect

What do you mean? In form fields or the input bar? Backspace works fine for me in the input bar & it works fine in insert mode.

I think he means in command buffering.

Last edited by aeosynth (2010-08-14 07:35:08)

Offline

#20 2010-08-14 08:00:54

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

Re: luakit browser framework (almost with jQuery!)

aeosynth wrote:
mason.larobina wrote:
Chippeur wrote:

    2 others things :
    - Backspace does nothing, delete the last char would be perfect

What do you mean? In form fields or the input bar? Backspace works fine for me in the input bar & it works fine in insert mode.

I think he means in command buffering.

In that case he should use the input bar for anything that requires backspacing. The buffer is used to match a very short string of characters which relate to a given function (be it a shortcut or whatever). In other words <Ctrl+[> or <Escape> should be the only backspace you need.

Offline

#21 2010-08-14 10:33:19

Chippeur
Member
Registered: 2010-01-25
Posts: 19

Re: luakit browser framework (almost with jQuery!)

Thanks for the answers smile
It work like a charm for me now.


Sorry in advance for my poor english...

Offline

#22 2010-08-14 15:42:19

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

Re: luakit browser framework (almost with jQuery!)

aeosynth wrote:

how do I auto-enter insert mode when focusing a text box?

Easy & done already, have a look here.

aeosynth wrote:

how can I scroll by pages?

You can't at the moment but you can get the view size from the get_scroll_vert method:

local current, max, view_size = view:get_scroll_vert()

Then its just a simple calculation to scroll by a multiple of the view_size.

aeosynth wrote:

actually, if I'm not focused on a text box and enter insert mode, then page up/down, (shift) space work normally. this probably isn't intended behavior.
when I'm editing text and exit insert mode, I expect vim's normal mode commands to work xD. someone's already ported vi to javascript actually: http://gpl.internetconnection.net/vi/

The view:eval_js(script) method works really well now, I haven't tried it with that script but I imagine you could get something similar working (obviously vi embedded inside a modal browser would cause problems) but a subset of those commands would work well. 

aeosynth wrote:

I need mouse bindings to get new tab on middle click, rocker / mouse gestures.

Mouse button bindings have been added here.

aeosynth wrote:

the rc.lua seems really big. some of these functions could be pushed out into a library.

Yes it is & yes they will be.

Offline

#23 2010-08-15 07:11:25

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: luakit browser framework (almost with jQuery!)

Is there any reasoning towards using one-key buffered commands instead of keybindings? For instance, why `bind.buf("^o$", ...)` instead of `bind.key({}, "o", ...)` to open urls?

Last edited by aeosynth (2010-08-15 07:16:34)

Offline

#24 2010-08-15 07:40:55

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

Re: luakit browser framework (almost with jQuery!)

aeosynth wrote:

Is there any reasoning towards using one-key buffered commands instead of keybindings? For instance, why `bind.buf("^o$", ...)` instead of `bind.key({}, "o", ...)` to open urls?

In this case `bind.buf("^o$", ...)` and `bind.key({}, "o", ...)` will work interchangeably. The difference is that the `bind.key({}, "o", ...)` binding will match in all modes however `bind.buf(..)` binds will only work in modes with a buffer (which is only the "normal" mode in the default rc.lua).

Edit: By all modes I mean it will work regardless of the mode table you put it in.

Last edited by mason.larobina (2010-08-15 07:44:35)

Offline

#25 2010-08-19 01:05:58

zodmaner
Member
Registered: 2007-07-11
Posts: 653

Re: luakit browser framework (almost with jQuery!)

Another nice little browser. I'm currently using it on my netbook. Keep up the good work. smile

Offline

Board footer

Powered by FluxBB