logo

badwolf

Minimalist and privacy-oriented WebKitGTK+ browser
commit: 5a86c8d7f38140f7eb736c0d4665de19889aa908
parent: ebfa85f2cfbd3770fae4f83d7457dcfb001b5fd1
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 15 Mar 2019 17:44:36 +0100

Merge branch 'develop'

Diffstat:

A.clang-format20++++++++++++++++++++
MKnowledgeBase.md1+
MMakefile3+++
MREADME.md30++++++++++++++++++++++++++----
Mbadwolf.c42+++++++++++++++++++++++++++++-------------
5 files changed, 79 insertions(+), 17 deletions(-)

diff --git a/.clang-format b/.clang-format @@ -0,0 +1,20 @@ +AlignAfterOpenBracket: true +AlignConsecutiveAssignments: true +AlignOperands: true +AlignTrailingComments: true +AllowShortCaseLabelsOnASingleLine: true +AllowShortFunctionsOnASingleLine: true +AllowShortIfStatementsOnASingleLine: true +BinPackArguments: false +BinPackParameters: false +BreakBeforeBraces: Allman +SpaceBeforeParens: Never +IncludeBlocks: Regroup +ReflowComments: false +SortIncludes: true +UseTab: ForIndentation +IndentWidth: 2 +TabWidth: 2 +ColumnLimit: 100 + +NamespaceIndentation: All diff --git a/KnowledgeBase.md b/KnowledgeBase.md @@ -1,3 +1,4 @@ - Similar WebKitGTK+ browser: https://www.uninformativ.de/git/lariza/ - WebKit2 Extensions Tutorial: https://blogs.igalia.com/carlosgc/2013/09/10/webkit2gtk-web-process-extensions/ - https://trac.torproject.org/projects/tor/wiki/doc/ImportantGoogleChromeBugs / https://trac.torproject.org/projects/tor/ticket/1925 +- https://webkit.org/blog/3476/content-blockers-first-look/ diff --git a/Makefile b/Makefile @@ -11,4 +11,7 @@ install: badwolf clean: rm badwolf +format: *.c *.h + clang-format -style=file -assume-filename=~/.clang-format -i *.c *.h + .PHONY: clean install diff --git a/README.md b/README.md @@ -1,19 +1,41 @@ # BadWolf Minimalist and privacy-oriented WebKitGTK+ browser +``` Copyright © 2019 Haelwenn (lanodan) Monnier <contact@hacktivis.me> SPDX-License-Identifier: BSD-3-Clause +``` The name is a reference to BBC’s Doctor Who Tv serie, I took it simply because I wanted to have a specie in the name, like some other web browsers do, but doesn’t go into the “gentle” zone. -Target: https://hacktivis.me/articles/www-client%20are%20broken +## Differencies +Comparing from other small WebKit browsers for unixes found in the wild: + +- Independent of environment, should just work if GTK and WebKitGTK does +- Static UI, no element should be added at runtime, this is to avoid potential tracking via viewport changes +- Small codebase, right now we are well under 1 000 lines +- Does not use modal editing (from vi) as that was designed for editing, not browsing +- UTF-8 encoding by default + +Motivation from other clients <https://hacktivis.me/articles/www-client%20are%20broken> ## Repositories +### git - Main: <https://hacktivis.me/git/badwolf/>, <git://hacktivis.me/git/badwolf.git> - Mirror: <https://gitlab.com/lanodan/badWolf.git>, this one can also be used if you prefer tickets/PRs over emails -## Dependencies -- WebKitGTK+ -- GTK3+ +### release tarballs +- Main: <https://hacktivis.me/releases/> +- Mirror: <https://gitlab.com/lanodan/badWolf/tags> + +Files ending in `.sig` are OpenPGP signatures done with my [key](https://hacktivis.me/key.asc)(`DDC9 237C 14CF 6F4D D847 F6B3 90D9 3ACC FEFF 61AE`). + +## Manual Installation +Dependencies are: +- [WebKitGTK](https://webkitgtk.org/), only the latest stable will be fully supported +- C99+ Compiler (such as clang or gcc) +- POSIX make (works with GNU or BSD) + +Compilation is done with `make`, install with `make install`. ## Notes Most of the privacy/security stuff will be done with patches against WebKit as quite a lot isn’t into [WebKitSettings](https://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html) and with a generic WebKit extension that should be resuseable. diff --git a/badwolf.c b/badwolf.c @@ -108,10 +108,11 @@ GtkWidget *badwolf_new_tab_box(const gchar *title, struct Client *browser) { (void)browser; GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); - GtkWidget *close = gtk_button_new_from_icon_name("window-close", GTK_ICON_SIZE_SMALL_TOOLBAR); - GtkWidget *label = gtk_label_new(title); + GtkWidget *close = + gtk_button_new_from_icon_name("window-close-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + GtkWidget *label = gtk_label_new(title); GtkWidget *playing = - gtk_image_new_from_icon_name("media-playback-start-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_image_new_from_icon_name("audio-volume-high-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_label_set_width_chars(GTK_LABEL(label), BADWOLF_TAB_LABEL_CHARWIDTH); gtk_label_set_ellipsize(GTK_LABEL(label), BADWOLF_TAB_LABEL_ELLIPSIZE); @@ -327,13 +328,28 @@ new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web gtk_widget_set_tooltip_text(browser->javascript, "Toggle javascript"); - gtk_box_pack_start(GTK_BOX(browser->toolbar), GTK_WIDGET(browser->javascript), FALSE, FALSE, BADWOLF_TOOLBAR_PADDING); - gtk_box_pack_start(GTK_BOX(browser->toolbar), GTK_WIDGET(browser->location), TRUE, TRUE, BADWOLF_TOOLBAR_PADDING); - gtk_box_pack_start(GTK_BOX(browser->toolbar), GTK_WIDGET(browser->search), FALSE, FALSE, BADWOLF_TOOLBAR_PADDING); - - gtk_box_pack_start(GTK_BOX(browser->box), GTK_WIDGET(browser->toolbar), FALSE, FALSE, BADWOLF_BOX_PADDING); - gtk_box_pack_start(GTK_BOX(browser->box), GTK_WIDGET(browser->webView), TRUE, TRUE, BADWOLF_BOX_PADDING); - gtk_box_pack_start(GTK_BOX(browser->box), GTK_WIDGET(browser->statusbar), FALSE, FALSE, BADWOLF_BOX_PADDING); + gtk_box_pack_start(GTK_BOX(browser->toolbar), + GTK_WIDGET(browser->javascript), + FALSE, + FALSE, + BADWOLF_TOOLBAR_PADDING); + gtk_box_pack_start(GTK_BOX(browser->toolbar), + GTK_WIDGET(browser->location), + TRUE, + TRUE, + BADWOLF_TOOLBAR_PADDING); + gtk_box_pack_start(GTK_BOX(browser->toolbar), + GTK_WIDGET(browser->search), + FALSE, + FALSE, + BADWOLF_TOOLBAR_PADDING); + + gtk_box_pack_start( + GTK_BOX(browser->box), GTK_WIDGET(browser->toolbar), FALSE, FALSE, BADWOLF_BOX_PADDING); + gtk_box_pack_start( + GTK_BOX(browser->box), GTK_WIDGET(browser->webView), TRUE, TRUE, BADWOLF_BOX_PADDING); + gtk_box_pack_start( + GTK_BOX(browser->box), GTK_WIDGET(browser->statusbar), FALSE, FALSE, BADWOLF_BOX_PADDING); gtk_widget_set_halign(browser->statusbar, GTK_ALIGN_START); gtk_label_set_single_line_mode(GTK_LABEL(browser->statusbar), TRUE); @@ -433,8 +449,8 @@ void closeCb_clicked(GtkButton *close, gpointer user_data) (void)close; struct Client *browser = (struct Client *)user_data; GtkNotebook *notebook = GTK_NOTEBOOK(browser->window->notebook); - GValue position = G_VALUE_INIT; - g_value_init (&position, G_TYPE_INT); + GValue position = G_VALUE_INIT; + g_value_init(&position, G_TYPE_INT); gtk_container_child_get_property(GTK_CONTAINER(notebook), browser->box, "position", &position); @@ -453,7 +469,7 @@ int main(int argc, char *argv[]) window->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); window->notebook = gtk_notebook_new(); - window->new_tab = gtk_button_new_from_icon_name("tab-new", GTK_ICON_SIZE_SMALL_TOOLBAR); + window->new_tab = gtk_button_new_from_icon_name("tab-new-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_window_set_role(GTK_WINDOW(window->main_window), "browser");