You are not logged in.

#1 2009-04-22 19:58:02

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,000
Website

uzbl. A browser that adheres to the unix philosophy.

UPDATE:
This thread is out of date (well, at least the beginning) and no longer the most optimal means to reach the community.
If you have useful things to contribute, our irc/mailing list/wiki is probably a better choice.
See: http://www.uzbl.org/


Inspired by http://bbs.archlinux.org/viewtopic.php?id=67463

ideas on how i sort of want it:

- Uzbl.
  In my opinion, any program can only be really useful if it complies to the unix philosophy.
  Web browsers are frequent violators of this principle.  Time to change that!

Right now uzbl is in a very early state but here are some ideas I would like to (not) implement

- each instance of uzbl renders 1 page (eg it's a small wrapper around webkit), no tabbing, tab previews, or speed dial
things. we have window managers for that.
- simple ini config file ("profile") for keyboard, network,.. settings
- implement some basic keyboard shortcuts for going up, down, refresh etc
- listen to signals and do useful stuff when triggered.
-  open up a socket file/fifo/.. so we can easily control each instance by writing things like 'uri <foo>' to
/tmp/uzbl-pid
- MAYBE (if needed): 1 control application called uzblctrl or something. use this to modify the behavior of a uzbl
instance (change url, refresh).  use xdotool to get the window with focus.  eg uzblctrl -win <id> -url <http://>.
  use xbindkeys to bind keys to call uzblctrl.
- no bookmark management builtin.  make your own solution.  for pulling a bookmark a plaintxt-based program using dmenu
would work great here. combine with uzbltcrl and xbindkeys.
  uzblctrl should support an option to query the current page so you can script something to add to your bookmarks.  use
  zenity or something to add tags.
- similar story for history.
- no ad blocking built in. use the power of /etc/hosts.  though uzblctrl should support an option to list all images on
a page, so you can easily pick the links to ads to add them to your /etc/hosts. (dmenu can again be great here to
automate this)
- no download manager. allow user to pick wget/curl/a custom script/...
- no build in command interpreters like ubiquity.  uzbl should be accessible and you should use a shell or similar.

to figure out:
- password management. maybe an encrypted store that unlocks with an ssh key?
- how to handle hyperlinks? number them like konqueror does?

NOTE:
- My c skills are very rusty, it will take me a while to get back up to speed

current state? very close to zero.
you can all uzbl --uri http://<someurl> and it will open a window with the rendered page. That's it.
howto @ http://github.com/Dieterbe/uzbl/blob/e3 … 580e/HOWTO

Last edited by Dieter@be (2009-06-19 07:17:30)


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#2 2009-04-22 20:21:15

thoffmeyer
Member
From: Chi
Registered: 2006-07-27
Posts: 91

Re: uzbl. A browser that adheres to the unix philosophy.

First, also, I like the idea so far.. really hope to see this become into something.

Offline

#3 2009-04-22 20:34:52

Heller_Barde
Member
Registered: 2008-04-01
Posts: 245

Re: uzbl. A browser that adheres to the unix philosophy.

I applaud you for trying to think out of the box!

I disagree though on the tabbing issue. I think that it would be silly to have single windows for each page. i have a reason for that. when i have my browser open for reference work or something, i usually move it around, out of the way or something and it would annoy me to no end if i had to move all the windows around one by one (and yes, i am sure there would be some clever thing to make a certain window manager do that for me, but I don't think that is the task of a window manager. (although the name "window manager" would technically suggest it, i still don't think so)

good luck nontheless!

cheers
Barde

Offline

#4 2009-04-22 20:50:44

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: uzbl. A browser that adheres to the unix philosophy.

At the moment, what it really needs is a way to open a link in a new window (middle-click?) tongue
This weekend I'll definitely do some reading up on C / WebKit and see if I can contribute to this.

Last edited by Barrucadu (2009-04-22 20:54:05)

Offline

#5 2009-04-22 20:56:10

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: uzbl. A browser that adheres to the unix philosophy.

Maybe you can do tabbing in the control window. Like store a cache of all pages for quick switching. i.e. ./uzbl --cache ~/.uzbl/cache/tab1, not sure how webkit works with that, and it would definitely have to be stored in RAM not disk...

By the way does webkit have multiple rendering methods? Is it possible to tweak things to be more compact?

Offline

#6 2009-04-22 21:10:40

PJ
Member
From: Sweden
Registered: 2005-10-11
Posts: 602

Re: uzbl. A browser that adheres to the unix philosophy.

The tabbing part could actually be put into a separate application, this would make it more general and usable for other applications too (terminals comes to my mind). Anyway, I think this is an interesting approach for a web browser.

Offline

#7 2009-04-22 21:48:49

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: uzbl. A browser that adheres to the unix philosophy.

one note on the whole tabbing discussion: 

the 'philosophy' behind ditching the tabs? unix = one tool, one job; leave stuff like that to the WM, that's what it's there for.  many WMs will tab any and all apps (PekWM and Fluxbox i believe).  and this is actually an awesome and underused feature IMO.  you pick a window, drag it 'onto' another window, and now you've got a tabbed titlebar of Terminal, Firefox, and Pidgin (or whatever) you can use the mouse wheel or keystrokes to move through the layers / tabs.  from there, it's not a far mental leap to dumping a few uzbl windows onto each other and getting --all-- the existing tab functionality entirely from the WM.

... i would miss firefox's S-C-t though, that one's a life saver.

Offline

#8 2009-04-22 22:06:28

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: uzbl. A browser that adheres to the unix philosophy.

@brisbin33: But what about 50+ tabs?

Offline

#9 2009-04-22 22:14:16

PJ
Member
From: Sweden
Registered: 2005-10-11
Posts: 602

Re: uzbl. A browser that adheres to the unix philosophy.

Just to clarify one thing, I was thinking on tab support as a separate application for those window managers that doesn't have built-in support for tabbing, for example openbox, icewm, metacity.

To be far, I don't think tabs are that important and I think it might be better to keep it as simple as possible in the beginning and extend it with feature later on.

Offline

#10 2009-04-22 22:18:14

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: uzbl. A browser that adheres to the unix philosophy.

This is a gui based browser right? or is thisa CLI based one?

As for GUI browsers, some things that I always use :
1) Tabs
2) ability to retain session, so that you don't have to enter the password at a site everytime you visit it. This is one of the reasons, I use links etc sparingly.
3) speed dial -- although I guess this is better of being a separate add on.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#11 2009-04-22 22:35:13

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: uzbl. A browser that adheres to the unix philosophy.

