You are not logged in.

#551 2012-01-19 10:21:32

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

Re: dwb - a webkit web browser

portix wrote:
bloom wrote:

What could be missing?

I don't know what's missing, these filehosting services do anything to prevent downloading files outside a browser. I added a new variable dwb_referer, i don't know if this helps but you can use it for wgets --referer command line option.

So the new script is:

#! /bin/dash

url=$1
output=$2
cookies=$3
referer=$4
all_cookies=$(mktemp --tmpdir cookies.XXX)
sed 's/^#[^_]\+_//' "$cookies" > "$all_cookies"
USER_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ dwb/0.0.18"

wget -a ~/.logfoo -O "$output" --load-cookies "$all_cookies" --referer "$referer" --user-agent "$USER_AGENT" "$url"

The referer option have an effect:

HTTP request sent, awaiting response... 302 Moved Temporarily
Location: /not-allowed.php?linkId=4654251735 [following]

And foo.tgz content is:

<html>
<body>
You can not access this page directly. Please use the <a href="http://www.filesonic.com/file/4654251735">website to start your download</a> or <a href="http://www.filesonic.com/contact-us">contact us</a> in case of problem.
<p>If the problem persists, clear your cookies and try again.</p>
</body>
</html>

Last edited by bloom (2012-01-19 11:16:12)


gh · da · ds

Offline

#552 2012-01-19 10:24:06

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

Re: dwb - a webkit web browser

portix wrote:

I thought about removing also show_keys and show_settings, they can be bound to
a quickmark anyway but i will add reload_userscripts when i have time for it.

Agreed.


gh · da · ds

Offline

#553 2012-01-19 10:43:55

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

Re: dwb - a webkit web browser

portix wrote:

You now have to confirm a change with return, i'm not completely sure if i stick with it.

I think 'return' has the connotation of submitting a whole form, hence users might be reluctant to use it.
I was ok with the previous behavior except for the 'being thrown out of Insert mode' part.
And since checkboxes are saved on the fly it might give the impression of an heterogeneous behavior.


gh · da · ds

Offline

#554 2012-01-19 10:58:16

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

Re: dwb - a webkit web browser

Regarding the built-in download widget:

— Could the start and end gradient color be configurable?

— It seems the download progression (downloaded size / remaining size) is expressed in megabytes but maybe you could use the correct unit (i.e. by dividing by 1024 as much as needed and append B, K, M or G accordingly) and keep only one decimal?

— You might want to format the progress informations as '(%s, %s, %s, ...)' instead of '[%s] [%s] [%s] ...'.


gh · da · ds

Offline

#555 2012-01-19 16:35:38

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

Re: dwb - a webkit web browser

If my current dwb instance has at least two opened tabs and if I run the following script:

#! /bin/dash
# dwb: ,,

echo '12'

In the current tab and then close the tab, dwb crashes.

Its last words are:

Received SIGSEGV, trying to clean up.

Maybe there could be an option to disable the interpretation of the userscript's stdout and use a fifo instead?


gh · da · ds

Offline

#556 2012-01-19 17:02:13

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

Re: dwb - a webkit web browser

bloom wrote:

If my current dwb instance has at least two opened tabs and if I run the following script:

#! /bin/dash
# dwb: ,,

echo '12'

In the current tab and then close the tab, dwb crashes.

Its last words are:

Received SIGSEGV, trying to clean up.

Maybe there could be an option to disable the interpretation of the userscript's stdout and use a fifo instead?

This has nothing to with stdout, this was simply a bug, i fixed it in tip.

Offline

#557 2012-01-19 18:06:43

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

Re: dwb - a webkit web browser

portix wrote:

This has nothing to with stdout, this was simply a bug, I fixed it in tip.

Yes, sorry, it was just equivalent to <invalid-tab-num>close_tab.
Maybe you could throw an error message like you do with <invalid-tab-num>focus_tab (“No such tab”)?

The problem with the current stdout mechanism is that, every command which might produce output that is not intended to be sent to dwb has to be redirected to /dev/null.


gh · da · ds

Offline

#558 2012-01-19 19:03:19

irtigor
Member
Registered: 2011-01-21
Posts: 44

Re: dwb - a webkit web browser

portix wrote:

It does if you don't use an editor that doesn't detach from the parent process like gvim or any terminal editor together with urxvtc.
This might be improved by also allowing to use gvim or urxvtc.

