You are not logged in.

#926 2012-06-27 17:35:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: luakit browser framework (almost with jQuery!)

I couldn't find this mentioned anywhere, but I had a problem with the external editor binding on the luakit wiki.  I fixed it with the addition of one gsub line:

        f:close()
        s = s:gsub("^%s*(.-)%s*$", "%1")
        s = string.format("%q", s):sub(2, -2)
        s = s:gsub("\\\n", "\\n")
-- NEXT LINE ADDED
        s = s:gsub("'","\\'");
        w:eval_js("document.activeElement.value = '" .. s .. "'")
    end), 

I discovered this after typing an entry that suddenly vanished when I exited vim.  After some testing I traced the problem to a single-quote/apostrophe.  The added line above allows for these characters.

Mason, unless I'm missing something about this, perhaps this could be added to the function in the wiki.

Last edited by Trilby (2012-06-27 17:36:07)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#927 2012-06-29 13:40:31

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

Re: luakit browser framework (almost with jQuery!)

Thanks Trilby, I'll check it out.

Offline

#928 2012-07-05 17:32:39

Ambrevar
Member
Registered: 2011-08-14
Posts: 212
Website

Re: luakit browser framework (almost with jQuery!)

Hi,

I'm a big fan of Luakit so far.
However I stille have some issues:
* Is there any way to redirect luakit console output?  Because all the javascript warnings (a ton of them!) get printed in the terminal / tty.
* Grooveshark does not work at all (git version).

Btw, the  manpage is quiet short. Could be nice to extend it a bit, e.g. with the common shortcuts.

Aniway, thanks for the excellent job!

Offline

#929 2012-07-10 11:26:31

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

Re: luakit browser framework (almost with jQuery!)

I can't get the go_input function to work.  The go_input.lua file is present in /usr/share/luakit/lib and my ~/.config/luakit/rc.la has the line `require "go_input"', but the `gi' keystroke simply opens insert mode without focusing on an input field; if I type `:go_input' the browser tells me it's not a browser function.

Any suggestions?  I'm using luakit-git.

Thanks.

EDIT:  It seems to work on some websites, but not, for example, google search page, gmail/gmail login.  But it works on others.

Last edited by ibrunton (2012-07-10 11:34:06)

Offline

#930 2012-07-19 09:30:34

Awebb
Member
Registered: 2010-05-06
Posts: 6,272

Re: luakit browser framework (almost with jQuery!)

I discovered luakit yesterday, after Firefox+Pentadactyl (that vimperator fork) went slower and slower on my netbook. I was absolutely amazed, the interface is almost the same as in Pentadactyl, all the buttons I am used to work the same. I had a little discussion with that adblock addon I found, about whether it should work or not, but now I know enough to state that luakit is simple and straight forward. You saved my netbook!

Offline

#931 2012-07-22 19:50:25

phynix
Member
Registered: 2008-09-21
Posts: 28

Re: luakit browser framework (almost with jQuery!)

Is there an easy way to prevent luakit from closing the last tab and leaving a blank about page?

Last edited by phynix (2012-07-22 20:08:04)

Offline

#932 2012-07-27 12:25:24

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

Re: luakit browser framework (almost with jQuery!)

does anyone have any issues on Facebook? I find that after a while I need to switch between tabs for the page to work properly, for instance: when deleting messages to get the 'popup' to delete all or after choosing delete all, I need to swap pages. sometimes after a while it just stops working completely and I need to ctrl+shift+r.
also, during this the highlighted tab sometimes doesn't follow. it's all very strange.
I also need to have two tabs open for flash games on Facebook to work. one with a full page (such as a fan page) and the game page. if not, the Flash doesn't even load.

I've stopped using privoxy+squid3 at least for the moment as I got this to work:
http://ubuntuforums.org/showthread.php?t=2032904

edit: also, this site doesn't seem to work at all, it keeps complaining about requiring cookies enabled. it doesn't work regardless of whether cookieblocking is enabled or not. anyway, it's my bank so it's annoying to have to open FF just for this site:
https://easyweb.tdcanadatrust.com/

Last edited by HiImTye (2012-07-27 13:38:27)

Offline

#933 2012-07-27 20:15:22

PotatoesMaster
Member
From: France
Registered: 2010-08-26
Posts: 54

Re: luakit browser framework (almost with jQuery!)

phynix wrote:

Is there an easy way to prevent luakit from closing the last tab and leaving a blank about page?

Edit the file binds.lua  in your config directory and change the line

    key({},          "d",           function (w, m) for i=1,m.count do w:close_tab()      end end, {count=1}),