Procyon wrote:

@brisbin33: But what about 50+ tabs?

a) hadn't occurred to me; i don't use tabs like that, but i am aware people do

b) is the WM model not scalable like that?

Offline

#12 2009-04-22 22:42:38

haxit
Member
From: /home/haxit
Registered: 2008-03-04
Posts: 1,247
Website

Re: uzbl. A browser that adheres to the unix philosophy.

Screenshots?


Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.

Offline

#13 2009-04-22 22:45:16

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: uzbl. A browser that adheres to the unix philosophy.

Picture a browser that has nothing but the content and a statusbar.  That's the screenshot.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#14 2009-04-22 23:09:35

haxit
Member
From: /home/haxit
Registered: 2008-03-04
Posts: 1,247
Website

Re: uzbl. A browser that adheres to the unix philosophy.

This is so awesome.


Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.

Offline

#15 2009-04-22 23:31:52

HashBox
Member
Registered: 2009-01-22
Posts: 271

Re: uzbl. A browser that adheres to the unix philosophy.

I love it, please stick to your original view, one instance, one page, one window. Plus uzblctrl.
Tabs could be implemented maybe with a seperate app + xembed, although I have no idea how that works, or if xembed is even capable of that, but you get my point.
Or of course as you mentioned window manager tabs too (Edit, I'll also point out that Xmonad has a nice tabbing layout that would be sweet for this)

I'll say it again, I love it big_smile

Yet another edit, after reading the other post: Vi keybindings for movement would be great. o + url like vimperator would be great too but that might be going a bit far, probably other ways of achieving that.

Last edited by HashBox (2009-04-22 23:41:00)

Offline

#16 2009-04-23 03:10:54

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: uzbl. A browser that adheres to the unix philosophy.

Dieter@be wrote:

- each instance of uzbl renders 1 page (eg it's a small wrapper around webkit), no tabbing, tab previews, or speed dial
things. we have window managers for that.

brisbin33 wrote:

the 'philosophy' behind ditching the tabs? unix = one tool, one job; leave stuff like that to the WM, that's what it's there for.

So I suppose all of the anti-tab believers would also prefer running 6 GNU Screen sessions instead of splitting 1 session into 6 windows?  roll

I don't know if there's a better example of convoluting a principle like "one tool, one job."  Tabs can provide basic HCI usability.  Just because tabs can sometimes be implemented poorly does not mean that tabs should never be implemented at all.  Having a window manager deal with a bunch of browser windows is just a bit silly..

Offline

#17 2009-04-23 04:38:32

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: uzbl. A browser that adheres to the unix philosophy.

tdy wrote:
Dieter@be wrote:

- each instance of uzbl renders 1 page (eg it's a small wrapper around webkit), no tabbing, tab previews, or speed dial
things. we have window managers for that.

brisbin33 wrote:

the 'philosophy' behind ditching the tabs? unix = one tool, one job; leave stuff like that to the WM, that's what it's there for.

So I suppose all of the anti-tab believers would also prefer running 6 GNU Screen sessions instead of splitting 1 session into 6 windows?  roll

roll, indeed. GNU Screen's entire purpose is to make multiple programs (perhaps a text-mode browser) easy to manage. It makes perfect sense to let the WM do its job.

Offline

#18 2009-04-23 05:27:36

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: uzbl. A browser that adheres to the unix philosophy.

Dieter@be wrote:

- no ad blocking built in. use the power of /etc/hosts.  though uzblctrl should support an option to list all images on
a page, so you can easily pick the links to ads to add them to your /etc/hosts. (dmenu can again be great here to
automate this)

How's that going to work when using a proxy, since the proxy will do all the DNS resolution?

Offline

#19 2009-04-23 06:02:47

Arkane
Member
From: Switzerland
Registered: 2008-02-18
Posts: 263

Re: uzbl. A browser that adheres to the unix philosophy.

On the hyperlinks selection matter, what possibilities does webkit offer? IIRC the hints system in vimperator and conkeror is a xulrunner feature, does webkit provide something we could use instead?


What does not kill you will hurt a lot.

Offline

#20 2009-04-23 06:08:12

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: uzbl. A browser that adheres to the unix philosophy.

This looks very interesting. It will be perfect with XMonad + XMonad.Layout.Tabbing. Following the progress of this one closely.

Last edited by Ashren (2009-04-23 06:19:13)

Offline

#21 2009-04-23 06:22:28

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: uzbl. A browser that adheres to the unix philosophy.

Well, the *boxes could handle the tabbing...

Last edited by Wintervenom (2009-04-23 06:22:38)

Offline

#22 2009-04-23 06:26:28

Wra!th
Member
Registered: 2009-03-31
Posts: 342

Re: uzbl. A browser that adheres to the unix philosophy.

Wow this is awesome. I'll try to help anyway I can. But as said before..tabs are a must (I use tiling managers...can't have 20 windows running about smile )

Flash works seeing how it uses webkit..so for me personally tabs are the only thing stoping me from using this fulltime.
Lemme know if  you need any graphics for it, I may find some free time to provide that. But using global gtk themes would be more advised
PS: Is the name final? This might turn into a really well known project..naming should be a great concern big_smile
I vote: Bare (Browser) , with a bear like logo (get the word play there I trust)

Add an address text entry there..shouldn't be too hard, I might find some time to do some deving on it this weekend too

PS2: First thing to take care of: --uri loads nada if you don't provide the http:// (eg "--uri www.google.com" fails)

Last edited by Wra!th (2009-04-23 08:16:37)


MacGregor DESPITE THEM!
7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

Offline

#23 2009-04-23 09:30:57

HashBox
Member
Registered: 2009-01-22
Posts: 271

Re: uzbl. A browser that adheres to the unix philosophy.

Wra!th wrote:

I vote: Bare (Browser) , with a bear like logo (get the word play there I trust)

Bare does sound like a good name, uzbl is short enough, but in my opinion hard to remember.

Wra!th wrote:

Add an address text entry there..shouldn't be too hard, I might find some time to do some deving on it this weekend too

I would disagree about adding this to the interface, for me even the statusbar might be too much bloat for a browser that is supposed to minimalist. But if an address entry is required it can probably sit in the same place as the statusbar. Or it could be implemented in a popup window. I dunno, just throwing ideas out there.

My idea of this app would be having the core renderer as one executable, and that being as minimalist as possible, and then having the uzblctrl app able to control the running instances, maybe through id numbers (or window id's as I think was already in the todo). This would be sufficient to be scripted via external means.

Another small project, or maybe as part of this one, could be to create a sort of wrapper, that would implement the tabbing functionality, and maybe an address bar and more traditional browser UI. Sounds like a minimalist Chrome of sorts smile

Offline

#24 2009-04-23 09:36:05

Wra!th
Member
Registered: 2009-03-31
Posts: 342

Re: uzbl. A browser that adheres to the unix philosophy.

I started working on the tab feature. I am at work so can't really get much done now, but this would qualify as a start.
Things are shamefully hardcoded but this is the jist of it. Obviouslly create_browser() and create_statusbar() need to be rewritten to create individual widgets (webkit widgets too), otherwise tabs will be useless. Yay finally a project to work on big_smile
tMWtkaA

// Original code taken from the example webkit-gtk+ application. see notice below.

/*
 * Copyright (C) 2006, 2007 Apple Inc.
 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <gtk/gtk.h>
#include <gtk/gtknotebook.h>
#include <webkit/webkit.h>

static GtkWidget* main_window;
static GtkWidget* uri_entry;
static GtkStatusbar* main_statusbar;
static WebKitWebView* web_view;
static gchar* main_title;
static gint load_progress;
static guint status_context_id;
static GtkWidget* tabs;


static gchar* uri = NULL;
static gboolean verbose = FALSE;

static GOptionEntry entries[] =
{
  { "uri", 'u', 0, G_OPTION_ARG_STRING, &uri, "Uri to load", NULL },
  { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
  { NULL }
};




static void
activate_uri_entry_cb (GtkWidget* entry, gpointer data)
{
    const gchar* uri = gtk_entry_get_text (GTK_ENTRY (entry));
    g_assert (uri);
    webkit_web_view_load_uri (web_view, uri);
}

static void update_title (GtkWindow* window)
{
    GString* string = g_string_new (main_title);
    g_string_append (string, " - Uzbl browser");
    if (load_progress < 100)
        g_string_append_printf (string, " (%d%%)", load_progress);
    gchar* title = g_string_free (string, FALSE);
    gtk_window_set_title (window, title);
    g_free (title);
}

static void
link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, gpointer data)
{
    /* underflow is allowed */
    gtk_statusbar_pop (main_statusbar, status_context_id);
    if (link)
        gtk_statusbar_push (main_statusbar, status_context_id, link);
}

static void
title_change_cb (WebKitWebView* web_view, WebKitWebFrame* web_frame, const gchar* title, gpointer data)
{
    if (main_title)
        g_free (main_title);
    main_title = g_strdup (title);
    update_title (GTK_WINDOW (main_window));
}

static void
progress_change_cb (WebKitWebView* page, gint progress, gpointer data)
{
    load_progress = progress;
    update_title (GTK_WINDOW (main_window));
}

static void
load_commit_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data)
{
    const gchar* uri = webkit_web_frame_get_uri(frame);
    if (uri)
        gtk_entry_set_text (GTK_ENTRY (uri_entry), uri);
}

static void
destroy_cb (GtkWidget* widget, gpointer data)
{
    gtk_main_quit ();
}

static void
go_back_cb (GtkWidget* widget, gpointer data)
{
    webkit_web_view_go_back (web_view);
}

static void
go_forward_cb (GtkWidget* widget, gpointer data)
{
    webkit_web_view_go_forward (web_view);
}

static GtkWidget*
create_browser ()
{
    GtkWidget* scrolled_window = gtk_scrolled_window_new (NULL, NULL);
    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

    web_view = WEBKIT_WEB_VIEW (webkit_web_view_new ());
    gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (web_view));

    g_signal_connect (G_OBJECT (web_view), "title-changed", G_CALLBACK (title_change_cb), web_view);
    g_signal_connect (G_OBJECT (web_view), "load-progress-changed", G_CALLBACK (progress_change_cb), web_view);
    g_signal_connect (G_OBJECT (web_view), "load-committed", G_CALLBACK (load_commit_cb), web_view);
    g_signal_connect (G_OBJECT (web_view), "hovering-over-link", G_CALLBACK (link_hover_cb), web_view);

    return scrolled_window;
}

