commit: 3d09588f910336cb7db6c78c2d4e7e08ca8641c1
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 7 Jan 2019 02:51:24 +0100
Initial Commit
Diffstat:
4 files changed, 57 insertions(+), 0 deletions(-)
diff --git a/KnowledgeBase.md b/KnowledgeBase.md
@@ -0,0 +1,2 @@
+- Similar WebKitGTK+ browser: https://www.uninformativ.de/git/lariza/
+- WebKit2 Extensions Tutorial: https://blogs.igalia.com/carlosgc/2013/09/10/webkit2gtk-web-process-extensions/
diff --git a/Makefile b/Makefile
@@ -0,0 +1,9 @@
+LIBS=$(shell pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0)
+
+badwolf: badwolf.c
+ $(CC) $(CFLAGS) $(LIBS) -o $@ $@.c
+
+clean:
+ rm badwolf
+
+.PHONY: clean
diff --git a/README.md b/README.md
@@ -0,0 +1,12 @@
+# BadWolf
+
+Yet Another WebKitGTK+ interface.
+
+Target: https://hacktivis.me/articles/www-client%20are%20broken
+
+## Dependencies
+- WebKitGTK+
+- GTK3+
+
+## 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
@@ -0,0 +1,34 @@
+#include <gtk/gtk.h>
+#include <webkit2/webkit2.h>
+
+static gboolean closeWebViewCb(WebKitWebView *_webView, GtkWidget *window)
+{
+ gtk_widget_destroy(window);
+ return TRUE;
+}
+
+int main(int argc, char *argv[])
+{
+ gtk_init(0, 0);
+
+ char *target_url = "about:blank";
+
+ if(argv[1])
+ target_url = argv[1];
+
+ GtkWidget *main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+
+ WebKitWebView *webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
+
+ gtk_container_add(GTK_CONTAINER(main_window), GTK_WIDGET(webView));
+
+ g_signal_connect(main_window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
+ g_signal_connect(webView, "close", G_CALLBACK(closeWebViewCb), main_window);
+
+ webkit_web_view_load_uri(webView, target_url);
+
+ gtk_widget_grab_focus(GTK_WIDGET(webView));
+ gtk_widget_show_all(main_window);
+ gtk_main();
+ return 0;
+}