You are not logged in.
portix wrote:#!javascript
Shouldn't
//!javascript
be more appropriate?
It may be more appropriate, i thought using a shebang makes it clear that it has to be right at the beginning of the file. But since scripts for dwb won't run in other javascript environments it wouldn't make any difference.
Offline
Thanks, Portix. I'm new to using scripts in dwb. Will have to check out your documentation and figure out what I need to do. Appreciate your helpfulness.
Offline
bloom wrote:portix wrote:#!javascript
Shouldn't
//!javascript
be more appropriate?
It may be more appropriate, i thought using a shebang makes it clear that it has to be right at the beginning of the file. But since scripts for dwb won't run in other javascript environments it wouldn't make any difference.
My main complaint is that # is not a comment character in JavaScript, so the shebang line is not properly highlighted in vim.
Offline
I've updated the previous / next page heuristic to work with the JS API:
#!javascript
var prev_next_map = {
prev: "(^<$|^(<<|«|←)|\\b(prev|previous|newer|précédente)\\b)",
next: "(^>$|(>>|»|→)$|\\b(next|more|older|suivante)\\b)"
};
var follow_relation = function(rel, data) {
var qry = "[rel='" + rel + "']";
var elt = document.querySelector(qry);
if (elt) {
location.href = elt.href;
} else {
var str = data[rel];
if (!str)
return;
re = RegExp(str, 'i');
var links = document.getElementsByTagName("a");
var i = links.length
while (elt = links[--i]) {
var uri = elt.href;
var txt = elt.text;
if (elt.title)
txt = elt.title;
var images = elt.getElementsByTagName("img");
if (images.length > 0) {
img = images[0];
if (img.alt)
txt = img.alt;
}
if (re.test(txt) && uri.search(/#/) == -1) {
location.href = uri;
break;
}
}
}
}
function inject_follow(rel) {
var script = "(" + String(follow_relation) + ")(\"" + rel + "\"," + JSON.stringify(prev_next_map) + ");";
var frames = tabs.current.allFrames;
for (var i = 0; i < frames.length; i++) {
frames[i].inject(script);
}
}
function prev_page() {
inject_follow('prev');
}
function next_page() {
inject_follow('next');
}
bind("[[", prev_page);
bind("]]", next_page);
// vim: set ft=javascript:
Offline
*sigh* I'm obviously stupid. Can't get this to work. Copied the js script to formfill.js and save it in ~/.config/dwb/scripts. Relaunched dwb, press gF and ... nothing. What am I doing wrong?
Offline
Offline
Thanks, bloom. Worked.
Offline
Hey, any idea why I have these black boxes in my dwb? This doesn't happen with my laptop which is x86_64 too. I have tried to delete my configurations, tried both dwb and dwb-hg etc. I wonder what's the difference in my system. Also I have tried different GTK themes but it doesn't help.
Here's the pic:
http://ompldr.org/tZHNydA
Mhh... interesting, got it fixed by enabling "Composite" from xorg.conf with nvidia. So the problem was with the video driver, this is insanity.
Offline
i have tryed every possible setting i could see and think of to get ssl working on this page, https://internetbanken.privat.nordea.se/nsp/engine , but it just keeps spitting out SSL handshake failed. works fine in firefox/chromium
Offline
i have tryed every possible setting i could see and think of to get ssl working on this page, https://internetbanken.privat.nordea.se/nsp/engine , but it just keeps spitting out SSL handshake failed. works fine in firefox/chromium
This is a bug in webkit AFAIK, to workaround it set the ssl-ca-cert key in dwb config manually.
ex. ssl-ca-cert=/etc/ssl/certs/ca-certificates.crt
and then set ssl-use-system-ca-file to false.
Mhh... interesting, got it fixed by enabling "Composite" from xorg.conf with nvidia. So the problem was with the video driver, this is insanity.
I had that same problem a while ago, however I think it was related to some system update since it worked day after and I still have "Composite" disabled.
@portix
My tab completition menu is awfully slow (takes few minutes to appear and scrolling it is slow)
Any idea why this would happen? Happens in both gtk2 && gtk3 hg build.
Last edited by Cloudef (2012-05-26 07:32:28)
Offline
i have tryed every possible setting i could see and think of to get ssl working on this page, https://internetbanken.privat.nordea.se/nsp/engine , but it just keeps spitting out SSL handshake failed. works fine in firefox/chromium
That's a bug in libsoup. On some sites it helps to set ssl-strict to false, i think this is the default setting in most other webkit browsers.
... to workaround it set the ssl-ca-cert key in dwb config manually.
ex. ssl-ca-cert=/etc/ssl/certs/ca-certificates.crt
That's not possible if dwb is compiled against libsoup >= 2.38, the setting ssl-ca-cert is replaced with ssl-use-system-ca-file then.
My tab completition menu is awfully slow (takes few minutes to appear and scrolling it is slow)
Any idea why this would happen? Happens in both gtk2 && gtk3 hg build.
Do you have a very long history? If you set history-length to a very large number tabcompletion may be very slow with the current tabcompletion implementation.
I still haven't finished the new tabcompletion implementation, it should be faster even with many history items then.
Offline
Do you have a very long history? If you set history-length to a very large number tabcompletion may be very slow with the current tabcompletion implementation.
I still haven't finished the new tabcompletion implementation, it should be faster even with many history items then.
I use the default(?) 500 value, I'll try dropping it to something low like 50 and see what happens.
E: had to remove the history files too.
Last edited by Cloudef (2012-05-26 13:19:38)
Offline
I use the default(?) 500 value, I'll try dropping it to something low like 50 and see what happens.
A history length of 500 should not be a problem.
Offline
How to use autoquvi extension? I tried to copy this file to ~/.config/dwb/userscripts but it doesn't do anything.
Offline
The extensions are not really ready for usage yet, all extensions in my repo work but getting them to work is currently a bit complicated:
Create a folder ~/.local/share/dwb/extensions/
Copy the script to ~/.local/share/dwb/extensions/autoquvi
Create the following script in ~/.config/dwb/userscritps/
#!javascript
extensions.load("autoquvi", { shortcut : "Control q", autoPlay : false });
The options of the extension are explained at the beginning of the file.
Edit: This only works with dwb-hg, the last release doesn't execute javascript-scripts.
Last edited by portix (2012-05-29 18:08:25)
Offline
Cloudef wrote:I use the default(?) 500 value, I'll try dropping it to something low like 50 and see what happens.
A history length of 500 should not be a problem.
Yeah, dunno why it was slow. Removing the history files helped though anyways. It's instant again.
Offline
The extensions are not really ready for usage yet, all extensions in my repo work but getting them to work is currently a bit complicated:
Create a folder ~/.local/share/dwb/extensions/
Copy the script to ~/.local/share/dwb/extensions/autoquvi
Create the following script in ~/.config/dwb/userscritps/
#!javascript extensions.load("autoquvi", { shortcut : "Control q", autoPlay : false });
The options of the extension are explained at the beginning of the file.
Edit: This only works with dwb-hg, the last release doesn't execute javascript-scripts.
Thanks.
Offline
This one is very similar to the Google Bookmarks bookmarklet found here http://support.google.com/bookmarks/bin … wer=175117 (it wasn't possible to make it work). It opens Google's add bookmark page on a new tab to bookmark the current tab.
It must be saved inside ~/.config/dwb/userscripts/:
#!javascript
function saveBookmark() {
var w = tabs.current;
execute("tabopen http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="+encodeURIComponent(w.uri)+"&title="+encodeURIComponent(w.title));
}
bind("xz", saveBookmark);
Small problem: it leaves the add bookmark page/tab open and blank after clicking "Save bookmark". It can be closed like any tab.
Thank you portix.
Last edited by alfplayer (2012-06-01 22:42:15)
Offline
I've searched the man page but haven't found my answers and I apologize for even asking cause both seem so simple.
When I use shift+o it opens a new tab but split screens it
and I can't get clickable links in terminal.
Again I usually can find my own answers in these situations but I'm head scratching here.
Cheers.
Edit: I'll take this to the newb forum as I don't think its an issue with dwb.
Last edited by doug piston (2012-06-03 13:52:00)
Offline
When I use shift+o it opens a new tab but split screens it
Do you use dwb in a single instance?
Offline
doug piston wrote:When I use shift+o it opens a new tab but split screens it
Do you use dwb in a single instance?
Yes, and I actually just fixed that issue by removing dwb and it's .config and reinstalling. So just now to fix clickable links from Urxvt.
Offline
That's an urxvt issue and not a dwb one, but anyways, in the community repo there's urxvt-url-select, which after alittle setup(arch wiki), will let you open url's in dwb from urxvt, but this is by the keyboard and not mouse...
I use the aur package urxvt-perls-git, which in addition to the above also inludes an urxvt extension to mark/copy/paste with the keyboard from the terminal...
Last edited by mhertz (2012-06-03 14:25:55)
Offline
That's an urxvt issue and not a dwb one, but anyways, in the community repo there's urxvt-url-select, which after alittle setup(arch wiki), will let you open url's in dwb from urxvt, but this is by the keyboard and not mouse...
I use the aur package urxvt-perls-git, which in addition to the above also inludes an urxvt extension to mark/copy/paste with the keyboard from the terminal...
Not moments after posting that I'd take it to the newb forum I decided to rebuild urxvt and perl. I logged out in between once and noticed a 'urxvt cannot interput perl interpeter'. Regardless all fix now, apologies on clogging up the thread.
Offline
Any idea what could make these black boxes appear? Doesn't happen on GTK3 version of dwb.
Tried changing gtk2 themes, check console and strace. Nothing there.
E: Crazy, it seems like setting composite to true fixes this afterall...
Might just move to gtk3 build.
Last edited by Cloudef (2012-06-09 09:28:59)
Offline
I'm trying to get away from adobe-flash. Toward this end, I am trying out lightspark. I installed it in gentoo, and chromium recognizes the plugin and plays youtube videos just fine, however, dwb (ver e57c85c03a21) does not. Says "missing plugin". Here are the list of plugin type files installed:
/usr/lib/lightspark/liblightspark.so -> liblightspark.so.0.5
/usr/lib/lightspark/liblightspark.so.0.5 -> liblightspark.so.0.5.7
/usr/lib/lightspark/liblightspark.so.0.5.7
/usr/lib/lightspark/plugins
/usr/lib/lightspark/plugins/liblightsparksdlplugin.so
So my question is, do I need to make a symlink somewhere? Does dwb have a specific plugin folder that this symlink should be placed in? Is there a reason why chromium picked up the plugin automatically, but dwb did not?
Thanks,
John
Offline