to

    key({},          "d",           function (w, m) for i=1,m.count do if w.tabs:count() > 1 then w:close_tab() end end end, {count=1}),

Offline

#934 2012-07-28 13:54:40

hellomynameisphil
Member
From: /home/phil/Vancouver
Registered: 2009-10-02
Posts: 257
Website

Re: luakit browser framework (almost with jQuery!)

I'm having trouble using hints to focus text fields. On, for example, google.ca, if I hit 'f' to show hints, then select the one for the search box, the hints go away and the browser goes into insert mode, but the cursor is not actually in the search field and I can't actually type anything into it. I have to manually click in the field to be able to type into it.

Offline

#935 2012-07-28 15:21:29

angelfalls
Member
Registered: 2012-03-26
Posts: 139

Re: luakit browser framework (almost with jQuery!)

i have a proble, when i type :history [enter] i get this output from console:

(luakit:31596): libsoup-WARNING **: (soup-uri.c:461):soup_uri_to_string: runtime check failed: (SOUP_URI_IS_VALID (uri))

(luakit:31596): libsoup-WARNING **: (soup-uri.c:461):soup_uri_to_string: runtime check failed: (SOUP_URI_IS_VALID (uri))

(luakit:31596): libsoup-WARNING **: (soup-uri.c:461):soup_uri_to_string: runtime check failed: (SOUP_URI_IS_VALID (uri))

thank in advanced!

Offline

#936 2012-07-28 16:10:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: luakit browser framework (almost with jQuery!)

@angelfalls, does the history command fail?  I get that warning too but history works fine, is there a reason to think it is a problem?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#937 2012-07-28 16:17:30

angelfalls
Member
Registered: 2012-03-26
Posts: 139

Re: luakit browser framework (almost with jQuery!)

@Trilby: history command works fine, but i get this warning.

Offline

#938 2012-07-28 16:51:00

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: luakit browser framework (almost with jQuery!)

@HilmTye
I would like to have a look on your script for AdBlock , but not everyone has an Ubuntuforums account.
Could you post it with "[code" on this forum please?

Offline

#939 2012-08-06 14:31:00

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

Re: luakit browser framework (almost with jQuery!)

EDITFixed this (I think) after reading the changelog for luakit. I've got a private mode working now, but it's persistent across sessions, and although the browser seems to be behaving, an error shows up in the output log that I have an invalid browser function table.

I'm having trouble trying to enable a command to toggle Private Browsing. It was mentioned a few pages back that I could add the following to binds.lua:

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

But all I get when I attempt to run these commands is an error:

Error: In command call: /home/robbie/.config/luakit/binds.lua:338: attempt to call method 'get_current' (a nil value)
Error: In command call: /home/robbie/.config/luakit/binds.lua:338: attempt to call method 'set_property' (a nil value)

Does this mean that there are no such methods 'get_current' and 'set_property'? How can I toggle this, even if only on a per-instance basis?

Last edited by zoqaeski (2012-08-14 11:46:35)

Offline

#940 2012-08-21 13:53:48

vid
Member
From: Zagreb
Registered: 2011-08-12
Posts: 8

Re: luakit browser framework (almost with jQuery!)

well... quakelive works;

http://i.imgur.com/TEUST.png

Moderator edit: This image is far too big. Reduced to URL. -- bernarcher
You may as well want to look at this: Screenshot Posting Rules

Last edited by bernarcher (2012-08-21 14:15:29)

Offline

#941 2012-08-22 04:03:36

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

Re: luakit browser framework (almost with jQuery!)

teateawhy wrote:

@HilmTye
I would like to have a look on your script for AdBlock , but not everyone has an Ubuntuforums account.
Could you post it with "[code" on this forum please?

my script downloads (and replaces) the adblock module from https://github.com/mason-larobina/luaki … Lua-module and also downloads (and replaces) the subscription lists in the lists file to the folder that the adblock module uses. you will need to enable them in LuaKit as the adblock module disables all lists by default.

(make sure that the 'sed' section uses a tab character and not a space)
.luakit-AdBlock.sh

#!/bin/bash

# declare variables
# ensure that our subsciptions list is delimited with tab characters, or else we will
 # need to change the 'sed' section of our script; tabs are much easier because visually
 # we can line them up for easier viewing and we can have anything before them to help us
 # look at the list itself

# change these to suit
basefolder="/storage/Launchers"
listfolder="$HOME/.local/share/luakit/adblock/"
configfolder="$HOME/.config/luakit/"

# don't change these
workingfolder="$basefolder/.LuaKit-AdBlockLists.tmp"
downloadfolder="$workingfolder/download"
subscriptionlist="$basefolder/.luakit-AdBlockList"