Oh, that's the case (urxvtc -name weditor -e vim dwb_uri), and I would like to see this improvement implemented, since my goal here is to open a text editor in the same view ("workspace" in subtle's terminology ) that dwb but only when my intention is to edit a text comming from a web browser, so I use "-name" to change the WM_CLASS.

Offline

#559 2012-01-19 19:12:59

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

Re: dwb - a webkit web browser

bloom wrote:
portix wrote:

This has nothing to with stdout, this was simply a bug, I fixed it in tip.

Yes, sorry, it was just equivalent to <invalid-tab-num>close_tab.
Maybe you could throw an error message like you do with <invalid-tab-num>focus_tab (“No such tab”)?

The problem with the current stdout mechanism is that, every command which might produce output that is not intended to be sent to dwb has to be redirected to /dev/null.

If it is a shell script you can easily close stdout and reopen it when needed, something like this

#!/bin/sh

CLOSE_STDOUT="eval exec 3>&1 >/dev/null"
OPEN_STDOUT="eval exec 1>&3 3>&-"

${CLOSE_STDOUT}
echo "Not parsed"
${OPEN_STDOUT}
echo "Parsed by dwb"

Offline

#560 2012-01-19 19:23:16

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

Re: dwb - a webkit web browser

@irtigor

Just replace urxvtc with urxvt in your quoted command-line, untill it possibly gets fixed later... That's what I do...

Offline

#561 2012-01-19 19:29:16

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

Re: dwb - a webkit web browser

irtigor wrote:
portix wrote:

It does if you don't use an editor that doesn't detach from the parent process like gvim or any terminal editor together with urxvtc.
This might be improved by also allowing to use gvim or urxvtc.

Oh, that's the case (urxvtc -name weditor -e vim dwb_uri), and I would like to see this improvement implemented, since my goal here is to open a text editor in the same view ("workspace" in subtle's terminology ) that dwb but only when my intention is to edit a text comming from a web browser, so I use "-name" to change the WM_CLASS.

In the meantime, you could just replace 'urxvtc' by 'urxvt' in your command.


gh · da · ds

Offline

#562 2012-01-19 20:15:36

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

Re: dwb - a webkit web browser

portix wrote:

If it is a shell script you can easily close stdout and reopen it when needed, something like this

Ok, thanks.
I've noticed there's a working fifo in dwb's configuration directory: could you add an option to disable stdout interpretation for those who whish to use that fifo instead?

Last edited by bloom (2012-01-20 09:54:26)


gh · da · ds

Offline

#563 2012-01-19 22:19:36

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

Re: dwb - a webkit web browser

bloom wrote:
portix wrote:

If it is a shell script you can easily close stdout and reopen it when needed, something like this

Ok, thanks.
I've noticed there's a working fifo in dwb's configuration directory: could you add an option to disable stdout interpretation for those who which to use that fifo instead?

This fifo is only for the single instance option, i wanted to avoid using dbus. I will not add an option for using a fifo but make this configurable in the script in the 'dwb:' line. I already implemented the option

dwb:usefifo:<shortcut>

when this option is set the environment variable DWB_FIFO is available and commands can be sent to that fifo. But i pushed this only in the experimental branch. In the experimental branch there are no arguments for scripts anymore, only the environment variables DWB_URI, DWB_TITLE, DWB_PROFILE, DWB_NUMMOD and DWB_ARGUMENT are set (they are set in the default branch too).

Offline

#564 2012-01-20 10:01:08

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

Re: dwb - a webkit web browser

portix wrote:
dwb:usefifo:<shortcut>

when this option is set the environment variable DWB_FIFO is available and commands can be sent to that fifo. But i pushed this only in the experimental branch. In the experimental branch there are no arguments for scripts anymore, only the environment variables DWB_URI, DWB_TITLE, DWB_PROFILE, DWB_NUMMOD and DWB_ARGUMENT are set (they are set in the default branch too).

Sounds great.
But it will be also important to disable the stdout interpretation when the usefifo option is set.


gh · da · ds

Offline

#565 2012-01-20 15:47:11

milso
Member
Registered: 2010-11-16
Posts: 112
Website

Re: dwb - a webkit web browser

Anybody have the mouse.js script with autoscrolling? Thanks ahead of time.

Also great browser portix, really love the menus for settings, bookmarks, etc. Thanks.

Offline

#566 2012-01-20 16:14:32

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

Re: dwb - a webkit web browser

milso wrote:

Anybody have the mouse.js script with autoscrolling?

I had to fight a bit with the butbucket web interface, but I got it. Here you go: https://bitbucket.org/portix/dwb/raw/54 … s/mouse.js

