You are not logged in.
Grabbing https://easylist-downloads.adblockplus.org/easylist.txt
Removed 128 unsupported of 16558 filters.
.. Just gotta say that this browser just blows my mind, and also when thinking about that it's a 1 man project!
Thank you portix; you rock!
Offline
There are some changes in the latest revision, that probably need manual intervention. Some of the command names have changed, for user defined shortcuts it is necessary to modify the names in ~/.config/dwb/keys otherwise the shortcuts will be overwritten with the default ones. I created a script that does the conversion. Also the pass-through mode has been removed, insert mode now acts exactly like pass-through before and the syntax for shortcuts has slightly changed. Non printable keys must now be surrounded by @, e.g.
Control @F11@
and @ and \ must be escaped with \.
Offline
... and also when thinking about that it's a 1 man project!
$ man 2 dwb
No manual entry for dwb in section 2
Yes, it would seem it is
Sorry, couldn't resist. But I also love dwb - great work.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Great work!
A few observations:
If I go to the settings page and search for 'cookies' for example (or anything with a match in the value of one of the variables), when I reach the match inside a text entry, hitting 'n' doesn't lead me to the next match, but replaces the match by 'n' instead (and throws me out of Normal mode).
';F' don't seem to honor 'background-tabs': maybe it should?
I've set
#define HINT_SEARCH_SUBMIT "%s"
in dwb.h and it seems to work fine.
'space' works as 'C-f' without having to define a custom command now: that's great but can you give me a reference to the list of built-in webkit bindings?
It seems there is three different 'fg/bg' tab colors (even / odd normal and active?) but I only see an 'active' and a 'normal' setting and the 'normal' setting don't stick.
The only thing still preventing me from switching is the lack of user styles support (aka custom CSS): I like to be able to hide certain page elements and it seems the adblocking rules can't perform that (besides I'm already using an enhanced '/etc/hosts').
I'm thinking of using something like uzbl-ab instead but I'm not sure I'll be able to make it apply as early as a stylesheet?
Last edited by bloom (2012-01-11 17:53:02)
Offline
Great work!
A few observations:
If I go to the settings page and search for 'cookies' for example (or anything with a match in the value of one of the variables), when I reach the match inside a text entry, hitting 'n' doesn't lead me to the next match, but replaces the match by 'n' instead (and throws me out of Normal mode).
I will have a look into it.
';F' don't seem to honor 'background-tabs': maybe it should?
I think you are right, i will change it.
'space' works as 'C-f' without having to define a custom command now: that's great but can you give me a reference to the list of built-in webkit bindings?
I don't have a reference, most shortcuts are the default gtk shortcuts.
It seems there is three different 'fg/bg' tab colors (even / odd normal and active?) but I only see an 'active' and a 'normal' setting and the 'normal' setting don't stick.
I have added them to the settings page in the latest revision.
I'm not sure if the per site stylesheets will be implemented but i will think about it.
Edit: if you only want to hide elements with custom stylesheets, why not using the adblocker? You can only use element hiding rules in you filterlist and use /etc/hosts anyway.
Last edited by portix (2012-01-11 18:50:59)
Offline
I didn't know about CSS element hiding through adblock rules. I'll inspect.
Minor suggestion:
I wanted to remove the brackets around the tabs number in the tab bar and I think I found the relevant piece of code:
char *escaped = g_markup_printf_escaped("[<span foreground='%s'>%d</span>]%c<span foreground='%s'>%s</span>%c %s%s",
dwb.color.tab_number_color,
g_list_position(dwb.state.views, gl) + 1,
sep1,
dwb.color.tab_protected_color,
buf,
sep2,
progress,
uri ? uri : "about:blank");
?
But in my opinion, the color of the tab number is a sufficient visual distinction and I'd prefer to have the protected tab color applied to the tab number instead of having a '[p]' notification appended.
Last edited by bloom (2012-01-11 20:38:24)
Offline
I didn't know about CSS element hiding through adblock rules. I'll inspect.
dwb accepts adblock+ compatible filter rules. The syntax for element hiding rules is quite simple, it is described here.
Minor suggestion:
I wanted to remove the brackets around the tabs number in the tab bar and I think I found the relevant piece of code:
char *escaped = g_markup_printf_escaped("[<span foreground='%s'>%d</span>]%c<span foreground='%s'>%s</span>%c %s%s", dwb.color.tab_number_color, g_list_position(dwb.state.views, gl) + 1, sep1, dwb.color.tab_protected_color, buf, sep2, progress, uri ? uri : "about:blank");
?
But in my opinion, the color of the tab number is a sufficient visual distinction and I'd prefer to have the protected tab color applied to the tab number instead of having a '[p]' notification appended.
I'm not really satisfied with the tablabels now and i would prefer to make it fully customizable but i have no idea how this could be easily done.
Offline
But in my opinion, the color of the tab number is a sufficient visual distinction and I'd prefer to have the protected tab color applied to the tab number instead of having a '[p]' notification appended.
Protected tabs were indicated exactly in that way when they were introduced. It
was changed because it is also possible to lock an url and a domain for a tab
and this is indicated in the same way but maybe it makes more sense to indicate
the locked status in the statusbar.
Offline
If you only want to hide elements with custom stylesheets, why not using the adblocker?
That's perfect!
I'll be switching soon.
— Tab label: maybe you could use something like '%i %n %t', where the %i represents the favicon, %n the tab number and %t the title. Hence anyone can decide what must be seen, in which order, using which separators, etc.
— New tab position: you might want to add a setting where one can choose from 'left, right, leftmost or rightmost'.
— Focus after tab deletion: once a tab is deleted, the focus might move to the previously selected tab, or to the nearest non visited tab, you might want to add a setting for this.
— I think I'll prefer to see the current URL left-aligned and maybe a setting for the color of the pointed URL is needed.
— How can I bind 'C-j' to 'return' and 'C-g' to 'esc' in the status/input bar?
— I generated an adblock list with the 'grab_adblocker' and I'm getting three warning regarding non supported 'background' and 'frame' rules.
— Could you add a setting to prevent flash content from loading if the related tab has not been focused yet (e.g. to prevent youtube videos from playing in the background)?
Last edited by bloom (2012-01-12 16:05:01)
Offline
The only thing I personally would love added to dwb, is the opera fast-forward/backwards option, which uses heuristics to find the next/previous links of a page.
I've heard mention of it being included in luakit, and so I hoped it was simply a userscript, that I could use in dwb, but I now see that it's a lua file, and I have no experience with lua whatsoever...
If anybody with the time and motivation could maybe translate the following lua file into a standard userscript, then I, and i'm guessing many others, would really appreciate it!
----------------------------------------------------------------
-- Follow "next" or "prev" links on a page --
-- © 2009 Aldrik Dunbar (n30n) --
-- © 2010 Mason Larobina (mason-l) <mason.larobina@gmail.com> --
----------------------------------------------------------------
local go_next = [=[
(function() {
var el = document.querySelector("[rel='next']");
if (el) { // Wow a developer that knows what he's doing!
location = el.href;
}
else { // Search from the bottom of the page up for a next link.
var els = document.getElementsByTagName("a");
var i = els.length;
while ((el = els[--i])) {
if (el.text.search(/(\bnext\b|^>$|^(>>|»)$|^(>|»)|(>|»)$|\bmore\b)/i) > -1) {
location = el.href;
break;
}
}
}
})();
]=]
local go_prev = [=[
(function() {
var el = document.querySelector("[rel='prev']");
if (el) {
location = el.href;
}
else {
var els = document.getElementsByTagName("a");
var i = els.length;
while ((el = els[--i])) {
if (el.text.search(/(\b(prev|previous)\b|^<$|^(<<|«)$|^(<|«)|(<|«)$)/i) > -1) {
location = el.href;
break;
}
}
}
})();
]=]
-- Add `[[` & `]]` bindings to the normal mode.
local buf = lousy.bind.buf
add_binds("normal", {
buf("^%]%]$", function (w) w:eval_js(go_next) end),
buf("^%[%[$", function (w) w:eval_js(go_prev) end),
})
-- vim: et:sw=4:ts=8:sts=4:tw=80
Offline
The only thing I personally would love added to dwb, is the opera fast-forward/backwards option, which uses heuristics to find the next/previous links of a page.
That's pretty straightforward: put this in $XDG_CONFIG_HOME/dwb/scripts/
function go_next() {
var el = document.querySelector("[rel='next']");
if (el) { // Wow a developer that knows what he's doing!
location = el.href;
}
else { // Search from the bottom of the page up for a next link.
var els = document.getElementsByTagName("a");
var i = els.length;
while ((el = els[--i])) {
if (el.text.search(/(\bnext\b|^>$|^(>>|»)$|^(>|»)|(>|»)$|\bmore\b)/i) > -1) {
location = el.href;
break;
}
}
}
}
function go_prev() {
var el = document.querySelector("[rel='prev']");
if (el) {
location = el.href;
}
else {
var els = document.getElementsByTagName("a");
var i = els.length;
while ((el = els[--i])) {
if (el.text.search(/(\b(prev|previous)\b|^<$|^(<<|«)$|^(<|«)|(<|«)$)/i) > -1) {
location = el.href;
break;
}
}
}
}
And then, put two shell scripts in $XDG_CONFIG_HOME/dwb/userscripts/:
#! /bin/bash
# dwb: ]]
echo 'open javascript:go_next()'
#! /bin/bash
# dwb: [[
echo 'open javascript:go_prev()'
Last edited by bloom (2012-01-12 17:08:02)
Offline
You can also use a custom command, when trying this i realised that this didn't work with javascript since the seperator for custom commands was a semicolon, custom commands must no be seperated with two semicolons. With this fix you can bind it with
]]:exja (function() {var el = document.querySelector("[rel='next']"); if (el) { location = el.href; } else { var els = document.getElementsByTagName("a"); var i = els.length; while ((el = els[--i])) { if (el.text.search(/(\bnext\b|^>$|^(>>|»)$|^(>|»)|(>|»)$|\bmore\b)/i) > -1) { location = el.href; break; } } }})();
You must only remove all newlines and all comments.
Edit or with blooms solution you can also define
]]:exja go_next();
[[:exja go_prev();
Edit2: A shorter version with removed whitespaces that uses ] and [ instead of ]] and [[
]:exja (function(){var e=document.querySelector("[rel='next']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\bnext\b|^>$|^(>>|»)$|^(>|»)|(>|»)$|\bmore\b)/i)>-1){location=e.href; break;}}}})();
[:exja (function(){var e=document.querySelector("[rel='prev']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\b(prev|previous)\b|^<$|^(<<|«)$|^(<|«)|(<|«)$)/i)>-1){location=e.href;break;}}}})();
Last edited by portix (2012-01-12 17:30:13)
Offline
Thanks alot bloom and portix; I really appreciate it!
Unfortunetly, it seems im a complete moron, as I cannot get either of your suggestions to work...
Hmm, gonna try to see if I can find out what i'm missing..
Offline
You need the latest revision of to get my suggestion to work as there were two bugs, the one concerning the semicolon as i said, the other was that some keyboard combinations weren't recognized but both are fixed. Just copy it to the text area in dwb://keys and save it.
Last edited by portix (2012-01-12 18:29:26)
Offline
Thanks portix!
However, i'm using latest rev. and I still cannot get it to work...
I can see that the command isn't even mapped, since when I press ] in normal mode, then the char is printed still in a textbox...
When I paste the custom command into the textfield, and select 'save custom', then there's no indication of anything being saved, no matter how many times I press it, and it seems it isn't sticking?
Offline
When I paste the custom command into the textfield, and select 'save custom', then there's no indication of anything being saved, no matter how many times I press it, and it seems it isn't sticking?
Then you don't have the latest revision, tip is number 966.
Offline
-> Version found: 966
==> Making package: dwb-hg 966-1 (Thu Jan 12 20:08:34 CET 2012)
Offline
Oh, i see, the custom_keys file must be created, otherwise nothing will be saved, I will fix this.
Offline
Offline
I'm trying the formfiller script: works well in most cases, problems arise when variables and/or values contain non alphanumeric characters:
For example, the following name:
data[user][username]
makes the javascript injected code fails because of this:
COMMAND+="var ${NAME}=
If a value contains '%', e.g.
foo%bar
it leads to alterations since '%ba' is interpreted as an HTML character?
Offline
I'm trying the formfiller script: works well in most cases, problems arise when variables and/or values contain non alphanumeric characters:
For example, the following name:data[user][username]
makes the javascript injected code fails because of this:
COMMAND+="var ${NAME}=
If a value contains '%', e.g.
foo%bar
it leads to alterations since '%ba' is interpreted as an HTML character?
I don't know, also i'm not using the formfiller script anymore but if you have a fix for it i would include it in the source. But i'm still planning to implement a builtin formfiller without javascript.
Offline
Portix, thanks for dwb. I'm beginning to explore the options. While I'm committed to reading through the 20 pages that this thread has, I'd appreciate a quick pointer as to how I can assign 2 or more keys to actions. Eg I have assigned "[" and "]" to history_back and history_forward but I would like to also assign "z" and "x" to do the same for the times when my right hand is on the mouse.
Offline
Portix, thanks for dwb. I'm beginning to explore the options. While I'm committed to reading through the 20 pages that this thread has, I'd appreciate a quick pointer as to how I can assign 2 or more keys to actions. Eg I have assigned "[" and "]" to history_back and history_forward but I would like to also assign "z" and "x" to do the same for the times when my right hand is on the mouse.
You can map them in the custom commands textarea:
x:back
z:forward
but if you map x there are some default keybindings that won't work anymore (xd, xu, xt, xx, xb, xv).
Last edited by portix (2012-01-13 07:26:45)
Offline
Thanks. That worked! I don't think I'll ever need the functions that are called by "x?" so I have just added an A in front of all of them.
Offline