You are not logged in.

#1376 2012-12-30 03:49:38

shuuichi_nitori
Member
Registered: 2012-12-30
Posts: 37

Re: dwb - a webkit web browser

Hi, dwb is wonderful, I'm using it on my awesomeWM right now, but I have a little question.
sometimes dwb gets very slow when I have more than 4-5 tabs open, gets slow when I load big images (>2600px), and a quite slow viewing videos on youtube. someone knows what is happening?


Archlinux + AwesomeWM

Offline

#1377 2013-01-02 16:05:00

grapeli23
Member
Registered: 2009-08-19
Posts: 13

Re: dwb - a webkit web browser

grapeli23 wrote:

Last dwb-hg (libwebkit-1.9.3) segmentation fault when open links with image like this.
adblocker=true

--- SIGSEGV (Segmentation fault) @ 0 (0) ---                                            
...            
--- SIGSEGV (Segmentation fault) @ 0 (0) ---

I tested two later Webkitgtk and it turns out that it does not necessarily have to be a bug in the dwb adblock.

The same versions glib2, libsoup, dwb, gcc, binutils.
WebKitGTK+ 1.11.2                                              crash
WebKitGTK+ r138591 (2012-12-31)                     works fine

Last edited by grapeli23 (2013-01-02 16:05:42)

Offline

#1378 2013-01-02 22:17:24

JohnWittle
Member
Registered: 2010-03-06
Posts: 8

Re: dwb - a webkit web browser

Hey, using DWB right now. Oh my god, I like having letters instead of numbers for hint following. It makes me actually use it instead of just using my mouse in vimperator/pentadactyl.

Offline

#1379 2013-01-03 05:15:39

onny
Member
From: Europe
Registered: 2010-08-07
Posts: 39
Website

Re: dwb - a webkit web browser

grapeli23 wrote:

I tested two later Webkitgtk and it turns out that it does not necessarily have to be a bug in the dwb adblock.

The same versions glib2, libsoup, dwb, gcc, binutils.
WebKitGTK+ 1.11.2                                              crash
WebKitGTK+ r138591 (2012-12-31)                     works fine

Could you please create a webkitgtk2/3-svn AUR package or something like this? I'm unable to build it myself (fails every time with different errors).

Offline

#1380 2013-01-03 07:59:39

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: dwb - a webkit web browser

grapeli23 wrote:

WebKitGTK+ 1.11.2                                              crash
WebKitGTK+ r138591 (2012-12-31)                     works fine

You do realize that 1.11.2 isn't a stable release of webkit?

Offline

#1381 2013-01-03 09:26:48

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

Re: dwb - a webkit web browser

onny wrote:

Could you please create a webkitgtk2/3-svn AUR package or something like this? I'm unable to build it myself (fails every time with different errors).

Have you tried to build it with -j1? Webkit fails to build in most cases when build with more than one job.

Offline

#1382 2013-01-04 00:40:36

grapeli23
Member
Registered: 2009-08-19
Posts: 13

Re: dwb - a webkit web browser

Mystery solved. Today I updated libjpeg.
Finally I can open links to graphics in jpeg format. Wow.
It works with all versions of webkit smile

EDIT:
Mistake. Old config 'adblocker=false' wink

Last edited by grapeli23 (2013-01-04 12:59:17)

Offline

#1383 2013-01-10 05:27:52

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: dwb - a webkit web browser

I was trying to find information about aes-ni, which lead me to the intel site.  It seems to freeze dwb completely.  I first tried with the dwb from the repos, then with the dwb-hg from the AUR.  Also, I tried with adbock_subscription on and off (its the only extension I have enabled).

Can anyone else reproduce this?  This is the page I was trying to go to:
http://www.intel.com/content/www/us/en/ … ology.html

Offline

#1384 2013-01-10 09:03:44

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

Re: dwb - a webkit web browser

WonderWoofy wrote:

Can anyone else reproduce this?  This is the page I was trying to go to:
http://www.intel.com/content/www/us/en/ … ology.html

I can confirn that too.


  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#1385 2013-01-10 10:04:26

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

Re: dwb - a webkit web browser

I can also reproduce it but i can also reproduce in in every other webkitgtk browser.

Offline

#1386 2013-01-10 15:07:02

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: dwb - a webkit web browser

Okay, thanks portix... I used to have a bunch of webkitgtk browsers on my machine, but have since removed all but dwb.  'Twas just curious, and wanted to make sure you were aware of it.

Offline

#1387 2013-01-10 17:02:33

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: dwb - a webkit web browser

