You are not logged in.

#826 2012-05-18 18:36:47

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

Re: dwb - a webkit web browser

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.

Offline

#827 2012-05-18 18:44:27

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: dwb - a webkit web browser

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

#828 2012-05-18 19:42:48

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: dwb - a webkit web browser

portix wrote:
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.


gh · da · ds

Offline

#829 2012-05-18 19:47:44

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: dwb - a webkit web browser

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:

gh · da · ds

Offline

#830 2012-05-19 02:16:01

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: dwb - a webkit web browser

*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

#831 2012-05-19 08:08:03

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: dwb - a webkit web browser

stryder wrote:

Copied the js script to formfill.js and save it in ~/.config/dwb/scripts.

I have the impression that all the scripts should be in the userscripts directory now.

Last edited by bloom (2012-05-19 08:09:05)


gh · da · ds

Offline

#832 2012-05-19 11:18:16

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: dwb - a webkit web browser

Thanks, bloom. Worked.

Offline

#833 2012-05-19 21:30:54

Shinryuu
Member
From: /dev/urandom
Registered: 2010-02-27
Posts: 339

Re: dwb - a webkit web browser

Shinryuu wrote:

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

#834 2012-05-26 01:55:04

gulafaran
Member
Registered: 2011-02-09
Posts: 22

Re: dwb - a webkit web browser

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

#835 2012-05-26 07:31:55

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: dwb - a webkit web browser

gulafaran wrote:

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

#836 2012-05-26 12:00:11

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

Re: dwb - a webkit web browser

gulafaran wrote:

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.

Cloudef wrote:

... 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.

Cloudef wrote:

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

#837 2012-05-26 13:15:17

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: dwb - a webkit web browser

portix wrote:

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

#838 2012-05-26 18:03:51

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

Re: dwb - a webkit web browser

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.

Offline

#839 2012-05-29 17:25:18

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

Re: dwb - a webkit web browser

How to use autoquvi extension? I tried to copy this file to ~/.config/dwb/userscripts but it doesn't do anything.

Offline

#840 2012-05-29 18:07:10

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

Re: dwb - a webkit web browser

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

#841 2012-05-29 18:23:03

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: dwb - a webkit web browser

portix wrote:
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

#842 2012-05-29 18:42:33

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

Re: dwb - a webkit web browser

portix wrote:

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

#843 2012-06-01 22:41:48

alfplayer
Member
From: Buenos Aires, Argentina
Registered: 2010-03-12
Posts: 7

Re: dwb - a webkit web browser

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

#844 2012-06-03 06:22:27

doug piston
Member
From: Seattle
Registered: 2011-09-11
Posts: 387
Website

Re: dwb - a webkit web browser

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. smile

Last edited by doug piston (2012-06-03 13:52:00)

Offline

#845 2012-06-03 06:27:29

Into the Pit
Member
Registered: 2010-09-04
Posts: 37

Re: dwb - a webkit web browser

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?

Offline

#846 2012-06-03 13:20:24

doug piston
Member
From: Seattle
Registered: 2011-09-11
Posts: 387
Website

Re: dwb - a webkit web browser

Into the Pit wrote:
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

#847 2012-06-03 14:24:08

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: dwb - a webkit web browser

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

#848 2012-06-03 14:45:16

doug piston
Member
From: Seattle
Registered: 2011-09-11
Posts: 387
Website

Re: dwb - a webkit web browser

mhertz wrote:

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

#849 2012-06-08 17:10:05

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: dwb - a webkit web browser

tZTZrZg
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

#850 2012-06-08 20:08:30

nomadicME
Member
Registered: 2012-03-31
Posts: 9

Re: dwb - a webkit web browser

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

Board footer

Powered by FluxBB