You are not logged in.

#1626 2013-04-26 12:13:02

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

Re: dwb - a webkit web browser

LuX wrote:
portix wrote:
LuX wrote:

1) There is no way to show/hide the blinking cursor in a form whenever changing mode.

That can be done with a script:

Many thanks! I've just done it and it works pretty well in general.

However if the auto-insert-mode option is disabled, the blinking cursor is visible when opening a page, although dwb is (logically) in command mode. I do not intend to turn off this option, but just in case, could this be fixed in the script?

More strangely, if auto-insert-mode is turned on, this script makes dwb have the expected behaviour on most pages (for example on search pages of Arch's web site or of wikipedia) but NOT on Google! On www.google.fr the blinking cursor remains visible in every mode, with or without this script and with our witout auto-insert-mode activated. Any idea on this?

And finally I have yet another question on modes.

Suppose that I have opened several tabs and that the current tab (say tab 1) is in insert mode. I would like to be able to navigate through the tabs, then go back to tab 1 and still find it in insert mode. Is it possible?

You can call blur on the active element when the load of a site has finished, just append

Signal.connect("loadFinished", function(wv) {
    wv.mainFrame.inject("document.activeElement.blur();");
});

to the script. But that won't work on google either, the only way to prevent google searchfield from grabbing focus is to disable javascript on google.
Switching tabs and staying in insert mode is not possible.

Offline

#1627 2013-04-26 12:38:49

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

Re: dwb - a webkit web browser

I was wrong, it is also possible (with a dirty workaround) in a script:

//!javascript

function switchMode(mode) {
    timer.start(100, function() {
        execute(mode);
        return false;
    });
}
Signal.connect("tabFocus", function(wv, current) {
    var mode, storedMode; 

    mode = util.getMode();
    script.setPrivate(current, "mode", mode);
    storedMode = script.getPrivate(wv, "mode");

    if (storedMode !== mode)
    {
        switch (storedMode)
        {
            case Modes.NormalMode : switchMode("normalMode"); break;
            case Modes.InsertMode : switchMode("insert_mode"); break;
            default : return false;
        }
    }
});

bind("Control j", function() {
    execute("focus_next");
}, OverrideKey.insertMode);
bind("Control k", function() {
    execute("focus_prev");
}, OverrideKey.insertMode);

You could save that in a seperate file or in the other script i gave you. With
that script you can switch tabs with Control j and Control k.

I think i will add a new function to the javascript api "changeMode" so that the
workaround isn't needed.

Offline

#1628 2013-04-26 17:19:29

LuX
Member
From: France
Registered: 2010-06-14
Posts: 79

Re: dwb - a webkit web browser

Many thanks for writing these scripts, it's very kind!  cool

Separately, they work perfectly well. Together, unfortunately, they interract at some point: if I leave a page in insert mode with the cursor in some form using Ctrl-j and go back to it using Ctrl-k, I expect this page to be still in insert mode and the cursor to be blinking at the same place. This is indeed the case if the first script is removed, but not when it is in place. On the other hand, if I remove the first script, I keep the blinking cursor in form fields even when I'm not in insert mode. Life's cruel, sometimes...  roll

In the same vein, I would like also to be able to open a new tab from a page in insert mode...

Well, after such examples I presume that all this is possible through scripts such as the above ones. My problem is that I have no idea of how to do it and I don't understand anything in those scripts. Would you know a valuable source where I could learn relatively easily how to build such scripts (I'm not a wizard computer scientist, just an ordinary user, with some very basic knowledge of programming)? Is this only "general" javascript code, or does it require to know all the secrets of webkit and dwb to achieve this goal? Is it documented somewhere with dwb, maybe?

