Implementing a small web browser frontend in C

used Artifical intelligence to do it.
It lacks tab support and the open in enw tab-/window functions. The rest works already somehow however and its way bigger than gnome web.

gcc pkg-config --cflags gtk+-3.0 webkit2gtk-4.1 -o claude-browser2f claude-browser-2f.c pkg-config --libs gtk+-3.0 webkit2gtk-4.1

It has currently ~500 lines of code. Tazweb has 600.

2 Likes

I get two warnings but it provides an executable that runs.

2 Likes

Yes and the things with warmings i had much trouble tricking the compiler and ai tondo what i want.

Building a very small browser window was the hardest task as the ai was not able to build up the window itself. I had to describe the hbox, vbox and some other things while connecting it to webview arghh. Putting the adressbar in the taskbar and the window below was a real nightmare. Once that was done i could implement one function a day. It was really not that easy. Now the ai can translate this into words that reads like pseudo code and if you type in it, it generates a working solition much faster ..

2 Likes

Holy fsck, this is cool ! :smiley:

Sorry, I just had to share this :joy:
debugging-ai

3 Likes

Yeah there are some limitations but i am now slowly able to implement some more features into it. Got now a search dialog to highlight text of webview yellow if typed in.

Im soon lookimg at other browsers to check what is missing and could be implemented easily. Key bindings for ctrl print or to change user agent changer might be nice to have.

2 Likes

Does it have bookmark management ? What are the current features ? And more importantly, what engine did you choose ?

If it stays light, it may be a very interesting project.

No bookmarks feature yet and its very tricky to implement soem things.. For now ill look what can get added without changing the main code to much.

It can be compiled with few gcc warnings and depends on webkit2gtk. However it builds the window not like the webkit2gtk demo.

MENUBAR:
File
Save(html only)
Download(for small files a sort of progressbar dialog)
Print (open print dialog)
New window
Quit

Help
about dialog

TOOLBAR:
back and forward
Zoom in
Zoom out
Hide or show images
reload page
Web inspector
Adress and search entry-bar

2 Likes

This is a really nice start ! It's been a while since I've coded in C, but I would like to see the code, just to get an idea about how is written the code of a simple web browser.
Anyways that's a great start. I wonder how it would be to write plugins, like one for the bookmarks (I miss a lot Galeon bookmarks system, Epiphany could never replace it properly), synchronization or maybe just importing data from others browsers for now.

I'll follow your project.

1 Like

Pastebin might be the worst place dir such a project hiwever i like it more than github-/lab at the moment.

Code:

gcc `pkg-config --cflags gtk+-3.0 webkit2gtk-4.1` -o claude-browser2d claude-browser-2d.c `pkg-config --libs gtk+-3.0 webkit2gtk-4.1`
2 Likes

Thanks ! I think Pastebin is great if it's just for showing code like this. I used it a lot this way too back in days.

2 Likes

Some bookmark menu at least partially. It saves to bookmarks.txt in the directory the browser is running from. Now i need to change that to a filoe in the home directory. and to add a warning once the number of maximal bookmarks is reached.

2 Likes