You are not logged in.
Maybe I'm just adding noise here: although I do see very high CPU usage with dwb in certain websites, it's hardly ever 100%. Besides, that tor link behaves OK for me here -- so you should probably just disregard my comment.
Hmm... weird. Guess it's a webkit thing and/or something on my end. I don't know enough about browsers to know where to begin looking for the culprit.
On an unrelated note, I've got a mimetypes question: for application/msword, I'd like to open .doc files by spawning urxvtc, feeding the .doc file to antiword, and then view the stdout with a pager like less. I tried the following, with no luck:
Spawn (application/msword): urxvtc -e antiword | less
I see a terminal pop up really fast and spew out some text and then close immediately, but that's it. Any tips?
Is there a variable like %f for the filename that I can feed to the command, e.g., urxvtc -e antiword %f | less?
Last edited by brianb (2012-07-25 23:47:21)
Offline
Do you have addressbar-dns-lookup enabled? You can first try to disable it, this setting isn't a good idea anyway so this will probably be removed in the future.
Did'nt have it enabled in the first place
"Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying "End-of-the-World Switch. PLEASE DO NOT TOUCH", the paint wouldn't even have time to dry."
Offline
On an unrelated note, I've got a mimetypes question: for application/msword, I'd like to open .doc files by spawning urxvtc, feeding the .doc file to antiword, and then view the stdout with a pager like less. I tried the following, with no luck:
Spawn (application/msword): urxvtc -e antiword | less
I see a terminal pop up really fast and spew out some text and then close immediately, but that's it. Any tips?
This was mentioned a couple of pages back. Don't use urxvtc; use urxvt instead.
Last edited by syngin (2012-07-26 05:56:44)
Offline
brianb wrote:On an unrelated note, I've got a mimetypes question: for application/msword, I'd like to open .doc files by spawning urxvtc, feeding the .doc file to antiword, and then view the stdout with a pager like less. I tried the following, with no luck:
Spawn (application/msword): urxvtc -e antiword | less
I see a terminal pop up really fast and spew out some text and then close immediately, but that's it. Any tips?
This was mentioned a couple of pages back. Don't use urxvtc; use urxvt instead.
The urxvtc thing was only for the editor, when dwb spawns an application it
simply appends the filename to your argument, urxvtc -e antiword | less will be
converted to
urxvtc -e antiword | less <filename>
of course this cannot work, but even
urxvtc -d antiword <filename> | less
wouldn't work, you cannot use pipes directly with urxvtc's -e option. instead
you have to wrap it with sh -c, so here is a wrapper script
#!/bin/bash
urxvtc -e sh -c "antiword $1 | less"
Btw. there is also a googledocs extension that can automatically load doc/docx/odt/... with google docs, it's located here.
Offline
Btw. there is also a googledocs extension that can automatically load doc/docx/odt/... with google docs, it's located here.
Ah, cool! I'm trying to get it working by using an extensionrc, but I'm failing. Here's what I have:
#!javascript
return {
googledocs : {
shortcut : "egd",
initiallyEnabled : false,
filetypes : [ "doc", "docx", "xls", "xlsx", "ppt", "pptx",
"odt", "ods", "pages", "ai", "psd", "tiff",
"dxf", "svg", "eps", "ps", "ttf", "otf", "xps",
"zip", "rar" ]
}
}
This is saved as ~/.config/dwb/extensionrc, and I have the googledocs extension saved in ~/.local/share/dwb/extensions/, but it doesn't seem to load.
Do I need to add something to my userscript/ folder? I don't quite understand the difference between loading an extension with a userscript and loading it with an extensionrc.
Offline
You also need to load it with a userscript, even if you have an extensionsrc, i already thought about completely removing the extensionsrc, it is only useful for sharing settings.
So you still must create a userscript either
#!javascript
extensions.load("googledocs");
or
#!javascript
extensions.load("googledocs", {
shortcut : "egd",
initiallyEnabled : false,
filetypes : [ "doc", "docx", "xls", "xlsx", "ppt", "pptx",
"odt", "ods", "pages", "ai", "psd", "tiff",
"dxf", "svg", "eps", "ps", "ttf", "otf", "xps",
"zip", "rar" ]
});
The reason why there are extensions at all is that extensions can also be loaded/unloaded from within dwb on the fly.
Offline
Gotcha. OK, works perfectly now.
The reason why there are extensions at all is that extensions can also be loaded/unloaded from within dwb on the fly.
Yeah, this is definitely a plus.
Offline
I've been using this as my primary browser for a while. It's by far the best vimperator-like browser.
Thanks for making it.
Offline
I've been using this as my primary browser for a while. It's by far the best vimperator-like browser.
Thanks for making it.
agree!
Offline
I've noticed huge memory usage when downloading big files. Right now I have only one tab opened while downloading 1.4GB file (1.3GB already downloaded) and dwb uses 1.6GB of RAM which still increases as the download is progressing. I'm using latest version from git.
Last edited by OK100 (2012-08-01 20:44:03)
Offline
dwb uses the builtin download mechanism of webkitgtk, i won't implement a different download mechanism, so you either have to use an external downloader or hope that webkitgtk reduces memory usage for downloads.
Offline
I'm really late to this thread, but just a suggestion for dwb: Swap out Webkit's JavascriptCore for v8: http://code.google.com/p/v8/ . Otherwise, great work!
Last edited by ignorant (2012-08-01 22:02:47)
Offline
I'm really late to this thread, but just a suggestion for dwb: Swap out Webkit's JavascriptCore for v8: http://code.google.com/p/v8/ . Otherwise, great work!
That is not possible, JavaScriptCore is part of webkitgtk. You would need a webkitgtk-build that uses v8. I read about a webkitgtk-fork about a year ago that used v8 but i'm not sure if this fork was ever usable.
Offline
Sometimes furthest right in the status bar I see what looks like [P] with a strike-through. What does that mean? I'm using the latest hg version. I wonder if it's the progress bar glitching out.
Thanks
PGP key: F40D2072
Key fingerprint: 8742 F753 5E7B 394A 1B04 8163 332C 9C40 F40D 2072
Offline
It means, that there are plugins required on the website you're on, but you didn't allow them for this site. Type 'ph' to allow them for the currenst host.
Offline
Sometimes I can't connect to facebook and I'm getting this error message:
Error parsing message: too many header bytes seen; overflow detected
I can open the page in other browsers.
Offline
I have created a script that replaces all videos on youtube with a html5 video, even if html5 isn't available. It creates a small bar where the quality can be chosen (also with hints).
Here is a screenshot
The script is as follows
#!javascript
// vim:set ft=javascript:
var config = {
togglePlay : "yp",
autoplay : true,
controls : true,
// possible qualities : 1080p, 720p, 480p, 360p, 240p
defaultQuality : "720p",
excludeQuality : [ ],
// possible formats : x-flv, webm, mp4, 3gpp
preferredFormat : "mp4",
excludeFormat : [ "webm" ],
foregroundActive : "#008000",
foregroundColor : "#fff",
backgroundColor : "#000",
linkColor : "#999",
backgroundDisabled : "#555",
foregroundDisabled : "#aaa",
separator : "1px solid #666",
font : "10px helvetica",
linkFont : "bold 10px helvetica",
playerHeight : "376px",
playerWidth : "640px"
};
function documentLoadedCallback(wv, frame) {
var i;
if (frame != wv.mainFrame)
return;
if (frame.domain != "youtube.com")
return;
var id = wv.uri.replace(/.*(\?v=|\/v\/)([^$&]+).*/, '$2');
if (id == wv.uri) {
return;
}
var el = [ "&el=embedded", "&el=detailpage", "&el=vevo" ];
var result = null;
for (i=0; i<3 && result === null; ++i) {
var url = "http://youtube.com/get_video_info?video_id=" + id + el[i];
var data = sendRequestSync(url);
if (data.status = 200 && data.body.substring(0, 11) != "status=fail")
result = data.body;
}
if (result === null) {
return;
}
var decoded = decodeURI(result);
i = decoded.indexOf("&url_encoded_fmt_stream_map=");
if (i == -1) {
return;
}
decoded = decodeURIComponent(decoded.substring(i));
var preUrls = decoded.split(/url=/);
var urls = [];
var q = {
"1080p" : [],
"720p" : [],
"480p" : [],
"360p" : [],
"240p" : []
};
for (i=0; i<preUrls.length; i++) {
var end = preUrls[i].search(/&type=/);
if (end > -1) {
var endString = preUrls[i].substring(end + 12); // &type=video/<format>
var format = endString.substring(0, endString.search(/[;&]/));
var itag = parseInt(preUrls[i].replace(/.*&itag=([0-9]+).*/, '$1'), 10);
if (config.excludeFormat.indexOf(format) != -1)
continue;
var o= { url : preUrls[i].substring(0, end), itag : itag, format : format };
switch (itag) {
case 38:
case 46:
case 37:
if (config.excludeQuality.indexOf("1080p") == -1)
q["1080p"].push(o);
break;
case 22:
case 45:
if (config.excludeQuality.indexOf("720p") == -1)
q["720p"].push(o);
break;
case 44:
case 35:
if (config.excludeQuality.indexOf("480p") == -1)
q["480p"].push(o);
break;
case 34:
case 43:
case 18:
if (config.excludeQuality.indexOf("360p") == -1)
q["360p"].push(o);
break;
default : q["240p"].push(o); break;
}
}
}
var script = "(" + String(injectFunction) + ")(" + JSON.stringify(config) +
", " + JSON.stringify(q) + ");";
frame.inject(script);
}
var injectFunction = function (config, q) {
var i;
var d = document.getElementById("watch-player");
var f = document.createElement("table");
var id = "dwb_video_player";
f.innerHTML =
" <tr align='center' >" +
" <td colspan='10' >" +
" <video id='" + id + "' style='margin-bottom:-3px;position:relative;padding:0px'" +
" width='" + config.playerWidth + "' " +
" height='" + config.playerHeight + "' " +
" src=''" +
" controls />" +
" </td>" +
" </tr>" +
" <tr align='left' >" +
" <td style='top:0px'><div onclick id='" + id + "1080p'>1080p</div>" +
" <td><a id='" + id + "1080plink' href='' >link</a></td>" +
" <td style='1px solid #333'><div onclick id='" + id + "720p'>720p</div>" +
" <td><a id='" + id + "720plink' href='' >link</a></td>" +
" <td style='1px solid #333'><div onclick id='" + id + "480p'>480p</div>" +
" <td><a id='" + id + "480plink' href='' >link</a></td>" +
" <td style='1px solid #333'><div onclick id='" + id + "360p'>360p</div>" +
" <td><a id='" + id + "360plink' href='' >link</a></td>" +
" <td style='1px solid #333'><div onclick id='" + id + "240p'>240p</div>" +
" <td><a id='" + id + "240plink' href='' >link</a></td>" +
" </tr>";
var v = f.querySelector("#" + id);
v.controls = config.controls;
v.autoplay = config.autoplay;
var last = null;
var qualities = [ "1080p", "720p", "480p", "360p", "240p" ];
function getUrl (key) {
if (q[key].length === 0)
return "";
var url = null;
for (var j=0; j<q[key].length && url === null; j++) {
if (q[key][j].format === config.preferredFormat) {
url = q[key][j].url;
}
}
return url === null ? q[key][0].url : url;
}
for (i=0; i<qualities.length; i++) {
(function (key) {
var c = f.querySelector("#" + id + key);
var l = f.querySelector("#" + id + key + "link");
var url = getUrl(key);
if (q[key].length > 0) {
c.style.cursor = "pointer";
c.style.backgroundColor = config.backgroundColor;
c.style.color = config.foregroundColor;
l.style.font = config.linkFont;
l.style.textDecoration = "none";
l.style.color = config.linkColor;
c.onclick = function () {
v.src = url;
last.style.color = config.foregroundColor;
c.style.color = config.foregroundActive;
last = c;
};
l.href = url;
}
else {
c.removeAttribute("onclick");
c.parentNode.style.backgroundColor = config.backgroundDisabled;
l.parentNode.style.backgroundColor = config.backgroundDisabled;
c.style.color = config.foregroundDisabled;
l.style.visibility = "hidden";
}
c.style.borderLeft = config.separator;
c.style.font = config.font;
})(qualities[i]);
}
var current = null;
if (q[config.defaultQuality].length > 0) {
current = config.defaultQuality;
}
else {
for (i=qualities.indexOf(config.defaultQuality)+1; i<qualities.length && current === null; i++) {
var key = qualities[i];
if (q[key].length > 0) {
current = key;
}
}
}
var c = f.querySelector("#" + id + current);
c.style.color = config.foregroundActive;
last = c;
v.src = getUrl(current);
while(d.hasChildNodes())
d.removeChild(d.firstChild);
d.appendChild(f);
};
function togglePlay() {
var frame = tabs.current.mainFrame;
if (frame.domain != "youtube.com")
return;
var playFunction = function() {
var v = document.getElementById("dwb_video_player");
if (v.paused)
v.play();
else
v.pause();
};
frame.inject(util.getBody(playFunction));
}
signals.connect("documentLoaded", documentLoadedCallback);
bind(config.togglePlay, togglePlay);
There are some config options at the beginning of the script.
I hope someone finds it useful.
Offline
I have created a script that replaces all videos on youtube with a html5 video, even if html5 isn't available. It creates a small bar where the quality can be chosen (also with hints).
[…]
There are some config options at the beginning of the script.
I hope someone finds it useful.
Thanks alot! Since this is my first try with scripts in dwb, I run into the following error when starting dwb:
DWB EXTENSION ERROR: extension html5: Error in line 1 parsing /home/jakob/.local/share/dwb/extensions/html5
STACK: [getPlugin] [value] [anonymous] [[native code]]
DWB EXTENSION ERROR: extension html5: Couldn't find extension.
STACK: [value] [anonymous] [[native code]]
I created ~/.conf/dwb/userscripts/userscripts saying:
#!javascript
extensions.load("html5");
and copied (plus chmod +x'ed) the script to ~/.local/share/dwb/extensions/html5.
Am I still missing some things?
Thanks for any hint!
J
Last edited by jakob (2012-08-11 16:50:54)
Offline
Offline
Would it be possible to make this script work for embedded youtube videos?
Offline
I have created a script that replaces all videos on youtube with a html5 video, even if html5 isn't available. It creates a small bar where the quality can be chosen (also with hints).
Here is a screenshot
http://ompldr.org/tZjJqMA
The script is as followssnippety snip snip
There are some config options at the beginning of the script.
I hope someone finds it useful.
The script loads, the little bar is displayed and there's a video window displayed with the given dimensions... but it just won't play any video - tried many different ones, even ones that I uploaded and know they'll play in HTML5. Are there any possible dependencies I may not have? Would love this instead of Flash Youtube video.
Offline
Same experience like Onyros..
Offline
This is the error it's showing when I try to play videos:
NPP_Initialize()
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
Using ALSA. if that's any help. Tried reading something around and it usually showed it being related whether to PulseAudio (which I don't use), or Bluetooth - which I also don't use.
Offline
To be honest, i don't know why it doesn't work for you, it works here with every video i have tested so far. The only requirements should be the codecs and the gstreamer-plugins. I think the NPP_Initialize error is an error of gecko-mediaplayer but i'm not sure. Do you have mozplugger installed?
Offline