I do not understand what implies your suggestion to add a new "ChangeMode" fonction in api. Does it mean that in the future such behaviour (let's call it tab-manipulation-and-navigation-in-all-modes, just like windows navigation actually) could work in dwb out of the box? Or is this "trop beau pour être vrai" (too beautifull to be true, as we say in french)?

Last edited by LuX (2013-04-26 17:28:24)

Offline

#1629 2013-05-01 09:56:40

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

Re: dwb - a webkit web browser

LuX wrote:

Many thanks for writing these scripts, it's very kind!  cool

Separately, they work perfectly well. Together, unfortunately, they interract at some point: if I leave a page in insert mode with the cursor in some form using Ctrl-j and go back to it using Ctrl-k, I expect this page to be still in insert mode and the cursor to be blinking at the same place. This is indeed the case if the first script is removed, but not when it is in place. On the other hand, if I remove the first script, I keep the blinking cursor in form fields even when I'm not in insert mode. Life's cruel, sometimes...  roll

I will try to fix and post a script if i have a solution.

LuX wrote:

Well, after such examples I presume that all this is possible through scripts such as the above ones. My problem is that I have no idea of how to do it and I don't understand anything in those scripts. Would you know a valuable source where I could learn relatively easily how to build such scripts (I'm not a wizard computer scientist, just an ordinary user, with some very basic knowledge of programming)? Is this only "general" javascript code, or does it require to know all the secrets of webkit and dwb to achieve this goal? Is it documented somewhere with dwb, maybe?