WonderWoofy wrote:

I was trying to find information about aes-ni, which lead me to the intel site.  It seems to freeze dwb completely.  I first tried with the dwb from the repos, then with the dwb-hg from the AUR.  Also, I tried with adbock_subscription on and off (its the only extension I have enabled).

Can anyone else reproduce this?  This is the page I was trying to go to:
http://www.intel.com/content/www/us/en/ … ology.html

It's fine here, javascript disabled (enabled doesn't do any harm) and external domains blocked.

Last edited by Army (2013-01-10 17:04:42)

Offline

#1388 2013-01-15 23:53:02

sco#
Member
Registered: 2008-12-20
Posts: 21

Re: dwb - a webkit web browser

shuuichi_nitori wrote:

Hi, dwb is wonderful, I'm using it on my awesomeWM right now, but I have a little question.
sometimes dwb gets very slow when I have more than 4-5 tabs open, gets slow when I load big images (>2600px), and a quite slow viewing videos on youtube. someone knows what is happening?

I have the same problem. Here's console output right before freeze:

[mtree0@mtree ~]$ dwb
java version "1.7.0_09-icedtea"
OpenJDK Runtime Environment (fedora-2.3.3.2.fc18-i386)
OpenJDK Client VM (build 23.2-b09, mixed mode)

(dwb:3035): GLib-GObject-WARNING **: invalid unclassed pointer in cast to `GtkLabel'

(dwb:3035): Gtk-CRITICAL **: gtk_label_set_markup: assertion `GTK_IS_LABEL (label)' failed

(dwb:3035): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkLabel'