# make our folders and then move into it
cd $basefolder
mkdir $workingfolder
mkdir $downloadfolder
mkdir $listfolder
mkdir $configfolder
cd $downloadfolder

# update the adblock modules
git clone https://github.com/Plaque-fcc/luakit-adblock/
cp -fv luakit-adblock/*.lua $configfolder

# remove the files we no longer need
rm -fR $downloadfolder/luakit-adblock

# get our subscriptions from our list
cat $subscriptionlist | sed 's|.*\	*\(http.*\)|\1|' | wget -i -

# copy files to luakit's folder
cp -fv $downloadfolder/* $listfolder

# check if we have an rc.lua and if not, create one
if [ ! -f $configfolder/rc.lua ]; then
 cp /etc/xdg/luakit/rc.lua $configfolder
fi

# check to see if adblock is enabled in rc.lua and if not, enable it
if ! grep 'require "adblock"' "$configfolder/rc.lua" ; then
 cat $configfolder/rc.lua | sed 's|\(require "bookmarks"\)|\1\n\n-- Add AdBlock support\nrequire "adblock"\nrequire "adblock_chrome"\n\n|' > $configfolder/rc.lua~
 mv -f $configfolder/rc.lua~ $configfolder/rc.lua
fi

# delete our working files
cd $basefolder
rm -R $workingfolder

# warn our user
echo "******** Important: ********"
echo you will need to enable any lists that have not been enabled by typing
echo "':able #'"
echo where "'#'" is the listID. to find the listID, go to the chrome page by typing
echo "':adblock'" or by hitting "'ga'" or "'gA'"
echo I also recommend restarting LuaKit by hitting "'ctrl+shift+r'"
echo "******** ---------- ********"

# exit
exit

and here's my subscription list (note that it's tab delimited):
.luakit-AdBlockList

EasyList		https://easylist-downloads.adblockplus.org/easylist.txt
EasyPrivacy		https://easylist-downloads.adblockplus.org/easyprivacy.txt
EasyList Germany	https://easylist-downloads.adblockplus.org/easylistgermany.txt
EasyList Italy		https://easylist-downloads.adblockplus.org/easylistitaly.txt
DutchAdBlockList	https://dutchadblockfilters.googlecode.com/svn/trunk/AdBlock_Dutch_hide.txt
Liste FR (French)	http://lian.info.tm/liste_fr.txt
ChinaList		https://adblock-chinalist.googlecode.com/svn/trunk/adblock.txt
Bulgarian List		http://stanev.org/abp/adblock_bg.txt
AB Pindo (Indonesian)	https://indonesianadblockrules.googlecode.com/hg/subscriptions/abpindo.txt

Offline

#942 2012-08-22 08:26:15

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

Re: luakit browser framework (almost with jQuery!)

Where did “follow.ignore_delay” go? It appears, it was removed with commit ebb20a8 — and then? Has it been re-added again or is it just gone?

Thanks. smile

Offline

#943 2012-08-27 12:41:04

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

Re: luakit browser framework (almost with jQuery!)

Vain wrote:

Where did “follow.ignore_delay” go? It appears, it was removed with commit ebb20a8 — and then? Has it been re-added again or is it just gone?

Thanks. smile

Whoops, I knew something fell through. I'll put it on the list to re-add when I get a moment.

In other news I've just wasted some time working on a HTML UI for luakit.

E8iZD.png

Don't worry the current tablist isn't in danger (yet) but this was a nice experiment. It is a lot easier to deal with than GtkLabels and GTK widget management. I love the idea the user can drop in and out different stylesheets to completely change the look (and favicons!).

And it makes modding luakit a lot easier for people coming from web-dev backgrounds (which was me long ago).

The work is in the html-ui branch and I'd love feedback.

Offline

#944 2012-08-27 12:58:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: luakit browser framework (almost with jQuery!)

Mason, those tabs look cool.  I'd like to put forward one request and offer one suggestion about them.

Request: if/when luakit changes to those tabs, please try to keep them as slim (read: vertical space) as the current tab bar.  I'm all for a little eye candy, particularly if it is easier to code - but I wouldn't want to sacrifice screen space for it.

Suggestion: I've never liked the toolkits available (eg gtk).  But Xlib has a lot of it's own simple and powerful tools.  I know next to nothing about lua or it's Xlib bindings, but if you're creating a window, it would only take two additional calls (XDrawRectangle, and XDrawText) to creat a tabbar much like the current one without any toolkit dependency.

Last edited by Trilby (2012-08-27 12:58:47)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#945 2012-08-27 14:27:04

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

Re: luakit browser framework (almost with jQuery!)

Trilby wrote:

Mason, those tabs look cool.  I'd like to put forward one request and offer one suggestion about them.

Request: if/when luakit changes to those tabs, please try to keep them as slim (read: vertical space) as the current tab bar.  I'm all for a little eye candy, particularly if it is easier to code - but I wouldn't want to sacrifice screen space for it.

Suggestion: I've never liked the toolkits available (eg gtk).  But Xlib has a lot of it's own simple and powerful tools.  I know next to nothing about lua or it's Xlib bindings, but if you're creating a window, it would only take two additional calls (XDrawRectangle, and XDrawText) to creat a tabbar much like the current one without any toolkit dependency.

The simple answer is we have zero Xlib bindings, and we would have to write them to work with the current API. And we wouldn't be able to shed our GTK toolkit because we use webkit-gtk so I wouldn't want to add yet another way to do things (at least not to the mainline).

A html ui on the other hand only needs a single WebKitWebView of which we already have bindings for.

As for keeping the same style, I've come up with this after a few minutes playing around ( http://i.imgur.com/24HPb.png ). Almost identical (swapping tab numbers for favicons). Edit: And that's 100% CSS.

I would have to be satisfied the code is solid before ever thinking about replacing the current tablist but it opens quite a few more doors without having to endlessly create more Gtk bindings.

Last edited by mason.larobina (2012-08-27 14:47:33)

Offline

#946 2012-08-27 15:07:11

avx
Member
Registered: 2011-07-05
Posts: 71

Re: luakit browser framework (almost with jQuery!)

So all these tabs are plain CSS rendered by the webview? If that's the case, what about styling the other elements, input-bar, menus, ...? Is that also possible and on the agenda? Would it be possible to raise events, f.e. by pressing a shortcut, which then calls CSS effects, so things like animated hide/show, opacity changes, etc?

How does it perform? I mean, AFAIK Firefox's UI is also XUL/CSS and is often times pretty sluggish.

Offline

#947 2012-08-27 15:23:49

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

Re: luakit browser framework (almost with jQuery!)

avx wrote:

So all these tabs are plain CSS rendered by the webview? If that's the case, what about styling the other elements, input-bar, menus, ...? Is that also possible and on the agenda? Would it be possible to raise events, f.e. by pressing a shortcut, which then calls CSS effects, so things like animated hide/show, opacity changes, etc?

How does it perform? I mean, AFAIK Firefox's UI is also XUL/CSS and is often times pretty sluggish.

Yeah mostly CSS and a little javascript to push and pop tabs from the tablist div.

As for moving the statusbar and menu to CSS that's also something I'd like to experiment with. It's totally possible (nothing more than I'm already doing for the tabs).

As for sluggishness I don't notice it much on my system, of course I can open 10 tabs at once and drag the system to a hault for a few seconds and that causes it to jump around a bit but I think the current performance is tolerable (there's still a lot that can be done optimizing the javascript mind you).

And on low performance computers `jQuery.fx.off = true` will disable all animations which removes any sluggishness entirely.

Offline

#948 2012-08-27 15:25:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: luakit browser framework (almost with jQuery!)

Sweet, that new image looks great.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#949 2012-08-27 16:01:35

avx
Member
Registered: 2011-07-05
Posts: 71

Re: luakit browser framework (almost with jQuery!)

Looks pretty decent, fewer sloc than I'd expected. If most people are like me, they'd like to use the same colours for the chrome as for the general theme, so maybe some simple generator function would be nice, to which I can pass the theme.fg, etc.

Edit, opened 10 rather heavy sites in parallel from the cmdline, switching tabs while they were loading without problems, pretty nice.

Last edited by avx (2012-08-27 16:06:46)

Offline

#950 2012-09-08 07:47:37

hellomynameisphil
Member
From: /home/phil/Vancouver
Registered: 2009-10-02
Posts: 257
Website

Re: luakit browser framework (almost with jQuery!)

hellomynameisphil wrote:

I'm having trouble using hints to focus text fields. On, for example, google.ca, if I hit 'f' to show hints, then select the one for the search box, the hints go away and the browser goes into insert mode, but the cursor is not actually in the search field and I can't actually type anything into it. I have to manually click in the field to be able to type into it.

So anyone have an answer to this? Someone else posted about go_input, which works on Google or anywhere else there is only one input field I want. But if there are multiple input fields on a page and I want, say, the third one, go_input doesn't seem to help me, and I still have the above issue with f-activated hints.

Offline

Board footer

Powered by FluxBB