In javascript scripts all native javascript functions can be used, only the
dom-object properties and functions cannot be used in scripts because the script runs in a
different context. There is a api documentation online
(http://portix.bitbucket.org/dwb/api/) and also a man-page (man dwb-js), however
not all properties of all objects are documented. All objects derived from
webkit or gtk objects also have the native webkit/gtk properties, e.g.
tabs.current which is of type WebKitWebView has all properties listed in
http://webkitgtk.org/reference/webkitgt … bview.html
and since a WebKitWebView is also a GtkWidget is also has the properties listed
in https://developer.gnome.org/gtk3/stable … properties.
Also all signals listed there can be used in scripts, only the parameters of the
callback function are different, the callback in scripts always starts with the
second parameter and this refers to the first parameter in the callback
function.

tabs.current.connect("document-load-finished", function (frame) {
    io.print(this.uri); 
    ...
}); 
LuX wrote:

I do not understand what implies your suggestion to add a new "ChangeMode" fonction in api. Does it mean that in the future such behaviour (let's call it tab-manipulation-and-navigation-in-all-modes, just like windows navigation actually) could work in dwb out of the box? Or is this "trop beau pour être vrai" (too beautifull to be true, as we say in french)?

No, there is a workaround in the script, the timer.start(...) part, but i
realized that it cannot be circumvented with a changeMode function. The problem
is, the signal tabFocus is emitted before the focus of a tab changes, it is not
possible to directly change the mode in the callback function because dwb
automatically changes to normal mode when the tab-focus changes. So the
workaround is still required.

Offline

#1630 2013-05-06 05:06:08

Mr_Kartoffelsalat
Member
Registered: 2012-04-17
Posts: 29

Re: dwb - a webkit web browser

I have a problem using leo.org:
when I want to search for any word I can put it into the search field, but after hitting enter or clicking on the send button nothing happens. (The language is just an example, it doesn't work with any language)  If I create a searchengine-shortcut for the site and use that, then the search works. In short: I'm not able to use the search on the website itself.
I tested the scenario with dwb from community and also with the dwb-git version. Both with the same negative results.

Last edited by Mr_Kartoffelsalat (2013-05-06 05:08:21)

Offline

#1631 2013-05-06 22:33:26

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

Re: dwb - a webkit web browser

@Mr_Kartoffelsalat: Have you tried to set passthrough-keys to all or webkit? It seems that there is a bug when it is set to none, i'll try to fix it soon.

Offline

#1632 2013-05-07 01:03:50

Mr_Kartoffelsalat
Member
Registered: 2012-04-17
Posts: 29

Re: dwb - a webkit web browser

portix wrote:

@Mr_Kartoffelsalat: Have you tried to set passthrough-keys to all or webkit?

Thanks for answering, I tried all three options and had no efforts with any. sad

Offline

#1633 2013-05-08 12:29:36

madalu
Member
Registered: 2009-05-05
Posts: 217

Re: dwb - a webkit web browser

Fantastic browser! I discovered it as a replacement to conkeror, which has been segfaulting recently.

Although I can move the cursor with the arrow keys when enable-caret-browsing is true, I have not yet figured out how to select text. When I press Shift-left or Shift-right, nothing happens. In most other browsers, using Shift-arrow with caret browsing on will select text.

Needless to say, in a keyboard driven browser, it would be great to be able to select text with the keyboard. Any tips/suggestions would be greatly appreciated.

Last edited by madalu (2013-05-08 12:30:11)

Offline

#1634 2013-05-08 12:36:24

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

Re: dwb - a webkit web browser

If you are using dwb-git there is a caret- and a visual-mode which isn't really done yet but it is already usable, you can enable caret-mode with v, when in caret-mode you can also navigate with h/j/k/l/w/b/$/0, pressing v again or space enables visual-mode, in visual mode you can again select text with h/j/k/l/w/b/$/0, currently it is not possible to select text with Arrow-Keys in visual mode, but i will implement it.

Offline

#1635 2013-05-08 19:34:22

madalu
Member
Registered: 2009-05-05
Posts: 217

Re: dwb - a webkit web browser

portix wrote:

If you are using dwb-git there is a caret- and a visual-mode which isn't really done yet but it is already usable, you can enable caret-mode with v, when in caret-mode you can also navigate with h/j/k/l/w/b/$/0, pressing v again or space enables visual-mode, in visual mode you can again select text with h/j/k/l/w/b/$/0, currently it is not possible to select text with Arrow-Keys in visual mode, but i will implement it.

That is great. Thanks. Only one issue: if I search for a word on the page and then activate visual mode, I find that the cursor is placed at the very top of the page. It would be nice if the cursor could be placed at the beginning (or end) of the matching text. Or if one could search while visual mode is active.

Last edited by madalu (2013-05-08 19:34:59)

Offline

#1636 2013-05-08 20:28:01

naphelge
Member
Registered: 2013-03-13
Posts: 15

Re: dwb - a webkit web browser

I was wondering if there is some sort of cache file dwb keeps of a download dir history that can be accessed from dwb's command line?
I am often saving files and webpages in multiple locations (no single downloads file in ~ here)  and I find myself often copying and pasting dir, which if they could be entered and tab completed on the command line or perhaps a history list accessed or something similiar, it would make life easier.

if the feature is already implemented, my bad, but would you mind explaining the details to implement/use?

Offline

#1637 2013-05-10 16:49:22

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,095
Website

Re: dwb - a webkit web browser

Hey portix, I have a question for you that is totally speculative and I don't believe has been answered yet. If Google's Blink starts making separate releases (i.e., is available to use as a separate engine for other programs), would you / have you consider(ed) switching to it from webkit, or opening a new branch for it?

All the best,

-HG

Offline

#1638 2013-05-10 17:02:25

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

Re: dwb - a webkit web browser

I considered switching to chromium-embedded which will also use blink in the future and which has a C-Api. It would mean a complete rewrite of dwb because chromium-embedded doesn't have any toolkit bindings, but i fear that i don't have enough spare time to do it. Also i currently can't even build chromium-embedded because i don't own a computer with enough RAM to build it. Using blink directly wouldn't be an option, it would mean even more work than using chromium embedded, that isn't a task i can do alone, and i think blink is C++ and i don't use C++ voluntarily.

Offline

#1639 2013-05-10 17:08:15

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,095
Website

Re: dwb - a webkit web browser

Fair enough. I'll be very interested to see how things go (if they go) for chromium-embedded. webkitgtk seems to have a few bugs that don't look likely to be fixed very soon, and they are kind of killer for me.

A last question, are there any plans to implement vim-like keybinds inside text-boxes (for instance, being able to ^u to clear a line)?

All the best,

-HG

Offline

#1640 2013-05-10 17:09:23

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: dwb - a webkit web browser

Out of curiosity, how much RAM is needed to build chromium-embedded? I only found some info about building chromium - they recommend 8 GB.

Offline

#1641 2013-05-10 17:56:37

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: dwb - a webkit web browser

karol wrote:

Out of curiosity, how much RAM is needed to build chromium-embedded? I only found some info about building chromium - they recommend 8 GB.

Dafuq? I build Chromium on a machine with 2GB. No problems whatsoever. But I must be weird, because I once built Firefox on my netbook with only 1GB (and no swap!!). I do have to note that both machines are 32bit (well, the desktop has a 64bit processor, but it has a 32bit install).

Last edited by Gusar (2013-05-10 17:58:10)

Offline

#1642 2013-05-10 19:46:23

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

Re: dwb - a webkit web browser

chomium-embedded also needs 8GB, i haven't tried it only once but it failed because the build process requires python2, i haven't tried to fix it, i wouldn't have time to start with it anyway.

Offline

#1643 2013-05-14 18:37:09

musicmatze
Member
Registered: 2013-05-14
Posts: 10

Re: dwb - a webkit web browser

As this thread seems to be very high frequently used, I'll post here my idea how to improve dwb:

Add UndoTree like history navigation! This would be so awesome to have! There is this awesome plugin for vim, called UndoTree. Maybe you can implement such behaviour for dwb but just with tabs and their history? No browser offers such an option yet, to browse back in history-_tree_!

I'd love to contribute, but first I'm unable to clone the bitbucket git repo and otherwise I have no time for it, sadly!

Thank you for this awesome browser!

Offline

#1644 2013-05-15 06:05:06

naphelge
Member
Registered: 2013-03-13
Posts: 15

Re: dwb - a webkit web browser

hey portix,

I just 'make install'ed dwb in fresh crunchbang install using source dwb-2013.03.30 and I noticed the handy-dandy 'ys' (yank-source) key bindings to copy source of selected text to clipboard are not working for me. I looked but did not see any alternate mappings for this feature. Has the feature perhaps been changed, discarded (*shutter*)?

Last edited by naphelge (2013-05-15 06:07:52)

Offline

#1645 2013-05-15 09:22:10

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

Re: dwb - a webkit web browser

dwb never had a 'ys' for copying the source.

Offline

#1646 2013-05-15 11:47:21

naphelge
Member
Registered: 2013-03-13
Posts: 15

Re: dwb - a webkit web browser

portix wrote:

dwb never had a 'ys' for copying the source.

I can imagine how busy you are with such an active board. But check your replies on pg 60:

https://bbs.archlinux.org/viewtopic.php … 8#p1243538

and

https://bbs.archlinux.org/viewtopic.php … 6#p1243546

regarding the feature you did implement, and I have been using flawless in xubuntu for the past couple of months. Unfortunately the keybindings no longer appear to be working as I indicated in my previous post.

Offline

#1647 2013-05-15 12:45:35

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

Re: dwb - a webkit web browser

It's a custom userscript and not an implemented feature, btw wink

Offline

#1648 2013-05-15 13:23:45

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

Re: dwb - a webkit web browser

They still work here with latest git, they should also work with the last release, the script doesn't use any features that weren't implemented in the last release.

Edit: Have you copied the script to ~/.config/dwb/userscripts/?

Last edited by portix (2013-05-15 13:25:04)

Offline

#1649 2013-05-16 19:48:20

naphelge
Member
Registered: 2013-03-13
Posts: 15

Re: dwb - a webkit web browser

portix wrote:

They still work here with latest git, they should also work with the last release, the script doesn't use any features that weren't implemented in the last release.

yeah I tried installing using latest git but always have connection issues, so I just d/loaded tarball using links below git link.

portix wrote:

Edit: Have you copied the script to ~/.config/dwb/userscripts/?

yeah I copied over ~/.config/dwb to new install, and have double checked that the script is indeed in the userscripts folder. Still using xubu, and things work fine there, so not sure why this doesn't work.

I think I will check if I still have the tarball I used to install dwb on xubu and try installing that on new install if it is a different rel., and see if that makes a diff.

Last edited by naphelge (2013-05-16 19:49:47)

Offline

#1650 2013-05-17 12:50:36

z1lt0id
Member
Registered: 2012-09-20
Posts: 177

Re: dwb - a webkit web browser

Everytime I try to look at comments in Google+ dwb crashes with a segmentation fault.

Last 29 stack frames: 

 29: dwb() [0x40f300]
 28: dwb() [0x42778f]
 27: /usr/lib/libc.so.6(+0x35240) [0x7fa9a3d55240]
 26: /usr/lib/libwebkitgtk-1.0.so.0(+0xad1f6c) [0x7fa9a7349f6c]
 25: /usr/lib/libwebkitgtk-1.0.so.0(+0xad2668) [0x7fa9a734a668]
 24: /usr/lib/libwebkitgtk-1.0.so.0(+0xad3783) [0x7fa9a734b783]
 23: /usr/lib/libwebkitgtk-1.0.so.0(+0xab9853) [0x7fa9a7331853]
 22: /usr/lib/libwebkitgtk-1.0.so.0(+0xad1d83) [0x7fa9a7349d83]
 21: /usr/lib/libwebkitgtk-1.0.so.0(+0xad2668) [0x7fa9a734a668]
 20: /usr/lib/libwebkitgtk-1.0.so.0(+0xad3783) [0x7fa9a734b783]
 19: /usr/lib/libwebkitgtk-1.0.so.0(+0xab9853) [0x7fa9a7331853]
 18: /usr/lib/libwebkitgtk-1.0.so.0(+0xad1d83) [0x7fa9a7349d83]
 17: /usr/lib/libwebkitgtk-1.0.so.0(+0xad2668) [0x7fa9a734a668]
 16: /usr/lib/libwebkitgtk-1.0.so.0(+0xad3783) [0x7fa9a734b783]
 15: /usr/lib/libwebkitgtk-1.0.so.0(+0xab9853) [0x7fa9a7331853]
 14: /usr/lib/libwebkitgtk-1.0.so.0(+0xac738f) [0x7fa9a733f38f]
 13: /usr/lib/libwebkitgtk-1.0.so.0(+0xad3182) [0x7fa9a734b182]
 12: /usr/lib/libwebkitgtk-1.0.so.0(+0xad3738) [0x7fa9a734b738]
 11: /usr/lib/libwebkitgtk-1.0.so.0(+0xab9853) [0x7fa9a7331853]
 10: /usr/lib/libwebkitgtk-1.0.so.0(+0xbe1dc8) [0x7fa9a7459dc8]
  9: /usr/lib/libwebkitgtk-1.0.so.0(+0xa5eb3d) [0x7fa9a72d6b3d]
  8: /usr/lib/libwebkitgtk-1.0.so.0(_ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv+0x4f) [0x7fa9a6f0e26f]
  7: /usr/lib/libwebkitgtk-1.0.so.0(+0x6ab114) [0x7fa9a6f23114]
  6: /usr/lib/libwebkitgtk-1.0.so.0(+0xdbd86c) [0x7fa9a763586c]
  5: /usr/lib/libwebkitgtk-1.0.so.0(+0xdc0dcc) [0x7fa9a7638dcc]
  4: /usr/lib/libwebkitgtk-1.0.so.0(+0xe28759) [0x7fa9a76a0759]
  3: /usr/lib/libwebkitgtk-1.0.so.0(+0xe20a29) [0x7fa9a7698a29]
  2: /usr/lib/libjavascriptcoregtk-1.0.so.0(+0x2453ff) [0x7fa9a4b4d3ff]
  1: /usr/lib/libjavascriptcoregtk-1.0.so.0(+0x24e199) [0x7fa9a4b56199]
Segmentation fault (core dumped)

Has anyone else had this issue?

Offline

Board footer

Powered by FluxBB