(dwb:3035): Gtk-CRITICAL **: gtk_label_set_markup: assertion `GTK_IS_LABEL (label)' failed

(dwb:3035): Gdk-ERROR **: The program 'dwb' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
  (Details: serial 181765 error_code 9 request_code 62 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
Trace/breakpoint trap (core dumped)

Offline

#1389 2013-01-26 22:16:42

gothmog123
Member
Registered: 2012-10-31
Posts: 75

Re: dwb - a webkit web browser

Just wondering, is the youtube flash to mplayer replacer script in archwiki supposed to be working?

Offline

#1390 2013-01-27 14:50:08

xtremyst
Member
Registered: 2011-11-21
Posts: 14

Re: dwb - a webkit web browser

hi there, i'm using dwb the last few days and it look awesome, well done mate!!
one question though, i'm using formfiller, when i run efg i manage to save the data i need
but everytime i run eff i get "no formdata found" message, what am i missing?
let me know what other info you might need

Offline

#1391 2013-01-27 15:24:28

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

Re: dwb - a webkit web browser

@xtremyst: Are you using gpg-encrypted files or have you switched from a gpg-encrypted file to a non-encrypted file?
@gothmod123: It works here but on irc someone mentioned that it does not work with some locales.

Offline

#1392 2013-01-27 15:53:03

xtremyst
Member
Registered: 2011-11-21
Posts: 14

Re: dwb - a webkit web browser

Edit: My bad, i didnt understand your question right... i deleted the content of the /data/forms file,  re-enabled gpg-encryption and saved e new form, still getting the same error message..
as you can understand, i dont have any previous gpg experience
my formfiller.js

#!javascript
extensions.load("formfiller", {
   formData  : "~/.config/data/forms",
   scGetForm : "efg",
   scFillForm : "eff",
   useGPG    : false
});

Last edited by xtremyst (2013-01-27 16:48:52)

Offline

#1393 2013-01-27 16:23:59

gothmog123
Member
Registered: 2012-10-31
Posts: 75

Re: dwb - a webkit web browser

thanks for the reply.

nothing happens for me with the mplayer script. same old click to flash frame appears. I'm using the default US locale.

So I'm just using

#!/bin/bash
# dwb:Mod4 u

mplayer $(youtube-viewer $DWB_URI)

This works but it would be cool if the replacement script worked for me.

Offline

#1394 2013-01-28 09:11:24

rg_arc
Member
From: Hattiesburg
Registered: 2011-03-20
Posts: 490
Website

Re: dwb - a webkit web browser

First of all... amazing web browser and I love using it everyday.

Also, for some reason when visit specific web pages... such as twitter... an upper case letter will show and the rest of the word will be completely hidden. When I log out of Twitter, I will just see a "Y" and the rest of the word is gone. Has anyone else had this problem?

Last edited by rg_arc (2013-01-28 09:15:21)

Offline

#1395 2013-01-28 09:21:49

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

Re: dwb - a webkit web browser

xtremyst wrote:

Edit: My bad, i didnt understand your question right... i deleted the content of the /data/forms file,  re-enabled gpg-encryption and saved e new form, still getting the same error message..
as you can understand, i dont have any previous gpg experience
my formfiller.js

#!javascript
extensions.load("formfiller", {
   formData  : "~/.config/data/forms",
   scGetForm : "efg",
   scFillForm : "eff",
   useGPG    : false
});

That seems to be ok, i have no idea and cannot reproduce it.

Offline

#1396 2013-01-28 09:40:06

xtremyst
Member
Registered: 2011-11-21
Posts: 14

Re: dwb - a webkit web browser

is it possible that the problem is in the /usr/share/dwb/extensions/formfiller config file?
Anyway thanks a lot for your replies, i'll try to see if there's anything else i'm missing asnd i hope i'll figure it out.

Offline

#1397 2013-01-28 09:41:47

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

Re: dwb - a webkit web browser

That's not a config file, that is the extension. Are you using dwb from the repos or dwb-hg from AUR?

Offline

#1398 2013-01-28 10:01:58

onny
Member
From: Europe
Registered: 2010-08-07
Posts: 39
Website

Re: dwb - a webkit web browser

rg_arc wrote:

First of all... amazing web browser and I love using it everyday.

Also, for some reason when visit specific web pages... such as twitter... an upper case letter will show and the rest of the word will be completely hidden. When I log out of Twitter, I will just see a "Y" and the rest of the word is gone. Has anyone else had this problem?

Since this is webkit-related, you can still try a newer version of webkitgtk, for example by compiling webkitgtk2-svn from AUR.

Offline

#1399 2013-01-28 12:46:19

xtremyst
Member
Registered: 2011-11-21
Posts: 14

Re: dwb - a webkit web browser

i installed from the community repo... i edited the extension file at some point (the default config right above the /*INFO*/ part), here's what i got now

PS: in formfiller.js the "useGPG" is now st to true... still cant autofill a form

//
//  Copyright (c) 2012 Stefan Bolte <portix@gmx.net>
//
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 3 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License along
//  with this program; if not, write to the Free Software Foundation, Inc.,
//  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
//

/*
 *Fill forms automatically
 *
 * Extension that saves form data and  fills forms with previously saved data
 *
 * To use this extension  load it with a userscript in 
 * $HOME/.config/dwb/userscripts/, e.g. 
 *
 * ------------------------------------------------------------------------------
 * |#!javascript                                                                | 
 * |                                                                            | 
 * |extensions.load("formfiller");                                              | 
 * ------------------------------------------------------------------------------
 *
 *
 * Configuration options:
 *
 * formData       : A path to a file where formdata will be saved, the default
 *                  path is $XDG_CONFIG_HOME/dwb/forms
 *
 * scGetForm      : Shortcut that gets and saves form data, the default value is
 *                  'efg'
 *
 * scFillForm     : Shortcut that fills a form, the default value is 'eff'
 *
 * useGPG         : Whether to use gpg2 to encrypt the formData file with a
 *                  password.
 *
 * GPGOptEncrypt : Additional options that will be passed to gpg2 for
 *                 encryption, the default gpg2 options are:
 *                 --passphrase <password> --batch --no-tty --yes -c --output <formData>
 *                 default value: ""
 *
 * GPGOptDecrypt : Additional options that will be passed to gpg2 for
 *                 decryption, the default gpg2 options are 
 *                 --passphrase <password> --batch --no-tty --yes -d <formData>
 *                 default value: ""
 *
 * keepPassword  : Whether to save the gpg password in memory, if set to false the
 *                 user will be prompted for the password every time a form
 *                 is filled or new data is saved, default value: true
 *
 * keepFormdata  : If useGPG is enabled and this value is set to true the
 *                 complete formdata will be kept in memory, if set to false
 *                 gpg2 will be called every time a form is filled, default
 *                 value: false. 
 *
 *
 * Example (loading config with extensions.load()) 
 *
 * ------------------------------------------------------------------------------
 * |extensions.load("formfiller", {                                             |
 * |    formData  : system.getEnv("HOME") + "/data/forms",                      |
 * |    scGetForm : "Control f",                                                |
 * |    useGPG    : true                                                        |
 * |});                                                                         |
 * ------------------------------------------------------------------------------
 *
 * Example extensionrc:
 *
 * ------------------------------------------------------------------------------
 * |return {                                                                    |
 * |   foo : { ... },                                                           |
 * |                                                                            |
 * |   formfiller : {                                                           |
 * |      scGetForm : "efg",                                                    |
 * |      scFillForm : "eff",                                                   |
 * |      formData : "/path/to/data"                                            |
 * |   },                                                                       |
 * |   bar : { ... }                                                            |
 * |}                                                                           |
 * ------------------------------------------------------------------------------
 *
 * */

/*<INFO
Save form data and fill forms with previously saved data, also with gpg-support
INFO>*/

var me = "formfiller";
var defaultConfig = {
//<DEFAULT_CONFIG
  // shortcut that gets and saves formdata
  scGetForm : "efg",

  // shortcut that fills a form
  scFillForm : "eff",

  // path to the formdata file
  formData : "~/.config/data/forms",

  // whether to use a gpg-encrypted file
  useGPG : true,

  // additional arguments passed to gpg2 when encrypting the formdata
  GPGOptEncrypt : "",

  // additional arguments passed to gpg2 when decrypting the formdata
  GPGOptDecrypt : "",

  // whether to save the password in memory when gpg is used
  keepPassword : true,
  
  // whether to save the whole formdata in memory when gpg is used
  keepFormdata : false

//>DEFAULT_CONFIG
};
var config = {};
var passWord = null;
var formData = null;

var injectGetForm = function () {//{{{
  var ret = null;
  var forms = document.forms;

  function objectifyForm(f) {
    var query = "descendant::input[not(@type='hidden') and (@type='text' or @type='password' or @type='checkbox' or not(@type) or @type='email')]";
    var input, data;
    var r = document.evaluate(query, f, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
    var o = {};
    o.id = f.id || null;
    o.form = {};
    var hasValue = false;
    var hasIds = true;

    while ((input = r.iterateNext()) !== null) {
      if (input.value && !(/^\s*$/.test(input.value))) {
        if (/^\**$/.test(input.value) )
          return null;
        if (!input.type || input.type.toLowerCase() === "text" || input.type.toLowerCase() === "password") 
          hasValue = true;
        data = {};
        if (input.id) 
          data.id = input.id;
        else 
          hasIds = false;
        data.value = input.value;
        o.form[input.name] = data;
      }
    }
    if (hasValue) {
      var ret = {};
      o.hasIds = hasIds;
      ret[window.location.host] = o;
      return ret;
    }
    return null;
  }

  for (var i=0; i<forms.length; i++) {
    if ((ret = objectifyForm(forms[i])) !== null) {
      return ret;
    }
  }
  return ret;
};//}}}

var injectFillForm = function () {//{{{
  var key, i, forms, form = null, input;
  var data = arguments[0];

  function fillInput(input, key) {
    var value = data.form[key].value;
    if(input.type=="checkbox" || input.type=="radio") 
      input.checked=(value.toLowerCase() !== "false" && value !== "0");
    else {
      input.value = value;
    }
  }
  function setValues(form) {
    var input, value;
    for (key in data.form) {
      if (!form[key])
        return null;
    }
    for (key in data.form) {
      fillInput(form[key], key);
    }
    return form;
  }

  function fillElementsById() {
    var input;
    for (key in data.form) {
      input = document.getElementById(data.form[key].id);
      if (input === null || input === undefined) {
        return null;
      }
      fillInput(input, key);
    }
    return input.form || null;
  }

  function fillFormById() {
    var form = document.getElementById(data.id);
    if (form === null) 
      return null;
    return setValues(form);
  }
  if (data.hasIds) {
    form = fillElementsById();
  }
  if (form === null && data.id !== undefined && data.id !== null) {
      form = fillFormById();
  }
  if (form === null) {
    forms = document.forms;
    for (i=0; i<forms.length && form === null; i++) {
      form = setValues(forms[i]);
    }
  }
  if (form !== null && data.autosubmit) {
    var buttons = form.querySelectorAll("[type='submit']");
    for (i=0; i<buttons.length; i++) {
      var e = buttons[i];
      var mouseEvent = e.ownerDocument.createEvent("MouseEvent");
      mouseEvent.initMouseEvent("click", false, true,
        e.ownerDocument.defaultView, 0, 0, 0, 0, 0, false, false, false, false,
        0, null);
      e.dispatchEvent(mouseEvent);
    }
    form.submit();
  }
  return form !== null;
};//}}}

function getFormData(callback) {//{{{
  var stat, ret;
  if (config.useGPG) {
    if (formData !== null) {
      return formData;
    }
    getPassWord();
    stat = system.spawnSync("gpg2 " + config.GPGOptDecrypt + " --passphrase " + passWord + " --batch --no-tty --yes -d " + config.formData);
    if (stat.status == 512) {
      io.error("Wrong password");
      passWord = null;
      return null;
    }
    try {
      ret = JSON.parse(stat.stdout.replace(/\\"/g, '"'));
      if (config.keepFormdata) {
        formData = ret;
      }
      return ret;
    }
    catch(e) {
      io.debug(e);
      io.error("Getting form data failed : " + e.message);
    }
  }
  else {
    try {
      return JSON.parse(io.read(config.formData));
    }
    catch(e) {
      io.debug(e);
      io.error("Getting form data failed : " + e.message);
    }
  }
  return null;
}//}}}

function getPassWord() {//{{{
  if (passWord === null) {
    passWord = io.prompt("Password :", false);
  }
}//}}}

function writeFormData(object) {//{{{
  var written = true, ret;
  if (config.useGPG) {
    getPassWord();
    if (passWord === null) 
      return false;

    ret = system.spawnSync("sh -c \"echo '" + JSON.stringify(object).replace(/"/g, "\\\"") + 
        "' | gpg2 " + config.GPGOptEncrypt + " --passphrase " + passWord + " --batch --no-tty --yes -c --output " + config.formData + "\"");
    if (ret.status == 512) {
      io.error("Wrong password");
      password = null;
      return false;
    }
    written = ret.status === 0;
  }
  else {
    written = io.write(config.formData, "w", JSON.stringify(object, null, 2));
  }
  return written;
}//}}}

function saveForm(form) {//{{{
  var key, object, data, written = false;
  var autosubmit = io.prompt("Autosubmit (y/n)?").toLowerCase() == "y" ? true : false;
  var saved = false;
  if (! system.fileTest(config.formData, FileTest.regular | FileTest.symlink)) {
    object = JSON.parse(form);
    for (key in object) 
      break;
    object[key].autosubmit = autosubmit;
    written = writeFormData(object);
  }
  else {
    object = JSON.parse(form);
    data = getFormData();
    if (data) {
      for (key in object) 
        break;
      data[key] = object[key];
      data[key].autosubmit = autosubmit;
    }
    else if (data === null) {
      return false;
    }
    else {
      data = object;
    }
    written = writeFormData(data);
  }
  return written;
}//}}}

function getForm() {//{{{
  var frames = tabs.current.allFrames;
  var form, i, formFound = false;
  for (i=0; i<frames.length; i++) {
    form = frames[i].inject(util.getBody(injectGetForm));
    if (form != "null") {
      if (saveForm(form)) {
        io.notify("Form saved");
      }
      else {
        io.notify("An error occured saving formdata");
      }
      formFound = true;
      break;
    }
  }
  if (!config.keepPassword)
    passWord = null;
  if (!formFound) 
    io.error("No storable form found");
}//}}}
function getHasForms(frames) {//{{{
  var i;
  for (i=0; i<frames.length; i++) {
    if (frames[i].inject("return document.forms.length > 0;") == "true") 
      return true;
  }
  return false;
}//}}}

function fillForm() {//{{{
  var data, frames, host, i, ret = false;
  if (! system.fileTest(config.formData, FileTest.regular | FileTest.symlink)) {
    io.error("No formdata found");
    return;
  }
  frames = tabs.current.allFrames;
  if (!getHasForms(frames)) {
    io.error("No form found");
    return;
  }
  data = getFormData(); 
  
  if (data === null)
    return;
  for (i=0; i<frames.length; i++) {
    host = frames[i].host;
    if (data[host]) {
      frames[i].inject(util.getBody(injectFillForm), data[host]);
    }
  }
  if (!config.keepPassword) {
    passWord = null;
  }
  io.notify("Executed formfiller");
}//}}}

// init {{{
return {
  init : function (c) {
    config = extensions.getConfig(c, defaultConfig);
    bind(config.scGetForm, getForm, "formfillerGet");
    bind(config.scFillForm, fillForm, "formfillerFill");
    return true;
  }, 
  end : function () {
    unbind("formfillerGet");
    unbind("formfillerFill");
    return true;
  }
}//}}}
// vim: set ft=javascript:

Last edited by xtremyst (2013-01-28 13:03:49)

Offline

#1400 2013-01-28 13:07:59

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

Re: dwb - a webkit web browser

You shouldn't really edit this file, if you want to edit it you should copy it to ~/.local/share/dwb/extensions/, but the default options are ignored if you set them in your script anyway. My suggestion is, reinstall dwb, delete the file that loads the extension and then enable the extension with

dwbem -i formfiller

Offline

Board footer

Powered by FluxBB