You are not logged in.

#376 2011-05-22 19:04:40

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

Re: luakit browser framework (almost with jQuery!)

mason.larobina wrote:

Hello,

Does your editor have syntax highlighting? (because you've forgotten to remove the full "--[[" and "]]" which are comment start and end markers in Lua, I should comment this differently as I've seen a few people do this now). This means your domain props table is one big string (becase [[ and ]] are string start and end markers in Lua). Thus your dark.css will not work.

Hellow Mason,

I use vim in a quite unchanged fashion. So for me, lua files do look highlighted, but the block quoted above is all white. If I remove [[ and ]], the ›true‹s suddenly are written in pink, which I didn’t know it has to, but oviously shows that the syntax highlightning works…

If I don’t want to set `w:get_current():set_property("enable-private-browsing", true)` in a command or bind to a key but for ever and ever, how do I do that? Simply putting it (w:get_current():set_property("enable-private-browsing", true)) into userconf.lua doesn’t do the trick, but I did not expect that neither…

Best,

Jakob

Offline

#377 2011-05-23 00:26:33

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

Re: luakit browser framework (almost with jQuery!)

jakob wrote:
mason.larobina wrote:

Hello,

Does your editor have syntax highlighting? (because you've forgotten to remove the full "--[[" and "]]" which are comment start and end markers in Lua, I should comment this differently as I've seen a few people do this now). This means your domain props table is one big string (becase [[ and ]] are string start and end markers in Lua). Thus your dark.css will not work.

Hellow Mason,

I use vim in a quite unchanged fashion. So for me, lua files do look highlighted, but the block quoted above is all white. If I remove [[ and ]], the ›true‹s suddenly are written in pink, which I didn’t know it has to, but oviously shows that the syntax highlightning works…

If I don’t want to set `w:get_current():set_property("enable-private-browsing", true)` in a command or bind to a key but for ever and ever, how do I do that? Simply putting it (w:get_current():set_property("enable-private-browsing", true)) into userconf.lua doesn’t do the trick, but I did not expect that neither…

Best,

Jakob

Do this:

webview.init_funcs.always_private = function (view, w) 
    view:set_property("enable-private-browsing", true)
end

Offline

#378 2011-05-23 18:29:25

r6
Member
From: Melbourne
Registered: 2008-07-02
Posts: 156

Re: luakit browser framework (almost with jQuery!)

I can't search imdb with the search function. It wants the query to look like eternal+sunshine, not eternal%20sunshine. Is this possible? (Sorry if this has already been answered)

Offline

#379 2011-05-25 12:16:20

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

Re: luakit browser framework (almost with jQuery!)

What I would find very convenient would be a (optional) warning when trying to bind a new quickmark on a key wich already consists of another quickmark. I make extensive use of those very cool quickmarks, but it becomes hard to remember every previously assigned key when adding a new quickmark. Additionaly, I too miss the feature of opening links from other program in a running luakit instance, especially because the dbus-fork seems not to be updated anymore.

Just wanted to post this things to give a little feedback. Luakit has completely replaced all other browsers on my system, and I really enjoy it.

Offline

#380 2011-05-28 08:18:38

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

Re: luakit browser framework (almost with jQuery!)

bratmaxe wrote:

What I would find very convenient would be a (optional) warning when trying to bind a new quickmark on a key wich already consists of another quickmark. I make extensive use of those very cool quickmarks, but it becomes hard to remember every previously assigned key when adding a new quickmark. Additionaly, I too miss the feature of opening links from other program in a running luakit instance, especially because the dbus-fork seems not to be updated anymore.

Just wanted to post this things to give a little feedback. Luakit has completely replaced all other browsers on my system, and I really enjoy it.

You could do:

diff --git a/lib/quickmarks.lua b/lib/quickmarks.lua
index c757720..77949b6 100644
--- a/lib/quickmarks.lua
+++ b/lib/quickmarks.lua
@@ -143,8 +143,14 @@ add_binds("normal", {
     buf("^M%w$", function (w, b)
         local token = string.match(b, "^M(.)$")
         local uri = w:get_current().uri
-        set(token, {uri})
-        w:notify(string.format("Quickmarked %q: %s", token, uri))
+        local old = get(token)
+        if old then
+            local uris = table.concat(old, ", ") .. ", " .. uri
+            w:enter_cmd(string.format(":qmark %s %s", token, uris))
+        else
+            set(token, {uri})
+            w:notify(string.format("Quickmarked %q: %s", token, uri))
+        end
     end),
 })

If the quickmark already exists it will construct an edit command with your new url appended to the end (I.e. `:qmark a old.com, http://new.com/`) then you can choose which to keep (or both) or press Escape to leave it how it was and choose a different letter.

But if you don't want to edit lib/quickmarks.lua add this to your rc.lua anywhere after the `require "quickmarks"` line.

local buf = lousy.bind.buf
add_binds("normal", {
    -- Quickmark current uri (`M{a-zA-Z0-9}`)
    buf("^M%w$", function (w, b)
        local token = string.match(b, "^M(.)$")
        local uri = w:get_current().uri
        local old = quickmarks.get(token)
        if old then
            local uris = table.concat(old, ", ") .. ", " .. uri 
            w:enter_cmd(string.format(":qmark %s %s", token, uris))
        else
            quickmarks.set(token, {uri})
            w:notify(string.format("Quickmarked %q: %s", token, uri))
        end 
    end),
}, true)

Offline

#381 2011-05-28 10:39:22

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

Re: luakit browser framework (almost with jQuery!)

Wow, that works, great! Thank you VERY much! smile

Offline

#382 2011-05-29 11:05:12

Josko
Member
Registered: 2011-02-24
Posts: 9

Re: luakit browser framework (almost with jQuery!)

Hello,

I've been using your great browser for a few weeks but then, a month or so ago when libwekit 1.4.0 went out or something, luakit has been crashing (segmentation fault) on startup. Using 2.6.39 kernel, x86_64 and luakit-git from AUR.

Huge log using luakit -v: http://pastebin.com/qECG8SST

Am I missing something?

Offline

#383 2011-05-29 11:05:53

Josko
Member
Registered: 2011-02-24
Posts: 9

Re: luakit browser framework (almost with jQuery!)

Sorry for double post.

Last edited by Josko (2011-05-29 11:06:13)

Offline

#384 2011-05-29 12:31:20

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

Re: luakit browser framework (almost with jQuery!)

Josko wrote:

Sorry for double post.

I've heard a few stories of segfaults using 1.4 and upgrading to luakit-develop-git seems to fix it.

Let me know if there is still a problem (and pastebin a backtrace from the segfault core dump, I'll walk you though it if you haven't done that before).

Offline

#385 2011-05-29 12:53:38

Josko
Member
Registered: 2011-02-24
Posts: 9

Re: luakit browser framework (almost with jQuery!)

It didn't help unfortunately and I don't know how to get a backtrace but I used gdb to try and find the culprit:

http://pastebin.com/2Rhepf3d

Hope that helps but if it doesn't I'll gladly make a backtrace.

Offline

#386 2011-05-29 12:58:33

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

Re: luakit browser framework (almost with jQuery!)

Josko wrote:

It didn't help unfortunately and I don't know how to get a backtrace but I used gdb to try and find the culprit:

http://pastebin.com/2Rhepf3d

Hope that helps but if it doesn't I'll gladly make a backtrace.

Seems like a legit libwebkit/libsoup/gtk error. Even though you have no debugging symbols on your system none of the backtrace items reference a luakit function.

I'm not having this problem with the libwebkit 1.4.0-1 version in [extra].

Last edited by mason.larobina (2011-05-29 12:58:59)

Offline

