You are not logged in.
This extension uses chromiums javascript api, there is no equivalent for dwb and
it's not possible to modify the PREF cookie value, however you can achieve the
same result without modifying the cookie, just put the following script into
~/.config/dwb/userscripts/
#!javascript
signals.connect("navigation", function(wv, frame, request) {
if (frame == wv.mainFrame && !(/&html5=True/).test(request.uri) &&
util.domainFromHost(request.message.uri.host) == "youtube.com")
{
wv.loadUri(request.uri + "&html5=True");
return true;
}
});
You only must take care that the file starts with #!javascript, there must not
be whitespaces before the shebang.
Offline
Hi, did something change with the scripts support? I have this file
% cat .config/dwb/userscripts/handler.js
#!javascript
signals.connect("navigation", function(wv, frame, request) {
if (/^magnet:.*/|.*\.torrent$/.test(request.uri)) {
system.spawn("transmission-remote -a " + request.uri);
return true;
}
if (/^mailto:.*/.test(request.uri)) {
system.spawn("urxvt -title mutt -e mutt " + request.uri);
return true;
}
if (/^ftp/.test(request.uri)) {
system.spawn("urxvt -e ncftp " + request.uri);
return true;
}
});
which used to work, but doesn't work anymore, dwb tries to open those urls, which of course fails.
Offline
Are you sure that this script ever worked? There is syntax error in line 2. Btw. there is an extension contenthandler which runs commands based on uri-scheme mimetype or filename-extension, you can install it with
dwbem -i contenthandler
Edit: The error is in your first regular expression, you could change it to
if (/^magnet:.*|.*\.torrent$/.test(request.uri)) {
Last edited by portix (2012-09-11 20:28:19)
Offline
Oh right, yes that error shouldn't be there, this happened while I tried to "fix" it
I've already seen this extension, guess now it's time to use it.
And now I see what dwbem is
Offline
This extension uses chromiums javascript api, there is no equivalent for dwb and
it's not possible to modify the PREF cookie value, however you can achieve the
same result without modifying the cookie, just put the following script into
~/.config/dwb/userscripts/#!javascript signals.connect("navigation", function(wv, frame, request) { if (frame == wv.mainFrame && !(/&html5=True/).test(request.uri) && util.domainFromHost(request.message.uri.host) == "youtube.com") { wv.loadUri(request.uri + "&html5=True"); return true; } });
You only must take care that the file starts with #!javascript, there must not
be whitespaces before the shebang.
Cool, thanks. One more thing, if a website won't load and I have to kill dwb, who should I report this to? It is clearly a webkit problem, as I tried it with luakit and surf with the same results (mlb.com).
Offline
Can anybody help me replicate this:
few week ago I realized I could map my youtube video download funcitons I type everytime in rxvt into pentadactyl with a simple line in the config file.
now, when I am on a youtube video - pressing <A-y> will download automatically the vid. <A-m> will open the yt-stream directly into mplayer.
made me go "oooh nice" +1 pentadactyl.
Thanks.
Offline
You could use youtube-dl and some simple userscripts. A script for playing videos with mplayer:
#!/bin/bash
# dwb:Mod1 m
mplayer $(youtube-dl -g $DWB_URI)
A script for downloading videos:
#!/bin/bash
# dwb:Mod1 y
youtube-dl $DWB_URI
And a script that does both:
#!javascript
bind("Mod1 m", function () {
system.spawn("sh -c 'mplayer $(youtube-dl -g " + tabs.current.uri + ")'");
});
bind("Mod1 y", function () {
system.spawn("youtube-dl " + tabs.current.uri);
});
Offline
@portix
I have defined: 'cookies-accept-policy=always' and 'cookies-store-policy=persistent', but still I have to relogin to gmail and archforum every time I start dwb?
I have a 46k cookies file under '~/.config/dwb/default/cookies'...
Have there been some new config-option added or something that i've missed that needs enabling? Btw, i'm using dwb-hg.
Thanks in advance.
Offline
No, there is no new cookie-option. I can reproduce it on gmail but cannot reproduce it on other sites. The cookie is also saved on gmail. I don't know why it doesn't work on gmail anymore, but i'll create a ticket for this issue.
Offline
Hmm...
Thanks for the gmail ticket, but I just don't get why you don't get the same behaviour as me on the arch-forum?
I've just deleted my cookies file with dwb closed, and then started dwb and logging on to the arch-forum and selected "remember me" and closing dwb afterwards.
I then see a new cookies file generated, but it's completelly empty?
I redid the operation and still the same, and I had just did a dwb update before...
Please give a shout-out if you get to think about something "wrong" on my end, thanks!
CU, Martin.
Last edited by mhertz (2012-09-15 20:52:19)
Offline
Hmm...
Thanks for the gmail ticket, but I just don't get why you don't get the same behaviour as me on the arch-forum?
I've just deleted my cookies file with dwb closed, and then started dwb and logging on to the arch-forum and selected "remember me" and closing dwb afterwards.
I then see a new cookies file generated, but it's completelly empty?
I redid the operation and still the same, and I had just did a dwb update before...
Please give a shout-out if you get to think about something "wrong" on my end, thanks!
CU, Martin.
I think your issue is caused by the change of the sync-files setting. You could check if sync-files is set to a correct value. I could reproduce it if sync-files isn't set.
Offline
Ahh, you nailed it! Thank you so much, mate!
I'm embaressed about not having seen that option previously, and as you said, then it was unset on my end!
Btw, it now also works on gmail!
Again sorry, and many thanks!
Offline
Ahh, you nailed it! Thank you so much, mate!
I'm embaressed about not having seen that option previously, and as you said, then it was unset on my end!
Btw, it now also works on gmail!
Again sorry, and many thanks!
It wasn't a mistake on your end, sync-history previously was an integer setting, now it is a string setting and it isn't set to a default value if it's invalid, so it's a mistake on my end but i'll fix it soon.
Offline
You could use youtube-dl and some simple userscripts. A script for playing videos with mplayer:
Thank you.
I can also confirm cookies issue.
Offline
Offline
Also, I think I found a bug, but I'm not sure it's in dwb or dwm... it only happens when I use both together.
I use mozplugger to embed mupdf to display PDF files. Reparenting works fine, and I can use the mouse to scroll, but key events are not passed to the inner window.
However, mupdf in dwb works e.g. with cwm or fvwm.
But it doesn't appear to be a dwm bug solely, because mupdf works e.g. in tabbed or Firefox in dwm.
Unfortunately, I have no idea how to debug this.
How did you get mozplugger to work with dwb?
Edit: Nevermind, I figured it out.
Last edited by bslackr (2012-09-17 10:37:26)
Offline
hellomynameisphil wrote:Sorry if this has been asked before, but is there any way to hide the tab bar if there is only one tab open?
There isn't a native setting for it anymore, you can try it with the following script:
#!javascript signals.connect("closeTab", function () { if (tabs.length == 2) execute("set widget-packing Twds"); }); signals.connect("createTab", function () { if (tabs.length == 2) execute("set widget-packing twds"); });
Thanks. This was working really well until just recently. I copied the script to the userscripts directory and set it to executable (not sure whether that's necessary), but now I see the tabbar at all times.
Offline
Thanks. This was working really well until just recently. I copied the script to the userscripts directory and set it to executable (not sure whether that's necessary), but now I see the tabbar at all times.
Doesn't it work in general or only for the first tab? Here is an updated version that works with latest hg.
#!javascript
execute("set widget-packing Twds");
signals.connect("closeTab", function () {
if (tabs.length == 2)
execute("set widget-packing Twds");
});
signals.connect("createTab", function () {
if (tabs.length == 2)
execute("set widget-packing twds");
});
You should also update to the latest hg-version if you use this, otherwise you might get a segfault. Javascript-scripts don't need to be executable, only scripts in other languages must be executable.
Edit: i think i'll reintroduce an option to hide the tabbar if only one tab is open.
Last edited by portix (2012-09-17 16:52:56)
Offline
@hellomynameisphil: i created an option 'show-single-tab', with latest hg you don't need a userscript.
Offline
@hellomynameisphil: i created an option 'show-single-tab', with latest hg you don't need a userscript.
Oh, that was fast. I just copied your javascript in order to do the same.. gotta update!
Offline
portix wrote:@hellomynameisphil: i created an option 'show-single-tab', with latest hg you don't need a userscript.
Oh, that was fast. I just copied your javascript in order to do the same.. gotta update!
As I did. Updating as well.
Offline
I noticed that when Flash crashes, it takes down the whole browser... how difficult is it to run the plugins in seperate processes?
Offline
I noticed that when Flash crashes, it takes down the whole browser... how difficult is it to run the plugins in seperate processes?
I'm not a webkitgtk-developer, so for me it is impossible. You should address this to the webkitgtk bugtracker but i don't think that they are interested in separating flash in a new process. libwebkit3 doesn't even support flash because flash is linked against gtk2.
Offline
libwebkit3 doesn't even support flash because flash is linked against gtk2.
A bit OT: does it support pepper or what do I have to use to view flash content?
Offline
If you're on i686, then you can still use flash with the gtk3/webkit3 version: https://alderaan.archlinux.org/viewtopi … 2#p1012532
For x86-64 I dunno, sorry...
Offline