static GtkWidget* create_statusbar ()
{
    main_statusbar = GTK_STATUSBAR (gtk_statusbar_new ());
    status_context_id = gtk_statusbar_get_context_id (main_statusbar, "Link Hover");

    return (GtkWidget*)main_statusbar;
}

static GtkWidget* create_window ()
{
    GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_size (GTK_WINDOW (window), 800, 600);
    gtk_widget_set_name (window, "Uzbl browser");
    g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy_cb), NULL);

    return window;
}

int main (int argc, char* argv[])
{
    gtk_init (&argc, &argv);
    if (!g_thread_supported ())
        g_thread_init (NULL);

    tabs = gtk_notebook_new();
    GtkWidget* vbox = gtk_vbox_new (FALSE, 0);
    gtk_box_pack_start (GTK_BOX (vbox), create_browser(), TRUE, TRUE, 0);
    gtk_box_pack_start (GTK_BOX (vbox), create_statusbar(), FALSE, FALSE, 0);
    gtk_notebook_append_page (GTK_NOTEBOOK (tabs), vbox, gtk_label_new ("TAB 1"));

    GtkWidget* vbox2 = gtk_vbox_new (FALSE, 0);
    gtk_box_pack_start (GTK_BOX (vbox2), gtk_label_new("tab 2 content"), TRUE, TRUE, 0);
    gtk_notebook_append_page (GTK_NOTEBOOK (tabs), vbox2, gtk_label_new ("TAB 2"));
    
    main_window = create_window ();
    gtk_container_add (GTK_CONTAINER (main_window), tabs);
    GError *error = NULL;
    
    GOptionContext* context = g_option_context_new ("- some stuff here maybe someday");
    g_option_context_add_main_entries (context, entries, NULL);
    g_option_context_add_group (context, gtk_get_option_group (TRUE));
    g_option_context_parse (context, &argc, &argv, &error);
    webkit_web_view_load_uri (web_view, uri);
    gtk_widget_grab_focus (GTK_WIDGET (web_view));
    gtk_widget_show_all (main_window);
    gtk_main ();

    return 0;
}

MacGregor DESPITE THEM!
7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

Offline

#25 2009-04-23 09:48:42

Wra!th
Member
Registered: 2009-03-31
Posts: 342

Re: uzbl. A browser that adheres to the unix philosophy.

HashBox wrote:

I would disagree about adding this to the interface, for me even the statusbar might be too much bloat for a browser that is supposed to minimalist. But if an address entry is required it can probably sit in the same place as the statusbar. Or it could be implemented in a popup window.

It could be packed next to the status bar so it doesn't waste extra space. I'ma get at it


MacGregor DESPITE THEM!
7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

Offline

Board footer

Powered by FluxBB