#387 2011-05-29 13:09:47

Josko
Member
Registered: 2011-02-24
Posts: 9

Re: luakit browser framework (almost with jQuery!)

libwebkit 1.4.0-1 libsoup 2.34.2-1

Luakit just suddenly stopped working like this while it still works on my desktop PC... What do you suggest? sad

Offline

#388 2011-05-30 19:13:14

vanvalium
Member
From: Austria
Registered: 2010-10-09
Posts: 86

Re: luakit browser framework (almost with jQuery!)

Has anyone made emacs(or conkeror)-like keybindings for luakit? I'm too lazy to do it myself but would really enjoy it.

Offline

#389 2011-06-01 01:40:19

ebirtaid
Member
From: USA
Registered: 2007-11-18
Posts: 52

Re: luakit browser framework (almost with jQuery!)

Noticed an issue when trying to follow a link in a new window, it doesn't work and outputs

W: luakit: luaH_dofunction:104: error while running function
stack traceback:
        /usr/share/luakit/lib/follow.lua:651: in function 'func'
        /usr/share/luakit/lib/follow.lua:819: in function 'fun'
        /usr/share/luakit/lib/follow.lua:784: in function </usr/share/luakit/lib/follow.lua:782>
error: /usr/share/luakit/lib/follow.lua:651: attempt to index global 'window' (a nil value)

The relevant part of follow.lua is

649     buf("^;w$", function (w,b,m)
650         w:start_follow("uri", "open window", function (uri)
651             window.new{uri}
652             return "root-active"
653         end)
654     end),

FWIW the window.new{uri} part is different from all other calls I can see in regards to following (ie w:new_tab(uri) and the like).

Offline

#390 2011-06-01 18:54:08

v1d
Member
Registered: 2010-10-13
Posts: 6

Re: luakit browser framework (almost with jQuery!)

Just add to the beginning local window = window

...
local theme = theme
local window = window
local capi = { luakit = luakit, timer = timer }
...

Offline

#391 2011-06-10 03:22:22

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: luakit browser framework (almost with jQuery!)