Offline

#567 2012-01-20 16:32:10

milso
Member
Registered: 2010-11-16
Posts: 112
Website

Re: dwb - a webkit web browser

I hate to say it but I seem to have found one that I find a bit more fluid and nicer looking. The script url can be found in the code below but I'm not sure how to get it to load automatically. Putting it with my other scripts does not do so, only typing in the code below into the url bar does.

javascript:void((function(){var $A=document.createElement('script');$A.setAttribute('src','http://pornel.net/autoscroll.js');document.documentElement.appendChild($A);})())

Any ideas?

Offline

#568 2012-01-20 16:45:06

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

Re: dwb - a webkit web browser

milso wrote:

I hate to say it but I seem to have found one that I find a bit more fluid and nicer looking. The script url can be found in the code below but I'm not sure how to get it to load automatically. Putting it with my other scripts does not do so, only typing in the code below into the url bar does.

javascript:void((function(){var $A=document.createElement('script');$A.setAttribute('src','http://pornel.net/autoscroll.js');document.documentElement.appendChild($A);})())

Any ideas?

JS scripts must go in '$XDG_CONFIG_HOME/dwb/scripts/'.


gh · da · ds

Offline

#569 2012-01-20 17:06:43

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

Re: dwb - a webkit web browser

It seems the current hinting script fails on this page:

milso


gh · da · ds

Offline

#570 2012-01-20 17:08:31

milso
Member
Registered: 2010-11-16
Posts: 112
Website

Re: dwb - a webkit web browser

JS scripts must go in '$XDG_CONFIG_HOME/dwb/scripts/'.

I've tried putting the autoscroll.js as well as creating a file called mouse.js containing the code I pasted above into the appropriate directory. Neither of them seem to work on autoloading.

It seems the current hinting script fails on this page: milso

That's a bit strange, I'll look into it later today.

Last edited by milso (2012-01-20 17:13:26)

Offline

#571 2012-01-20 17:12:44

jakob
Member
From: Berlin
Registered: 2005-10-27
Posts: 419

Re: dwb - a webkit web browser

milso wrote:

Anybody have the mouse.js script with autoscrolling? Thanks ahead of time.

What does the mous.js script do and what is meant by autoscrolling?

Last edited by jakob (2012-01-20 17:12:55)

Offline

#572 2012-01-20 17:15:13

milso
Member
Registered: 2010-11-16
Posts: 112
Website

Re: dwb - a webkit web browser

jakob wrote:
milso wrote:

Anybody have the mouse.js script with autoscrolling? Thanks ahead of time.

What does the mous.js script do and what is meant by autoscrolling?

The mouse.js script allows autoscrolling as well as mouse gestures. Autoscrolling is a function where you enable it, usually by middle mouse click, then move the cursor in a direction to scroll the page automatically.

Offline

#573 2012-01-20 18:02:02

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

Re: dwb - a webkit web browser

milso wrote:

JS scripts must go in '$XDG_CONFIG_HOME/dwb/scripts/'.

I've tried putting the autoscroll.js as well as creating a file called mouse.js containing the code I pasted above into the appropriate directory. Neither of them seem to work on autoloading.

It seems the current hinting script fails on this page: milso

That's a bit strange, I'll look into it later today.

Scripts are loaded when the load is committed, therefore some scripts must be put into a function that is loaded on the windows onload event, this might work:

(window.addEventListener("load", function(){
  var $A=document.createElement('script');
  $A.setAttribute('src','http://pornel.net/autoscroll.js');
  document.documentElement.appendChild($A);
}, false))();

The hints don't work on that site because the whole site is in an iframe and hints don't work in iframes.

Edit: Since most scripts require to be injected when the page is fully loaded i might change the moment the script is injected.

Last edited by portix (2012-01-20 18:07:21)

Offline

#574 2012-01-20 18:43:25

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

Re: dwb - a webkit web browser

bloom wrote:

Sounds great.
But it will be also important to disable the stdout interpretation when the usefifo option is set.

Of course stdout is not used when the fifo-option is set.

Offline

#575 2012-01-21 10:36:59

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

Re: dwb - a webkit web browser

portix wrote:
bloom wrote:

It seems the current hinting script fails on this page: milso

The hints don't work on that site because the whole site is in an iframe and hints don't work in iframes.

It works with luakit: maybe there's some code to borrow from its hinting script?


gh · da · ds

Offline

Board footer

Powered by FluxBB