You are not logged in.
Anyone knows how to clear my history?
Offline
Anyone knows how to clear my history?
Just delete history.db in ~/.local/share/luakit/ You can also delete your cookies in there as well.
Offline
This doesn't happen if one changes the populate_popup function to
...
Thanks, that worked.
My fonts look different after the webkit upgrade. Some look better while others look ugly as hell, but maybe I'll get used to it.
Edit: Fixed the fonts. If anyone else has ugly fonts, try this in a global css file:
* {
text-rendering: optimizeLegibility;
}
Edit 2: Flashplugin isn't being recognised anywhere except youtube with the new webkit. Tells me to upgrade my flash player.
Edit 3: Fixed the flashplugin problem. All good now.
Last edited by r6 (2011-05-06 02:02:10)
Offline
Is there a way for luakit to always read the last saved session when it opens? It only seems to do that when I do :wq or :x. However if I do :w and then later :q (or if it crashes), I lose everything.
Also, does flashplugin crash not seg fault luakit anymore?
Lastly, I'm still having trouble with the follows script (contains leading zeroes, numbers don't update as I type part of the url). In my ~/.config/luakit/follow.lua, I set sort_labels to false.
Offline
Since the lastest changes in follow.lua, the alternative characters hack didn't work anymore, so I tried something.
It works fast enough but it really seems over complicated.
You just have to replace the make_label function in follow.lua with all this:
-- From 3 to 9 characters
charset = "uietsrn"
-- Converts an int to a label, where each digit corresponds to an index of the
-- charset.
function to_label(n)
local label = ''
repeat
local i = n % 10
label = string.sub(charset, i, i) .. label
n = n / 10
until n == 0
if reverse_labels then
string.reverse(label)
end
return label
end
-- Lists recursively all ints needed, translates them into the corresponding labels and
-- insert them in the table.
function list_labels(start, max, digits, labels)
if digits == 1 then
if max-start < #charset then
top = max
else
top = start + #charset - 1
end
for i = start, top do
table.insert(labels, to_label(i))
end
else
local n = digits
local ceiling = 0 - 10 ^ (n - 1)
while n > 0 do
ceiling = ceiling + #charset * 10 ^ (n - 1)
n = n - 1
end
for i = 0, max, 10 ^ (digits - 1) do
if(i > ceiling or (start+i) > max) then
break
end
list_labels(start+i, max, digits - 1, labels)
end
end
end
function make_labels(size)
-- Find a sufficient label length / int digits
local digits = 1
local pow = #charset
while true do
if pow >= size then
break
else
pow = pow * (#charset)
digits = digits + 1
end
end
-- Find the first int given the number of digits (something like 11 or 111)
local start = 0
for i = 1, digits do
start = start + 10 ^ (i - 1)
end
-- Find the last int given the size and the charset length ...
local r = size
local q = 1
local d = 1
local max = start
pow = pow / #charset
while true do
if d == digits then
max = max + r - 1
break
end
q = math.floor(r / pow)
r = r % pow
if q ~= 0 then
max = max + q * 10 ^ (digits - d)
d = d + 1
else
pow = pow / #charset
end
end
local labels = {}
-- Fill the table
list_labels(start, max, digits, labels)
if sort_labels then
table.sort(labels)
end
return labels
end
You also have to changed the Input bar changed hook, because it sees characters as part of a filter to complete the hint id and not as the hint itself:
Replace this line:
local filter, id = parse_input(text)
with this line:
local id = parse_input(text)
and this one
local ret = w:eval_js(string.format("follow.filter(%q, %q);", filter, id), "(follow.lua)", f)
with:
local ret = w:eval_js(string.format("follow.filter('', %q);", id), "(follow.lua)", f)
It disables the filter stuff, I didn't look much further into that since I don't use it.
Should I put this in the wiki since the wiki's hack is outdated?
Offline
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.
Ok, simple solution time. I've commented out the populate_popup function in webview.lua to get luakit working again for arch-people.
Offline
portix wrote: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.
Ok, simple solution time. I've commented out the populate_popup function in webview.lua to get luakit working again for arch-people.
I have created a patch that fixes this issue. The problem was that the menu items created by luakit couldn't be destroyed because they weren't realized anymore. So this patch destroys the widgets when the popup is hidden.
diff -ur luakit-build/widgets//webview.c luakit/widgets//webview.c
--- luakit-build/widgets//webview.c 2011-05-08 17:29:36.000000000 +0200
+++ luakit/widgets//webview.c 2011-05-08 17:43:06.000000000 +0200
@@ -1169,6 +1169,29 @@
luaH_dofunction(L, 1, 0);
}
+static void
+hide_popup_cb() {
+ GSList *iter;
+ lua_State *L = globalconf.L;
+
+ /* dereference context menu items callback functions from the last
+ context menu */
+ if (last_popup.refs) {
+ for (iter = last_popup.refs; iter; iter = iter->next)
+ luaH_object_unref(L, iter->data);
+ g_slist_free(last_popup.refs);
+ last_popup.refs = NULL;
+ }
+
+ /* destroy context menu item widgets from the last context menu */
+ if (last_popup.items) {
+ for (iter = last_popup.items; iter; iter = iter->next)
+ gtk_widget_destroy(iter->data);
+ g_slist_free(last_popup.items);
+ last_popup.items = NULL;
+ }
+}
+
static void
populate_popup_from_table(lua_State *L, GtkMenu *menu, widget_t *w)
{
@@ -1229,25 +1252,9 @@
gint top;
gint ret;
- GSList *iter;
lua_State *L = globalconf.L;
- /* dereference context menu items callback functions from the last
- context menu */
- if (last_popup.refs) {
- for (iter = last_popup.refs; iter; iter = iter->next)
- luaH_object_unref(L, iter->data);
- g_slist_free(last_popup.refs);
- last_popup.refs = NULL;
- }
-
- /* destroy context menu item widgets from the last context menu */
- if (last_popup.items) {
- for (iter = last_popup.items; iter; iter = iter->next)
- gtk_widget_destroy(iter->data);
- g_slist_free(last_popup.items);
- last_popup.items = NULL;
- }
+ g_signal_connect(menu, "hide", G_CALLBACK(hide_popup_cb), NULL);
luaH_object_push(L, w->ref);
top = lua_gettop(L);
Edit: Changed the patch, "hide" is connected in populate_popup_cb.
Edit2: The menu should be connected to "unrealize" rather than "hide", since connecting to hide makes the items disfunctional.
Last edited by portix (2011-05-08 16:45:59)
Offline
mason.larobina wrote:portix wrote: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.
Ok, simple solution time. I've commented out the populate_popup function in webview.lua to get luakit working again for arch-people.
I have created a patch that fixes this issue. The problem was that the menu items created by luakit couldn't be destroyed because they weren't realized anymore. So this patch destroys the widgets when the popup is hidden.
diff -ur luakit-build/widgets//webview.c luakit/widgets//webview.c --- luakit-build/widgets//webview.c 2011-05-08 17:29:36.000000000 +0200 +++ luakit/widgets//webview.c 2011-05-08 17:43:06.000000000 +0200 @@ -1169,6 +1169,29 @@ luaH_dofunction(L, 1, 0); } +static void +hide_popup_cb() { + GSList *iter; + lua_State *L = globalconf.L; + + /* dereference context menu items callback functions from the last + context menu */ + if (last_popup.refs) { + for (iter = last_popup.refs; iter; iter = iter->next) + luaH_object_unref(L, iter->data); + g_slist_free(last_popup.refs); + last_popup.refs = NULL; + } + + /* destroy context menu item widgets from the last context menu */ + if (last_popup.items) { + for (iter = last_popup.items; iter; iter = iter->next) + gtk_widget_destroy(iter->data); + g_slist_free(last_popup.items); + last_popup.items = NULL; + } +} + static void populate_popup_from_table(lua_State *L, GtkMenu *menu, widget_t *w) { @@ -1229,25 +1252,9 @@ gint top; gint ret; - GSList *iter; lua_State *L = globalconf.L; - /* dereference context menu items callback functions from the last - context menu */ - if (last_popup.refs) { - for (iter = last_popup.refs; iter; iter = iter->next) - luaH_object_unref(L, iter->data); - g_slist_free(last_popup.refs); - last_popup.refs = NULL; - } - - /* destroy context menu item widgets from the last context menu */ - if (last_popup.items) { - for (iter = last_popup.items; iter; iter = iter->next) - gtk_widget_destroy(iter->data); - g_slist_free(last_popup.items); - last_popup.items = NULL; - } + g_signal_connect(menu, "hide", G_CALLBACK(hide_popup_cb), NULL); luaH_object_push(L, w->ref); top = lua_gettop(L);
Edit: Changed the patch, "hide" is connected in populate_popup_cb.
Thanks for the fix portix, applied & pushed to develop. [1]
Offline
Lastly, I'm still having trouble with the follows script (contains leading zeroes, numbers don't update as I type part of the url). In my ~/.config/luakit/follow.lua, I set sort_labels to false.
See my follow-styles branch (http://github.com/karottenreibe/luakit/ … low-styles). That should solve the leading-zeroes issue.
I don't know what you mean by "numbers don't update as I type part of the url".
There is no matching against URLs, only against the text of the matched elements. Also the hint labels are not supposed to update when you type something for two reasons:
a) That's confusing (people who type more quickly might accidentally hit the wrong number)
b) It's not possible to implement this without substantial changes to the codebase
Since the lastest changes in follow.lua, the alternative characters hack didn't work anymore, so I tried something.
Also see my follow-styles branch. It now features a follow style called `charset' that lets you have that functionality. To use it, insert this somewhere after requiring `follow.lua':
follow.style = follow.styles.charset("uietsrn")
Offline
Luakit now moved into Community packages. Thanks TD123
PLEASE read and try to FIX/FILE BUGS instead of assuming other have/will.
Offline
Hello, I am using luakit from community. Some releases ago I could block all cookies except from select sites by using the domain_props table. How can I do this with the soup setup? I have currently soup.set_property("accept-policy", cookie_policy.never) and legacy cookie stuff in domain_props. Thanks.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Hello, I am using luakit from community. Some releases ago I could block all cookies except from select sites by using the domain_props table. How can I do this with the soup setup? I have currently soup.set_property("accept-policy", cookie_policy.never) and legacy cookie stuff in domain_props. Thanks.
I do believe this was a side-effect of not having a working cookies system (we do now). The soup "accept-policy" is a global setting so there is no way to reliably control it on a per-domain basis. I did have a proof-of-concept cookie blocking branch which seems to work ok.
If you change the git branch name in the luakit-develop-git PKGBUILD to "cookie-filtering" you can try it out quite easily. Check out this commit for more information.
However I'm still hesitant about merging this in to develop. I don't think the large portion of luakit users need cookie filtering by cookie name and or path. It might be best to leave this on the wiki and merge in a simple domain blocker.
Offline
I've been using luakit lately over uzbl and it is nice, but I was wondering if there was a way to emulate one fetaure I miss. In uzbl I had a keybind that would enable java/plugins per page, is there a way to do the same in luakit? I know that you can whitelist domains in globals.lua; but it would be nice to have something along the lines of :set enable-scripts or similar. If this is already a feature and I am just missing it then I apolgise.
Offline
I've been using luakit lately over uzbl and it is nice, but I was wondering if there was a way to emulate one fetaure I miss. In uzbl I had a keybind that would enable java/plugins per page, is there a way to do the same in luakit? I know that you can whitelist domains in globals.lua; but it would be nice to have something along the lines of :set enable-scripts or similar. If this is already a feature and I am just missing it then I apolgise.
Technically, ':lua w:set("enable-scripts", true)' should do it but, when you reload the page to reload the javascript, the settings are re-read from domain_props table (see the domain_properties method in webview.lua).
Offline
Hello,
unpleased with the history managment (either keep all entries or delete them all), i wrote this few lines. And btw: this is really the browser i was looking for.
#!/usr/bin/env python
'''Delete history entries of luakit older than x hours'''
import sqlite3
import sys
import time
class Database():
'''handle sqlite3-stuff'''
def __init__(self, db):
'''connect to db'''
try:
self.con = sqlite3.connect(db)
except sqlite3.OperationalError as err:
print("Can't locate database:", err)
sys.exit()
self.cursor = self.con.cursor()
def closeHandle(self):
'''closes connection to the db'''
self.con.commit()
self.con.close()
def main(db, time_limit):
unix_limit = time.time() - int(time_limit)*3600
cmd = 'DELETE FROM history WHERE last_visit<%s' % (unix_limit)
sql = Database(db)
sql.cursor.execute(cmd)
sql.closeHandle()
if __name__ == '__main__':
db='/home/rich_o/.local/share/luakit/history.db'
time_limit='72' # delete entries older than x hours
main(db, time_limit)
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
Offline
Since the lastest changes in follow.lua, the alternative characters hack didn't work anymore, so I tried something.
It works fast enough but it really seems over complicated.You just have to replace the make_label function in follow.lua with all this:
[... snip ...]
It disables the filter stuff, I didn't look much further into that since I don't use it.
Should I put this in the wiki since the wiki's hack is outdated?
Actually, this gives me
Error: In bind call: /home/crshd/.config/luakit/follow.lib:771: attempt to index global 'math' (a nil value)
when I hit "f".
Last edited by k3ttc4r (2011-05-16 17:44:43)
Offline
Add
local math = math
in your follow.lib.
Offline
If you change the git branch name in the luakit-develop-git PKGBUILD to "cookie-filtering" you can try it out quite easily. Check out this commit for more information.
I'm a very happy luakit user and do love the/a domain-based cookie-blocking-feature. I just tried your branch but unfortunately it currently (842550f) doesn't work as expected: the output on stdout correctly states which cookies are to be blocked and which are to be accepted, but nonetheless all cookies are saved into cookies.db. Could you have a look at this?
Please tell me if you need any more input from my side!
Last edited by benito (2011-05-17 15:33:21)
Offline
Hello,
there are three things i miss in the otherwise near-perfect luakit. I didn't find any precise information, if those things are known/considered/thought about/etc, so before adding them to the tracker, i ask here.
1. when opening urls with o or t: url-completion from history and bookmarks (including the tags), pretty much like in jumanji. i really really miss this feature.
2. when adding a new bookmark: completion of already used tags when adding bookmarks. would prevent me from adding misspelled, but actually already existing tags to bookmarks.
3. not so important, but really neat if you have a lot of bookmarks: the possibility to custom sort the tags on luakit://bookmarks. of course, my current workaround with leading numbers does its job.
thank you,
rich_o
Last edited by rich_o (2011-05-19 21:52:44)
Offline
Hey, it’s me again
I have considerable differences in activating private-browsing mode.
This is my domain_props-table in userconf.lua:
domain_props = { [[
["all"] = {
["enable-scripts"] = true,
["enable-plugins"] = true,
["enable-private-browsing"] = true,
["user-stylesheet-uri"] = "",
},
["merriam-webster.com"] = {
["enable-scripts"] = true,
["enable-plugins"] = false,
["enable-private-browsing"] = true,
},
["bbs.archlinux.org"] = {
["user-stylesheet-uri"] = "file://" .. luakit.data_dir .. "/styles/dark.css",
["enable-private-browsing"] = true,
}, ]]
}
(though do not even have a dark.css, but anyhow)
If I start browsing and visit ›:history‹ after a few pages, I can see my browsing history alright… There must be something wrong? Even when I visit bbs.archlinux.org, I get these pages lined up in the history.
Best,
Jakob
Offline
@jakob: this has been recently fixed but only in the development version yet. https://github.com/mason-larobina/luaki … 980a9ca2be
Offline
Yeah, that’s why I’m asking:
pacman -Qi:
Name : luakit-git
Version : 20110518-1
URL : http://www.luakit.org/projects/luakit
Lizenzen : GPL3
Gruppen : Nichts
Stellt bereit : luakit
Hängt ab von : libwebkit luafilesystem
Optionale Abhängigkeiten: Nichts
Benötigt von : Nichts
Konflikt mit : luakit luakit-develop-git
Ersetzt : Nichts
Installationsgröße : 656,00 K
Packer : Jakob
Architektur : x86_64
Erstellt am : Mi 18 Mai 2011 15:43:28 CEST
Installiert am : Mi 18 Mai 2011 15:43:38 CEST
Installationsgrund : Ausdrücklich installiert
Installations-Skript : Ja
Beschreibung : luakit is a highly configurable, micro-browser framework based on the WebKit web
content engine and the GTK+ toolkit.
I mean, this obviously is not luakit-develop-git, but still a quite recent version…?
Last edited by jakob (2011-05-22 15:48:27)
Offline
Ok, sorry, didn't know this is already in the master branch.. No idea then, I'm using the dev-version and it works for me there.
Offline
Hey, it’s me again
I have considerable differences in activating private-browsing mode.
This is my domain_props-table in userconf.lua:
domain_props = { [[ ["all"] = { ["enable-scripts"] = true, ["enable-plugins"] = true, ["enable-private-browsing"] = true, ["user-stylesheet-uri"] = "", }, ["merriam-webster.com"] = { ["enable-scripts"] = true, ["enable-plugins"] = false, ["enable-private-browsing"] = true, }, ["bbs.archlinux.org"] = { ["user-stylesheet-uri"] = "file://" .. luakit.data_dir .. "/styles/dark.css", ["enable-private-browsing"] = true, }, ]] }
(though do not even have a dark.css, but anyhow)
If I start browsing and visit ›:history‹ after a few pages, I can see my browsing history alright… There must be something wrong? Even when I visit bbs.archlinux.org, I get these pages lined up in the history.
Best,
Jakob
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.
Also "enable-private-browsing" doesn't work on a per-webview basis. It's a global webkit settings option (I need a better way of letting the user know this). So a single `w:get_current():set_property("enable-private-browsing", true)` in a binding or command will do the trick. Also for the moment you'll have to remove all traces of "enable-private-browsing" from the domain props table (to prevent it being re-set false after navigating somewhere).
I'll have a bit more time for luakit this week after I fix my arch install on my macbook (MCP89 chipset AHCI problems).
Last edited by mason.larobina (2011-05-22 16:56:13)
Offline