You are not logged in.

#1 2012-08-14 19:27:03

fmang
Member
From: France
Registered: 2012-08-14
Posts: 9
Website

Luminescence - plugin-based minimalistic web browser

Hello there,

I know there are already tons of minimalistic web browsers, but I find that most are too complex for my needs (and thus harder to customize), and apart from browsers that you recompile everytime, none, as far as I know, let you access WebKit's C API directly.

So, here's mine. I initially made it for myself but sharing it wouldn't harm anyone. The C program in itself is less than 300 lines of codes; basically, all it does is create the web view, load the plugins and register the commands. With a few plugins you'll be able to have a configuration file and set keyboard bindings (needless to say there are no default keys).

If you want a list of features anyway, here's a short list of the packaged plugins:

  • bind: Vi-like keyboard bindings

  • exec: scripting capability (lets your write configuration files)

  • address-bar, yay

  • insert: important if you want to be able to fill forms

  • download

  • many more at http://git.mg0.fr/luminescence/tree/plugins

AUR: https://aur.archlinux.org/packages.php?ID=57930
Built package: http://mg0.fr/arch/x86_64/luminescence- … pkg.tar.xz

For more information (you'll need at least the README): http://mg0.fr/luminescence/

Cheers,
Fred

Offline

#2 2012-08-14 19:53:30

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: Luminescence - plugin-based minimalistic web browser

This looks neat, I'll take it for a spin next to my dwb when I got the time.
Is webgl enabled btw?

Anyways, looks like really hackable so far which I like.

Last edited by Cloudef (2012-08-14 19:56:16)

Offline

#3 2012-08-14 21:02:11

Neula
Member
Registered: 2012-07-15
Posts: 9

Re: Luminescence - plugin-based minimalistic web browser

Looks awesome, but I just don't get it working. I installed all aviable plugins and copied the example config from the readme (so the config snippets  file looks like this :

user-agent "Mozilla/5.0 Luminescence"
scripts on
uri https://archlinux.org
bind i insert-mode
bind u uri-edit
bind r reload
bind j scripts off
bind J scripts on
bind / find

but no keybindings work.

Last edited by Neula (2012-08-14 21:05:23)

Offline

#4 2012-08-14 21:35:05

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Luminescence - plugin-based minimalistic web browser

Seems to work well here so far, good job fmang. smile


ᶘ ᵒᴥᵒᶅ

Offline

#5 2012-08-14 21:45:16

Neula
Member
Registered: 2012-07-15
Posts: 9

Re: Luminescence - plugin-based minimalistic web browser

Got it working too. smile

Very awesome browser smile

EDIT: I found the cause for my Problem: keys don't work when having the numpad enabled.

Last edited by Neula (2012-08-14 21:52:37)

Offline

#6 2012-08-14 22:01:42

guelfi
Member
From: /home/guelfi
Registered: 2011-07-01
Posts: 111

Re: Luminescence - plugin-based minimalistic web browser

I really like the concept behind this browser, but after taking a quick look, I think that some plugins are kind of taking it too far. Sure, modularity is good, but I don't see why a separate shared library has to be loaded (which AFAIK takes some time) just so one can write something to stdout. A "core" plugin containing simple things like echo or quit would be great.

Also, I noticed some small details I don't quite like when browsing through the code. Maybe I'll fork it and send a pull request tomorrow if I have some spare time.

(I must admit that I didn't actually try it out yet.)

Offline

#7 2012-08-15 07:30:31

hellomynameisphil
Member
From: /home/phil/Vancouver
Registered: 2009-10-02
Posts: 257
Website

Re: Luminescence - plugin-based minimalistic web browser

Fun! Any chance of tabbed browsing, or at least Xembed-awareness (for use with suckless' tabbed)?

Or keyboard-based link following?

Also, I'm having trouble figuring out how keybindings for scrolling work. I have 'bind c scroll' in my config, but hitting c doesn't seem to scroll. I'm probably missing something super obvious, cuz that's what I do. It's sort of my gimmick. :-)

Offline

#8 2012-08-15 08:41:54

guelfi
Member
From: /home/guelfi
Registered: 2011-07-01
Posts: 111

Re: Luminescence - plugin-based minimalistic web browser

hellomynameisphil wrote:

Also, I'm having trouble figuring out how keybindings for scrolling work. I have 'bind c scroll' in my config, but hitting c doesn't seem to scroll. I'm probably missing something super obvious, cuz that's what I do. It's sort of my gimmick. :-)

It's not documented anywhere, but the scroll command takes a second argument specifying the direction ("up", "down", "left" or "right"). I had to figure it out by reading the plugin code.

Offline

#9 2012-08-15 13:27:47

fmang
Member
From: France
Registered: 2012-08-14
Posts: 9
Website

Re: Luminescence - plugin-based minimalistic web browser

Thanks for the feedback.

Have your answers:

Cloudef wrote:

Is webgl enabled btw?

Luminescence uses WebKitGTK+ which, according to this, supports WebGL since 1.8. I cannot test though (poor chipset).

hellomynameisphil wrote:

Any chance of tabbed browsing, or at least Xembed-awareness (for use with suckless' tabbed)?

No tabbed browsing planned (this would be troublesome). As for XEmbed, a plugin should do the trick, if it's not already enabled by Gtk. I've never used that, I'll try to give it a look.

hellomynameisphil wrote:

Or keyboard-based link following?

No plugin for that yet. This would require a bit of work but with some JS one should be able to figure that out.

guelfi's questions are answered here: https://github.com/fmang/luminescence/issues/1

Offline

#10 2012-08-15 14:42:47

sime
Member
Registered: 2007-12-14
Posts: 96

Re: Luminescence - plugin-based minimalistic web browser

Hello, I am trying to get this going on OpenBSD. Here is a diff to get it compile:

diff --git a/Makefile b/Makefile
index c92f0c7..c71c049 100644
--- a/Makefile
+++ b/Makefile
@@ -4,13 +4,13 @@ CFLAGS=-g -Wall
 all: luminescence
 
 luminescence: luminescence.c luminescence.h
-       gcc -o luminescence luminescence.c $(CFLAGS) -ldl `pkg-config --cflags --libs gtk+-3.0 webkitgtk-3.0 gthread-2.0`
+       gcc -o luminescence luminescence.c $(CFLAGS) `pkg-config --cflags --libs gtk+-3.0 webkitgtk-3.0 gthread-2.0`
 
 clean:
        rm -f luminescence
 
 install: luminescence
        mkdir -p $(DESTDIR)/{bin,include,src/luminescence/plugins}
-       install -m 755 luminescence luminescence-install -t $(DESTDIR)/bin
-       install -m 644 luminescence.h -t $(DESTDIR)/include
-       install -m 644 plugins/*.c -t $(DESTDIR)/src/luminescence/plugins
+       install -m 755 luminescence luminescence-install $(DESTDIR)/bin
+       install -m 644 luminescence.h $(DESTDIR)/include
+       install -m 644 plugins/*.c $(DESTDIR)/src/luminescence/plugins
diff --git a/luminescence-install b/luminescence-install
index 2a8e7f2..2bf934c 100755
--- a/luminescence-install
+++ b/luminescence-install
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 mkdir -p ~/.luminescence/plugins
 for f in "$@" ; do
     echo "installing $(basename "$f" .c)..."

After that, with empty config file it manages to start. If you pass --help this is what happens:

$ luminescence --help                                                      
Luminescence version 1.2
Usage: luminescence --COMMAND ARG1 ARG2 ...

Segmentation fault (core dumped) 

If you start using any sort of configuration/plugins it doesn't even manage to start, it just core dumps. Plugins are sucessfully built in ~/.luminescence/plugins.

Any ideas? Is there something Linux-specific in the code? Thanks

Offline

#11 2012-08-15 17:04:23

fmang
Member
From: France
Registered: 2012-08-14
Posts: 9
Website

Re: Luminescence - plugin-based minimalistic web browser

Concerning XEmbed, here's what I got so far:

diff --git a/luminescence.c b/luminescence.c
index 8cab0e8..54eaa42 100644
--- a/luminescence.c
+++ b/luminescence.c
@@ -1,4 +1,5 @@
 #include "luminescence.h"
+#include <gtk/gtkx.h>
 #include <stdlib.h>
 #include <string.h>
 #include <dirent.h>
@@ -240,7 +241,8 @@ int main(int argc, char **argv){
     gtk_init(&argc, &argv);
 
     // Window
-    lumi.window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+    const char *xid = getenv("XID");
+    lumi.window = xid ? gtk_plug_new(atoi(xid)) : gtk_window_new(GTK_WINDOW_TOPLEVEL);
     gtk_window_set_has_resize_grip(GTK_WINDOW(lumi.window), FALSE);
     g_signal_connect(lumi.window, "delete-event", G_CALLBACK(gtk_main_quit), NULL);

To make it work with suckless's tabbed, you can make a little wrapper:

#!/bin/sh
XID="$1" exec luminescence

But for some reason, it's awfully slow, so I won't merge that now.


As for the OpenBSD issue, my guess is that it has something to do with OpenBSD's dynamic loader. Maybe some flag is missing when building the plugins, or perhaps one of the functions behaves slighlty differently. Maybe you could try to pinpoint the line that causes the crash; or just send me a mail.

Last edited by fmang (2014-10-27 06:43:23)

Offline

#12 2012-08-15 17:08:00

bladdo
Member
From: Blacksburg, VA
Registered: 2008-05-05
Posts: 111
Website

Re: Luminescence - plugin-based minimalistic web browser

Neula wrote:

Looks awesome, but I just don't get it working. I installed all aviable plugins and copied the example config from the readme (so the config snippets  file looks like this :

user-agent "Mozilla/5.0 Luminescence"
scripts on
uri https://archlinux.org
bind i insert-mode
bind u uri-edit
bind r reload
bind j scripts off
bind J scripts on
bind / find

but no keybindings work.


Same problem here, no keybindings work and specifying an uri in the config doesn't do anything. All I get is a blank white area.

Looks promising if I could get it to work!


bladdo / mil / Miles
userbound.com - blog and projects

Offline

#13 2012-08-15 17:19:32

Neula
Member
Registered: 2012-07-15
Posts: 9

Re: Luminescence - plugin-based minimalistic web browser

Is your numpad enabled? Keybinds don't work when it is.

Offline

#14 2012-08-16 19:12:02

fmang
Member
From: France
Registered: 2012-08-14
Posts: 9
Website

Re: Luminescence - plugin-based minimalistic web browser

bladdo wrote:

Same problem here, no keybindings work and specifying an uri in the config doesn't do anything. All I get is a blank white area.

Looks like the plugins aren't loaded. If you don't even see a (blank) gray status bar, check if they are indeed installed and loaded:

ls ~/.luminescence/plugins
luminescence --help

If not, this command installs all the packaged plugins:

luminesence-install /usr/src/luminescence/plugins/*.c

Offline

#15 2014-10-26 23:13:56

archlicious
Member
Registered: 2014-10-26
Posts: 6

Re: Luminescence - plugin-based minimalistic web browser

I'm new on here and I know that this thread is old but I got a burning question that needs to be answered - I love your browser but I'm having real trouble watching any youtube videos  or anything like that. Does luminescence even work with flash and javascript or is there any way to make it work? I don't care much for javascript but it's no good if flash doesn't work. Any help, suggestions welcome - cheers!


You can fix stupid. With brain surgery.

Offline

#16 2014-10-27 06:42:46

fmang
Member
From: France
Registered: 2012-08-14
Posts: 9
Website

Re: Luminescence - plugin-based minimalistic web browser

archlicious wrote:

I love your browser but I'm having real trouble watching any youtube videos  or anything like that. Does luminescence even work with flash and javascript or is there any way to make it work?

See http://git.mg0.fr/luminescence-quvi/. Clone it from the link at the bottom and check the README.

I haven't touched that plugin for a while, so it probably won't work with the newest libquvi. Try building with libquvi 0.4.

The commands are `video-get` to download the video, `video-leave` to cancel or close, and `video-play` to start mplayer. Feel free to tweak the code.

Offline

Board footer

Powered by FluxBB