It's been a while and I haven't had any problems since my last post (smooth surfin'!) but I just wanted to stop by and thank you for all of the great work, regardless.  I finally did my compile for libwebkit 1.4.1 (++ icu, luajit2-git, glib-networking-git, etc) and updated luakit-develop and I have to say I'm really enjoying the tab completion for History that was merged some days ago.  Don't imagine bookmarks will be included later on in completion since they're not in sqlite and without titles, etc, but I don't know if I'd want it anyway.  I do think a way to sort or filter bookmarks would be handy (as mentioned before); any thoughts, concerns, definitive ya or nays about this?

As a side note, I also want to throw in my 2 cents about not merging cookie-filtering into develop since it seems like such a niche feature, also since I use Privoxy as a global solution for such behavior.  Just thought I'd mention that since I haven't seen much discussion about it here.  Seems like it should be a proxy's job.  Though I guess it wouldn't matter if the user didn't have the *list files in location anyway or if it were a module to be commented out, heh..  I haven't tinkered with it too much, just thinking out loud.

Anyway, thanks again for everything, most wholeheartedly.

Offline

#392 2011-06-10 03:59:23

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

Re: luakit browser framework (almost with jQuery!)

milomouse wrote:

It's been a while and I haven't had any problems since my last post (smooth surfin'!) but I just wanted to stop by and thank you for all of the great work, regardless.  I finally did my compile for libwebkit 1.4.1 (++ icu, luajit2-git, glib-networking-git, etc) and updated luakit-develop and I have to say I'm really enjoying the tab completion for History that was merged some days ago.  Don't imagine bookmarks will be included later on in completion since they're not in sqlite and without titles, etc, but I don't know if I'd want it anyway.  I do think a way to sort or filter bookmarks would be handy (as mentioned before); any thoughts, concerns, definitive ya or nays about this?

Great to hear smile anyway regarding bookmark completion I'd love to add it but not while the bookmarks lib is in it's current state (it hasn't been updated to use sqlite yet).

milomouse wrote:

As a side note, I also want to throw in my 2 cents about not merging cookie-filtering into develop since it seems like such a niche feature, also since I use Privoxy as a global solution for such behavior.  Just thought I'd mention that since I haven't seen much discussion about it here.  Seems like it should be a proxy's job.  Though I guess it wouldn't matter if the user didn't have the *list files in location anyway or if it were a module to be commented out, heh..  I haven't tinkered with it too much, just thinking out loud.

I was thinking of merging in a cut down version of the cookie filtering lib which only matches against domain names and only be activated when the user has the cookie.*list files.

As a side note I've pushed a new branch a few days ago which provides wrappers for libunique (for easily writing single instance applications). Interested in trying it out? the branch is here. The rc.lua has been updated and it should work out of the box (not sure everybody would like this out of the box though).

Offline

#393 2011-06-10 04:44:47

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: luakit browser framework (almost with jQuery!)

mason.larobina wrote:

As a side note I've pushed a new branch a few days ago which provides wrappers for libunique (for easily writing single instance applications). Interested in trying it out? the branch is here. The rc.lua has been updated and it should work out of the box (not sure everybody would like this out of the box though).

Seems to work as intended, which is great.  This will certainly help in mailcaps, terminal links, emails, (and new-window links(?)), etc.  And for anyone else; I also see that it depends on dbus (not really a problem just a heads up since I didn't have it installed beforehand).  Out-of-the-box rc.lua snippets look good to me but perhaps there should be a command-line option for opening a link in a new instance/window, or is there already a way to do this (albeit a different way perhaps)?  I don't know much about libunique or dbus except for the basic concepts.  Anyway, looks like this is in the right direction for what most people were asking for earlier on in the topic as far as opening in new tab in running instance (including me, I believe).  So, good deal! smile

Offline

#394 2011-06-10 05:46:37

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

Re: luakit browser framework (almost with jQuery!)

milomouse wrote:
mason.larobina wrote:

As a side note I've pushed a new branch a few days ago which provides wrappers for libunique (for easily writing single instance applications). Interested in trying it out? the branch is here. The rc.lua has been updated and it should work out of the box (not sure everybody would like this out of the box though).

Seems to work as intended, which is great.  This will certainly help in mailcaps, terminal links, emails, (and new-window links(?)), etc.  And for anyone else; I also see that it depends on dbus (not really a problem just a heads up since I didn't have it installed beforehand).  Out-of-the-box rc.lua snippets look good to me but perhaps there should be a command-line option for opening a link in a new instance/window, or is there already a way to do this (albeit a different way perhaps)?  I don't know much about libunique or dbus except for the basic concepts.  Anyway, looks like this is in the right direction for what most people were asking for earlier on in the topic as far as opening in new tab in running instance (including me, I believe).  So, good deal! smile

You can open a new window (in the original instace) by calling luakit without any uri's to open (though we could do with a cli option also).

Last edited by mason.larobina (2011-06-10 05:46:59)

Offline

#395 2011-06-12 08:13:55

essence-of-foo
Member
Registered: 2008-07-12
Posts: 84

Re: luakit browser framework (almost with jQuery!)

There's a small but useful Lua snippet that I like to share with you:

-- binds.lua
    key({},          "x",           function (w)
                                        --strip last character because some URIs end with /
                                        local uri = w:get_current().uri:sub( 1, - 2 )
                                        local new_uri = uri:gsub(
                                            "/[^/]+$", "" )
                                        w:navigate( new_uri )
                                    end ),

    key({},          "X",           function (w) --added
                                        local uri = w:get_current().uri
                                        local new_uri = uri:gsub(
                                            "%w+%.", "", 1 )
                                        w:navigate( new_uri )
                                    end ),

This adds the following key bindings:
x   remove the last component of the URIs path ( http://example.org/foo/bar becomes http://example.org/foo )
X   remove the first subdomain of a URI ( http://sub1.sub2.example.org becomes http://sub2.example.org )

edit: Dammit, just learned about the gu command. This makes little x redundant big_smile
There's also gU which removes everything after the domain name.

The funny thing is these gu and gU commands don't seem to be defined in binds.lua (neither in ~/.config nor in /etc/xdg/luakit). Or am I blind?

Last edited by essence-of-foo (2011-06-12 22:14:21)

Offline

#396 2011-06-12 11:51:16

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

Re: luakit browser framework (almost with jQuery!)

Has anyone tried the cookie-filtering branch? I tried it again yesterday, but it doesn't seem to work here, no matter what I write into the white- or blacklist file, nothing's changing. Or is it known to be broken, Mason? Possible that I'm too dumb, sure ... But I don't find a way to make it work.

I'm still switching between firefox+pentadactyl and luakit, right now ff+pentadactyl is better for me, especially because of privacy features provided by addons.

Because of that, another question to all luakit users:
What do you do to keep your privacy online? The only tool I know for that is privoxy, but is that enough? In Firefox I use Noscript and RequestPolicy, which combined are great, but require a little clicking for some sites.

Offline

#397 2011-06-12 14:25:18

essence-of-foo
Member
Registered: 2008-07-12
Posts: 84

Re: luakit browser framework (almost with jQuery!)

Army wrote:

Because of that, another question to all luakit users:
What do you do to keep your privacy online? The only tool I know for that is privoxy, but is that enough? In Firefox I use Noscript and RequestPolicy, which combined are great, but require a little clicking for some sites.

I use privoxy as well.

Regarding cookie handling: The last time I checked, privoxy didn't seem to obey the cookie configuration. Therefore I symlinked the cookie database to /tmp so that it is deleted at each reboot.

To my knowlegde Privoxy filters out some nasty HTML and JS codes but it's certainly not perfect. Something like NoScript for luakit would be pretty cool.

Last edited by essence-of-foo (2011-06-12 14:29:15)

Offline

#398 2011-06-12 14:50:15

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

Re: luakit browser framework (almost with jQuery!)

I'm no security expert, but in my opinion noscript ist not needed on a linux system as 99,9% of the exploits/malware/etc only affect windows users. RequestPolicy is a nice addon, but with privoxy (I use it too) i can get nearly the same behaviour with a lot more comfort, because it uses blacklisting instead of whitelisting. For me this is enough, but i also set luakit to forbid thirdparty cookies and default to duckduckgo.

Offline

#399 2011-06-12 15:40:41

essence-of-foo
Member
Registered: 2008-07-12
Posts: 84

Re: luakit browser framework (almost with jQuery!)

While NoScript provides increased security (most attacks will try to exploits bugs in the JavaScript engine and not HTML or CSS) my primary concern is privacy. Privoxy does a good job but in the end Privoxy can be too tolerant. So disabling JS as default for each domain is not such a bad idea.

And I just checked the configs again. In globals.lua you can change the domain_props table to disallow JS for all pages and enable it for some specific pages. So this feature already exists smile

edit: I just realized that the documentation http://webkitgtk.org/reference/webkitgt … tings.html is a dead link. So this probably doesn't work reliably sad

Last edited by essence-of-foo (2011-06-12 15:44:27)

Offline

#400 2011-06-12 15:59:47

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

Re: luakit browser framework (almost with jQuery!)

essence-of-foo wrote:

edit: I just realized that the documentation http://webkitgtk.org/reference/webkitgt … tings.html is a dead link. So this probably doesn't work reliably sad

It just isn't documented anymore but it still works. The possible websettings can be found in the source code, some are also commented in the source.

Offline

Board footer

Powered by FluxBB