From d55586e83772238fd1adf9ca9370f37697b29e33 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 2 Nov 2019 22:02:30 +0100 Subject: fix formatting --- badwolf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/badwolf.c b/badwolf.c index 6c6b0c9..b4dd580 100644 --- a/badwolf.c +++ b/badwolf.c @@ -726,7 +726,8 @@ main(int argc, char *argv[]) webkit_get_minor_version(), webkit_get_micro_version()); - web_extensions_directory = g_build_filename(g_get_user_data_dir(), "badwolf", "webkit-web-extension", NULL); + web_extensions_directory = + g_build_filename(g_get_user_data_dir(), "badwolf", "webkit-web-extension", NULL); g_fprintf(stderr, _("webkit-web-extension directory set to: %s\n"), web_extensions_directory); window->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); -- cgit v1.3.1-23-gd82d From 2a4e981821edcf340d1324560e95c08a4674bc22 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 13 Dec 2019 03:48:36 +0100 Subject: Add GtkMessageDialog on load-failed-with-tls-errors --- badwolf.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/badwolf.c b/badwolf.c index b4dd580..fe40193 100644 --- a/badwolf.c +++ b/badwolf.c @@ -354,6 +354,28 @@ WebViewCb_decide_policy(WebKitWebView *web_view, return TRUE; } +static gboolean +WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, + gchar *failing_uri, + GTlsCertificate *certificate, + GTlsCertificateFlags errors, + gpointer user_data) +{ + (void)web_view; + (void)certificate; + (void)errors; + struct Client *browser = (struct Client *)user_data; + + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(browser->window->main_window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + "TLS Error for: %s", + failing_uri); + + return FALSE; /* propagate the event further */ +} + static void web_contextCb_download_started(WebKitWebContext *web_context, WebKitDownload *download, @@ -606,6 +628,10 @@ new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web g_signal_connect( browser->webView, "permission-request", G_CALLBACK(WebViewCb_permission_request), NULL); g_signal_connect(browser->webView, "decide-policy", G_CALLBACK(WebViewCb_decide_policy), NULL); + g_signal_connect(browser->webView, + "load-failed-with-tls-errors", + G_CALLBACK(WebViewCb_load_failed_with_tls_errors), + browser); /* signals for WebView's WebContext */ g_signal_connect(G_OBJECT(web_context), -- cgit v1.3.1-23-gd82d From e5ecaf777659e8d3a625002826c4a1a3f8b31801 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 13 Dec 2019 14:06:33 +0100 Subject: badwolf.c: Use SoupURI instead of g_uri_parse_scheme() --- Makefile | 2 +- badwolf.c | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0a58cda..cbd134e 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ DATADIR = $(PREFIX)/share/badwolf APPSDIR = $(PREFIX)/share/applications PACKAGE = Badwolf -DEPS = gtk+-3.0 webkit2gtk-4.0 +DEPS = gtk+-3.0 webkit2gtk-4.0 libsoup-2.4 OBJS = keybindings.o badwolf.o EXE = badwolf TRANS = fr.mo diff --git a/badwolf.c b/badwolf.c index fe40193..e85f189 100644 --- a/badwolf.c +++ b/badwolf.c @@ -9,6 +9,7 @@ #include /* _() and other internationalization/localization helpers */ #include /* g_fprintf() */ +#include /* soup* */ #include /* LC_* */ #include /* realpath(), malloc() */ @@ -64,11 +65,21 @@ notebookCb_switch__page(GtkNotebook *notebook, GtkWidget *page, guint page_num, gchar * badwolf_ensure_uri_scheme(gchar *text, gboolean try_file) { - if(text == NULL) return "about:blank"; + SoupURI *uri = soup_uri_new(text); - char *scheme = g_uri_parse_scheme(text); + if(uri->path == NULL) + { + soup_uri_free(uri); + return "about:blank"; + } + + if(uri->scheme != NULL) + { + soup_uri_free(uri); + return text; + } - if(scheme != NULL) return text; + soup_uri_free(uri); if(try_file) { -- cgit v1.3.1-23-gd82d From 2e4298b105fab04e1ac092c99ce5d44dc90823af Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 13 Dec 2019 14:20:28 +0100 Subject: badwolf.c: Add error details and adding exception --- badwolf.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/badwolf.c b/badwolf.c index e85f189..866a4ba 100644 --- a/badwolf.c +++ b/badwolf.c @@ -365,9 +365,38 @@ WebViewCb_decide_policy(WebKitWebView *web_view, return TRUE; } +static char * +detail_tls_certificate_flags(GTlsCertificateFlags tls_errors) +{ + GString *errors = g_string_new(NULL); + + if(tls_errors & G_TLS_CERTIFICATE_UNKNOWN_CA) + g_string_append_printf(errors, _("The Certificate Authority is unknown.\n")); + + if(tls_errors & G_TLS_CERTIFICATE_BAD_IDENTITY) + g_string_append(errors, _("The given identity doesn't match the expected one.\n")); + + if(tls_errors & G_TLS_CERTIFICATE_NOT_ACTIVATED) + g_string_append(errors, _("The certificate isn't valid yet.\n")); + + if(tls_errors & G_TLS_CERTIFICATE_EXPIRED) + g_string_append(errors, _("The certificate has expired.\n")); + + if(tls_errors & G_TLS_CERTIFICATE_REVOKED) + g_string_append(errors, _("The certificate has been revoked.\n")); + + if(tls_errors & G_TLS_CERTIFICATE_INSECURE) + g_string_append(errors, _("The certificate is considered to be insecure.\n")); + + if(tls_errors & G_TLS_CERTIFICATE_GENERIC_ERROR) + g_string_append(errors, _("Some unknown error occurred validating the certificate\n")); + + return g_string_free(errors, FALSE); +} + static gboolean WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, - gchar *failing_uri, + gchar *failing_text, GTlsCertificate *certificate, GTlsCertificateFlags errors, gpointer user_data) @@ -376,13 +405,32 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, (void)certificate; (void)errors; struct Client *browser = (struct Client *)user_data; + gchar *error_details = detail_tls_certificate_flags(errors); + gint dialog_response; + SoupURI *failing_uri = soup_uri_new(failing_text); GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(browser->window->main_window), - GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_DIALOG_MODAL & GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "TLS Error for: %s", - failing_uri); + GTK_BUTTONS_NONE, + "TLS Error for %s.", + failing_text); + gtk_dialog_add_buttons(GTK_DIALOG(dialog), _("Add Exception"), 1, _("Ignore"), 0, NULL); + gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), "%s\n", error_details); + + dialog_response = gtk_dialog_run(GTK_DIALOG(dialog)); + + if(dialog_response == 1) + { + webkit_web_context_allow_tls_certificate_for_host( + webkit_web_view_get_context(browser->webView), certificate, failing_uri->host); + webkit_web_view_reload(browser->webView); + } + + soup_uri_free(failing_uri); + g_free(error_details); + gtk_widget_destroy(dialog); return FALSE; /* propagate the event further */ } -- cgit v1.3.1-23-gd82d From b67d402a1b1fefe3b89a2319fea231eeab8ac49a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 15 Dec 2019 17:58:09 +0100 Subject: usr.bin.badwolf: Add AppArmor example file --- README.md | 2 +- usr.bin.badwolf | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 usr.bin.badwolf diff --git a/README.md b/README.md index 6d54ea7..e06cfa8 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Dependencies are: - POSIX make (works with GNU or BSD) - A pkg-config implementation (pkg-config and pkgconf are supported) -Compilation is done with `make`, install with `make install`. +Compilation is done with `make`, install with `make install`. An example AppArmor profile is provided at `usr.bin.badwolf`, please do runtime checks before deploying. ## 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/usr.bin.badwolf b/usr.bin.badwolf new file mode 100644 index 0000000..4407f31 --- /dev/null +++ b/usr.bin.badwolf @@ -0,0 +1,81 @@ +# BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser +# Copyright © 2019 Haelwenn (lanodan) Monnier +# SPDX-License-Identifier: BSD-3-Clause +# +# Made on Gentoo Linux with PREFIX=/usr +#include + +/usr/bin/badwolf { + #include + #include + #include + #include + #include + + /usr/bin/badwolf mr, + /usr/bin/bwrap Cx, + /usr/libexec/webkit2gtk-4.0/WebKitNetworkProcess Cx, + /usr/libexec/webkit2gtk-4.0/WebKitWebProcess Cx, + + owner @{PROC}/@{pid}/cmdline r, + owner @{PROC}/@{pid}/fd/ r, + + owner @{HOME}/.local/share/badwolf/ r, + owner @{HOME}/.local/share/badwolf/** r, + + deny @{HOME}/.local/share/webkitgtk/** rwmlk, + + / r, + /** r, + + #include + + profile /usr/libexec/webkit2gtk-4.0/WebKitNetworkProcess { + #include + #include + #include + #include + + network inet stream, + network inet6 stream, + + /usr/libexec/webkit2gtk-4.0/WebKitNetworkProcess mr, + /** r, + owner /** w, + } + + profile /usr/libexec/webkit2gtk-4.0/WebKitWebProcess { + #include + #include + #include + #include + #include + #include + #include + #include + + /usr/libexec/webkit2gtk-4.0/WebKitWebProcess mr, + + owner @{PROC}/@{pid}/cmdline r, + owner @{PROC}/@{pid}/fd/ r, + + /etc/passwd r, + /etc/group r, + /etc/nsswitch.conf r, + /dev/ r, + + owner @{HOME}/.local/share/badwolf/webkit-web-extension/ r, + owner @{HOME}/.local/share/badwolf/webkit-web-extension/** mr, + } + + profile /usr/bin/bwrap { + #include + + deny capability sys_admin, + + /usr/bin/bwrap mr, + @{PROC}/sys/kernel/overflowuid r, + @{PROC}/sys/kernel/overflowgid r, + owner @{PROC}/@{pid}/fd/ r, + } +} -- cgit v1.3.1-23-gd82d From e352d548e49bb448ba2b1db46a61163f65ec6abb Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 15 Dec 2019 18:10:11 +0100 Subject: Install docs --- Makefile | 10 +++++++++- version.sh | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index cbd134e..a215292 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,12 @@ .POSIX: +VERSION = 0.4.0 +VERSION_FULL = $(VERSION)$(shell ./version.sh) + PREFIX = /usr/local BINDIR = $(PREFIX)/bin MANDIR = $(PREFIX)/share/man +DOCDIR = $(PREFIX)/share/doc/badwolf-$(VERSION) DATADIR = $(PREFIX)/share/badwolf APPSDIR = $(PREFIX)/share/applications PACKAGE = Badwolf @@ -11,10 +15,11 @@ DEPS = gtk+-3.0 webkit2gtk-4.0 libsoup-2.4 OBJS = keybindings.o badwolf.o EXE = badwolf TRANS = fr.mo +DOCS = usr.bin.badwolf README.md KnowledgeBase.md CC = cc CFLAGS = -g -Wall -Wextra -Wconversion -Wsign-conversion -CDEPS = `pkg-config --cflags $(DEPS)` -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_DEFAULT_SOURCE -DVERSION=\"$(shell ./version.sh)\" +CDEPS = `pkg-config --cflags $(DEPS)` -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_DEFAULT_SOURCE -DVERSION=\"$(VERSION_FULL)\" LIBS = `pkg-config --libs $(DEPS)` all: $(EXE) $(TRANS) @@ -47,6 +52,9 @@ install: all cp -r locale/ $(DESTDIR)$(DATADIR) mkdir -p $(DESTDIR)$(APPSDIR) cp -p badwolf.desktop $(DESTDIR)$(APPSDIR)/ + mkdir -p $(DESTDIR)$(DOCDIR) + cp -p $(DOCS) $(DESTDIR)$(DOCDIR)/ + @printf '\nNote: An example AppArmor profile has been installed at '$(DOCDIR)/usr.bin.badwolf'\n' clean: rm -fr locale $(OBJS) $(EXE) diff --git a/version.sh b/version.sh index a87283e..318aa72 100755 --- a/version.sh +++ b/version.sh @@ -1,5 +1,4 @@ #!/bin/sh -echo -n '0.4.0' hash=$(git --git-dir="$(dirname $0)/.git" rev-parse --short HEAD 2>/dev/null) if [ -n "$hash" ] -- cgit v1.3.1-23-gd82d From 13f01bbd402ab667e7ee80afc3cfaee2f7b92f44 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 7 Dec 2019 10:40:42 +0100 Subject: badwolf.c: Simplify badwolf_ensure_uri_scheme() --- badwolf.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/badwolf.c b/badwolf.c index 866a4ba..fc26407 100644 --- a/badwolf.c +++ b/badwolf.c @@ -81,19 +81,7 @@ badwolf_ensure_uri_scheme(gchar *text, gboolean try_file) soup_uri_free(uri); - if(try_file) - { - gchar *f; - char *path; - path = realpath(text, NULL); - - if(path != NULL) - { - f = g_strdup_printf("file://%s", path); - free(path); - return f; - } - } + if(try_file && (access(text, R_OK) == 0)) return g_strdup_printf("file://%s", text); return g_strdup_printf("http://%s", text); } -- cgit v1.3.1-23-gd82d From 95138deae3a523bf10b59ec13b6e5b4b0a1456a6 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 7 Dec 2019 10:51:19 +0100 Subject: badwolf.c: badwolf_ensure_uri_scheme never returns NULL --- badwolf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/badwolf.c b/badwolf.c index fc26407..a69c05a 100644 --- a/badwolf.c +++ b/badwolf.c @@ -474,12 +474,10 @@ downloadCb_decide_destination(WebKitDownload *download, static gboolean locationCb_activate(GtkEntry *location, gpointer user_data) { - char *target_url; struct Client *browser = (struct Client *)user_data; - target_url = badwolf_ensure_uri_scheme((char *)gtk_entry_get_text(location), TRUE); - - if(target_url != NULL) webkit_web_view_load_uri(browser->webView, target_url); + webkit_web_view_load_uri(browser->webView, + badwolf_ensure_uri_scheme(gtk_entry_get_text(location), TRUE)); return TRUE; } -- cgit v1.3.1-23-gd82d From 92578a663bbb9a931a1771cd25922915cd014849 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 7 Dec 2019 11:50:42 +0100 Subject: Move from GtkFileChooserDialog to GtkFileChooserNative --- badwolf.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/badwolf.c b/badwolf.c index a69c05a..9071351 100644 --- a/badwolf.c +++ b/badwolf.c @@ -445,28 +445,22 @@ downloadCb_decide_destination(WebKitDownload *download, gint chooser_response; GtkWindow *parent_window = GTK_WINDOW(browser->window->main_window); - GtkWidget *file_dialog = gtk_file_chooser_dialog_new(NULL, - parent_window, - GTK_FILE_CHOOSER_ACTION_SAVE, - _("_Cancel"), - GTK_RESPONSE_CANCEL, - _("_Save"), - GTK_RESPONSE_ACCEPT, - NULL); + GtkFileChooserNative *file_dialog = + gtk_file_chooser_native_new(NULL, parent_window, GTK_FILE_CHOOSER_ACTION_SAVE, NULL, NULL); GtkFileChooser *file_chooser = GTK_FILE_CHOOSER(file_dialog); gtk_file_chooser_set_current_name(file_chooser, suggested_filename); gtk_file_chooser_set_do_overwrite_confirmation(file_chooser, TRUE); webkit_download_set_allow_overwrite(download, TRUE); - chooser_response = gtk_dialog_run(GTK_DIALOG(file_dialog)); + chooser_response = gtk_native_dialog_run(GTK_NATIVE_DIALOG(file_dialog)); if(chooser_response == GTK_RESPONSE_ACCEPT) webkit_download_set_destination(download, gtk_file_chooser_get_uri(file_chooser)); else webkit_download_cancel(download); - gtk_widget_destroy(file_dialog); + g_object_unref(file_dialog); return FALSE; /* Let it propagate */ } -- cgit v1.3.1-23-gd82d From 5e1ea02409b318a46edc5d976738ca48d28246eb Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 7 Dec 2019 11:50:04 +0100 Subject: Simplify formatting --- badwolf.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/badwolf.c b/badwolf.c index 9071351..289e218 100644 --- a/badwolf.c +++ b/badwolf.c @@ -243,10 +243,9 @@ WebViewCb_notify__estimated_load_progress(WebKitWebView *webView, gdouble progress; progress = webkit_web_view_get_estimated_load_progress(browser->webView); - if(progress == 1) - { - progress = 0; - } + + if(progress >= 1) progress = 0; + gtk_entry_set_progress_fraction(GTK_ENTRY(browser->location), progress); return TRUE; @@ -304,13 +303,9 @@ WebViewCb_create(WebKitWebView *related_web_view, struct Client *browser = new_browser(window, NULL, related_web_view); if(badwolf_new_tab(GTK_NOTEBOOK(window->notebook), browser) < 0) - { return NULL; - } else - { return browser->webView; - } } static gboolean @@ -711,10 +706,7 @@ badwolf_new_tab(GtkNotebook *notebook, struct Client *browser) gtk_widget_show_all(browser->box); - if(gtk_notebook_insert_page(notebook, browser->box, NULL, (current_page + 1)) == -1) - { - return -1; - } + if(gtk_notebook_insert_page(notebook, browser->box, NULL, (current_page + 1)) == -1) return -1; gtk_notebook_set_tab_reorderable(notebook, browser->box, TRUE); gtk_notebook_set_tab_label(notebook, browser->box, badwolf_new_tab_box(title, browser)); -- cgit v1.3.1-23-gd82d From 10aa19f7b748385fa08f99a0766dac837ee9522a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 15 Dec 2019 19:17:31 +0100 Subject: badwolf_ensure_uri_scheme(): Fix const discarding --- badwolf.c | 6 +++--- badwolf.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/badwolf.c b/badwolf.c index 289e218..bf42eb2 100644 --- a/badwolf.c +++ b/badwolf.c @@ -62,8 +62,8 @@ static void closeCb_clicked(GtkButton *close, gpointer user_data); static void notebookCb_switch__page(GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data); -gchar * -badwolf_ensure_uri_scheme(gchar *text, gboolean try_file) +const gchar * +badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file) { SoupURI *uri = soup_uri_new(text); @@ -535,7 +535,7 @@ SearchEntryCb_stop__search(GtkSearchEntry *search, gpointer user_data) } struct Client * -new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web_view) +new_browser(struct Window *window, const gchar *target_url, WebKitWebView *related_web_view) { struct Client *browser = malloc(sizeof(struct Client)); target_url = badwolf_ensure_uri_scheme(target_url, (related_web_view == NULL)); diff --git a/badwolf.h b/badwolf.h index 4c9fa65..971ffa3 100644 --- a/badwolf.h +++ b/badwolf.h @@ -41,11 +41,11 @@ struct Client * In the end use the fallback (`http://` for now, might get configuration), * might get some safeguard. */ -gchar *badwolf_ensure_uri_scheme(gchar *text, gboolean try_file); +const gchar *badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file); GtkWidget *badwolf_new_tab_box(const gchar *title, struct Client *browser); void webView_tab_label_change(struct Client *browser, const gchar *title); struct Client * -new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web_view); +new_browser(struct Window *window, const gchar *target_url, WebKitWebView *related_web_view); int badwolf_new_tab(GtkNotebook *notebook, struct Client *browser); gint badwolf_get_tab_position(GtkContainer *notebook, GtkWidget *child); #endif /* BADWOLF_H_INCLUDED */ -- cgit v1.3.1-23-gd82d From 036fa5a08dac68c69e80f3a4638baac77868359e Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 4 Nov 2019 20:12:00 +0100 Subject: README.md: Update for current codebase status --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e06cfa8..baa5c4d 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,12 @@ The name is a reference to BBC’s Doctor Who Tv serie, I took it simply because Comparing from other small WebKit browsers for unixes found in the wild: - Independent of environment, should just work if GTK and WebKitGTK does +- Storing data should be: + - explicit and optionnal (ie. Applying preferences doesn't imply Saving to disk) + - not queryabe by WebKit (so the web can't use it) + - done in a standard format (like XBEL for bookmarks) - 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 +- Small codebase, right now we are under 1 500 lines total - Does not use modal editing (from vi) as that was designed for editing, not browsing - UTF-8 encoding by default @@ -23,11 +27,13 @@ Motivation from other clients , - Mirror: , this one can also be used if you prefer tickets/PRs over emails -### release tarballs +### release assets - Main: - Mirror: -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`). +- `*.tar.*` files are tarballs archives to be extracted with a program like `tar(1)`, GNU tar and LibArchive bsdtar are known to work. +- `*.sig` files are OpenPGP signatures done with my [key](https://hacktivis.me/key.asc)(`DDC9 237C 14CF 6F4D D847 F6B3 90D9 3ACC FEFF 61AE`). +- `*.sign` files are minisign (OpenBSD `signify(1)` compatible) signatures, they key used for it can be found at as well as other places (feel free to ping me to get it) ## Manual Installation Dependencies are: @@ -39,4 +45,4 @@ Dependencies are: Compilation is done with `make`, install with `make install`. An example AppArmor profile is provided at `usr.bin.badwolf`, please do runtime checks before deploying. ## 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. +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 generic WebKit extensions that should be resuseable. -- cgit v1.3.1-23-gd82d From 446003a4e1b7f8e0673e361f1691d72d8a378173 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 4 Nov 2019 20:15:12 +0100 Subject: Disable some more or less dangerous settings - `enable-accelerated-2d-canvas` GPU fingerprinting via canvas - `enable-dns-prefetching` potential referrer auditing - `enable-hyperlink-auditing` transparent meaning, it's for --- config.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config.h b/config.h index 0044667..4aa5c5a 100644 --- a/config.h +++ b/config.h @@ -60,11 +60,14 @@ // clang-format off #define BADWOLF_WEBKIT_SETTINGS \ "default-charset", "utf-8", \ + "enable-accelerated-2d-canvas", FALSE, \ "enable-caret-browsing", FALSE, \ "enable-developer-extras", TRUE, \ + "enable-dns-prefetching", FALSE, \ + "enable-hyperlink-auditing", FALSE, \ "enable-java", FALSE, \ - "enable-javascript", TRUE, \ "enable-javascript-markup", FALSE, \ + "enable-javascript", TRUE, \ "enable-plugins", FALSE, \ "javascript-can-access-clipboard", FALSE, \ "javascript-can-open-windows-automatically", FALSE, \ -- cgit v1.3.1-23-gd82d From 94bc1e381baacba8a45f5782f368af11eff279a7 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 15 Dec 2019 19:33:19 +0100 Subject: badwolf.c: Fix access() usage --- Makefile | 2 +- badwolf.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a215292..f2c5cee 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ DOCS = usr.bin.badwolf README.md KnowledgeBase.md CC = cc CFLAGS = -g -Wall -Wextra -Wconversion -Wsign-conversion -CDEPS = `pkg-config --cflags $(DEPS)` -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_DEFAULT_SOURCE -DVERSION=\"$(VERSION_FULL)\" +CDEPS = `pkg-config --cflags $(DEPS)` -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" LIBS = `pkg-config --libs $(DEPS)` all: $(EXE) $(TRANS) diff --git a/badwolf.c b/badwolf.c index bf42eb2..909df75 100644 --- a/badwolf.c +++ b/badwolf.c @@ -11,7 +11,8 @@ #include /* g_fprintf() */ #include /* soup* */ #include /* LC_* */ -#include /* realpath(), malloc() */ +#include /* malloc() */ +#include /* access() */ const gchar *homepage = "https://hacktivis.me/projects/badwolf"; const gchar *version = VERSION; @@ -67,7 +68,7 @@ badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file) { SoupURI *uri = soup_uri_new(text); - if(uri->path == NULL) + if(uri->path == NULL || text == NULL) { soup_uri_free(uri); return "about:blank"; -- cgit v1.3.1-23-gd82d From ccb58d77cc928a2b8403cc6eeee5a6e043ed63db Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 13 Apr 2019 21:18:05 +0200 Subject: .gitlab-ci.yml: New file --- .gitlab-ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..745d549 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,13 @@ +image: alpine:edge + +before_script: + - apk add make clang git + +stages: + - lint + +format: + stage: lint + script: + - make format + - git diff --exit-code -- cgit v1.3.1-23-gd82d From 11872076c71a0da6e673f3aafd530cb29ba5b6c3 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 13 Apr 2019 21:40:13 +0200 Subject: .gitlab-ci.yml: Add build stage --- .gitlab-ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 745d549..68ac809 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,22 @@ image: alpine:edge before_script: - - apk add make clang git + - apk add make clang stages: - lint + - build + +make: + stage: build + script: + - apk add webkit2gtk-dev + - make CC=clang + - make install format: stage: lint script: + - apk add git - make format - git diff --exit-code -- cgit v1.3.1-23-gd82d From 83c164ea8d065cdfb5584abe2c5b1081865bfa30 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 14 Apr 2019 05:41:44 +0200 Subject: .gitlab-ci.yml: Use ArchLinux instead --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 68ac809..dca3dba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ -image: alpine:edge +image: archlinux/base:latest before_script: - - apk add make clang + - pacman -Syu --noconfirm make clang stages: - lint @@ -10,13 +10,13 @@ stages: make: stage: build script: - - apk add webkit2gtk-dev + - pacman -Syu --noconfirm webkit2gtk pkg-config - make CC=clang - make install format: stage: lint script: - - apk add git + - pacman -Syu --noconfirm git - make format - git diff --exit-code -- cgit v1.3.1-23-gd82d From 1d5710d982105b42809f9cccb65a06d56470f196 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 15 Dec 2019 19:35:29 +0100 Subject: .gitlab-ci.yml: Add scan-build --- .gitlab-ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dca3dba..6037ca3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ before_script: stages: - lint - build + - analysis make: stage: build @@ -20,3 +21,11 @@ format: - pacman -Syu --noconfirm git - make format - git diff --exit-code + +scan-build: + stage: analysis + script: + - scan-build -o scan-build make + artifacts: + paths: + - scan-build -- cgit v1.3.1-23-gd82d From 428b76d362be5fb51d50085b01db04af9434926e Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 15 Dec 2019 19:43:09 +0100 Subject: .gitlab-ci.yml: Fix dependencies --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6037ca3..be9011b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ stages: make: stage: build script: - - pacman -Syu --noconfirm webkit2gtk pkg-config + - pacman -Syu --noconfirm webkit2gtk pkg-config gettext - make CC=clang - make install @@ -25,6 +25,7 @@ format: scan-build: stage: analysis script: + - pacman -Syu --noconfirm webkit2gtk pkg-config gettext - scan-build -o scan-build make artifacts: paths: -- cgit v1.3.1-23-gd82d From 30ca22e4ce681a62c8d217c2cd717996150f4da7 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 15 Dec 2019 19:51:22 +0100 Subject: scan-build path --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be9011b..7893114 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,4 +29,4 @@ scan-build: - scan-build -o scan-build make artifacts: paths: - - scan-build + - scan-build/* -- cgit v1.3.1-23-gd82d From 4e144dd01af4855e02ed394c75e8c04c4dae710b Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 15 Dec 2019 20:20:53 +0100 Subject: README.md: gettext --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index baa5c4d..7fa1da3 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Dependencies are: - C11 Compiler (such as clang or gcc) - POSIX make (works with GNU or BSD) - A pkg-config implementation (pkg-config and pkgconf are supported) +- (optionnal) gettext implementation (such as GNU Gettext) Compilation is done with `make`, install with `make install`. An example AppArmor profile is provided at `usr.bin.badwolf`, please do runtime checks before deploying. -- cgit v1.3.1-23-gd82d From 06b34a53c2c7af02fbc673d53b5c13f40c2933a6 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 16 Dec 2019 01:47:12 +0100 Subject: Add tests on badwolf_ensure_uri_scheme --- Makefile | 19 ++++++++++++++----- badwolf.c | 26 +------------------------- badwolf.h | 12 ------------ uri.c | 39 +++++++++++++++++++++++++++++++++++++++ uri.h | 17 +++++++++++++++++ uri_test.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 125 insertions(+), 42 deletions(-) create mode 100644 uri.c create mode 100644 uri.h create mode 100644 uri_test.c diff --git a/Makefile b/Makefile index f2c5cee..c065d79 100644 --- a/Makefile +++ b/Makefile @@ -12,13 +12,15 @@ APPSDIR = $(PREFIX)/share/applications PACKAGE = Badwolf DEPS = gtk+-3.0 webkit2gtk-4.0 libsoup-2.4 -OBJS = keybindings.o badwolf.o +OBJS = uri.o keybindings.o badwolf.o +OBJS_test = uri_test.o EXE = badwolf +EXE_test = uri_test TRANS = fr.mo DOCS = usr.bin.badwolf README.md KnowledgeBase.md CC = cc -CFLAGS = -g -Wall -Wextra -Wconversion -Wsign-conversion +CFLAGS = -g -Wall -Wextra -Wconversion -Wsign-conversion -O2 CDEPS = `pkg-config --cflags $(DEPS)` -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" LIBS = `pkg-config --libs $(DEPS)` @@ -43,6 +45,14 @@ badwolf: $(OBJS) .c.o: $(CC) -std=c11 $(CFLAGS) $(CDEPS) -c -o $@ $< +uri_test: uri.o uri_test.o + $(CC) -std=c11 -o $@ uri.o uri_test.o $(LDFLAGS) $(LIBS) + ./$@ + +.PHONY: test +test: $(EXE_test) + +.PHONY: install install: all mkdir -p $(DESTDIR)$(BINDIR) cp -p badwolf $(DESTDIR)$(BINDIR)/badwolf @@ -56,10 +66,9 @@ install: all cp -p $(DOCS) $(DESTDIR)$(DOCDIR)/ @printf '\nNote: An example AppArmor profile has been installed at '$(DOCDIR)/usr.bin.badwolf'\n' +.PHONY: clean clean: - rm -fr locale $(OBJS) $(EXE) + rm -fr locale $(OBJS) $(OBJS_test) $(EXE) $(EXE_test) format: *.c *.h clang-format -style=file -assume-filename=.clang-format -i *.c *.h - -.PHONY: clean install diff --git a/badwolf.c b/badwolf.c index 909df75..627cb3f 100644 --- a/badwolf.c +++ b/badwolf.c @@ -6,13 +6,13 @@ #include "config.h" #include "keybindings.h" +#include "uri.h" #include /* _() and other internationalization/localization helpers */ #include /* g_fprintf() */ #include /* soup* */ #include /* LC_* */ #include /* malloc() */ -#include /* access() */ const gchar *homepage = "https://hacktivis.me/projects/badwolf"; const gchar *version = VERSION; @@ -63,30 +63,6 @@ static void closeCb_clicked(GtkButton *close, gpointer user_data); static void notebookCb_switch__page(GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data); -const gchar * -badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file) -{ - SoupURI *uri = soup_uri_new(text); - - if(uri->path == NULL || text == NULL) - { - soup_uri_free(uri); - return "about:blank"; - } - - if(uri->scheme != NULL) - { - soup_uri_free(uri); - return text; - } - - soup_uri_free(uri); - - if(try_file && (access(text, R_OK) == 0)) return g_strdup_printf("file://%s", text); - - return g_strdup_printf("http://%s", text); -} - static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data) { diff --git a/badwolf.h b/badwolf.h index 971ffa3..91c05a4 100644 --- a/badwolf.h +++ b/badwolf.h @@ -30,18 +30,6 @@ struct Client GtkWidget *search; }; -/* badwolf_ensure_uri_scheme: tries to add a scheme on a pseudo-URL missing a scheme - * - gchar text: pseudo-URL missing a scheme - * - gboolean try_file: when TRUE check try first if it can be a file:// path - * - * When `text` isn't exploitable (ie. NULL), returns "about:blank", - * when the URL seems to be valid, return it, - * if try_file is TRUE, check if it can be file:// path, - * some other checks might be added. - * In the end use the fallback (`http://` for now, might get configuration), - * might get some safeguard. - */ -const gchar *badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file); GtkWidget *badwolf_new_tab_box(const gchar *title, struct Client *browser); void webView_tab_label_change(struct Client *browser, const gchar *title); struct Client * diff --git a/uri.c b/uri.c new file mode 100644 index 0000000..bc2bc01 --- /dev/null +++ b/uri.c @@ -0,0 +1,39 @@ +// BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser +// Copyright © 2019 Haelwenn (lanodan) Monnier +// SPDX-License-Identifier: BSD-3-Clause + +#include "uri.h" + +#include /* g_fprintf() */ +#include /* soup* */ +#include /* access() */ + +const gchar * +badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file) +{ + const gchar *fallback = "about:blank"; + SoupURI *uri; + + uri = soup_uri_new(text); + if(!uri) return fallback; + + //g_fprintf(stderr, "uri->scheme = %s, uri->path = %s\n", uri->scheme, uri->path); + + if(!uri->path) + { + soup_uri_free(uri); + return fallback; + } + + if(uri->scheme) + { + soup_uri_free(uri); + return text; + } + + soup_uri_free(uri); + + if(try_file && (access(text, R_OK) == 0)) return g_strdup_printf("file://%s", text); + + return g_strdup_printf("http://%s", text); +} diff --git a/uri.h b/uri.h new file mode 100644 index 0000000..cef50b4 --- /dev/null +++ b/uri.h @@ -0,0 +1,17 @@ +#ifndef URI_H_INCLUDED +#define URI_H_INCLUDED +#include + +/* badwolf_ensure_uri_scheme: tries to add a scheme on a pseudo-URL missing a scheme + * - gchar text: pseudo-URL missing a scheme + * - gboolean try_file: when TRUE check try first if it can be a file:// path + * + * When `text` isn't exploitable (ie. NULL), returns "about:blank", + * when the URL seems to be valid, return it, + * if try_file is TRUE, check if it can be file:// path, + * some other checks might be added. + * In the end use the fallback (`http://` for now, might get configuration), + * might get some safeguard. + */ +const gchar *badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file); +#endif /* URI_H_INCLUDED */ diff --git a/uri_test.c b/uri_test.c new file mode 100644 index 0000000..c5ebe7e --- /dev/null +++ b/uri_test.c @@ -0,0 +1,54 @@ +// BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser +// Copyright © 2019 Haelwenn (lanodan) Monnier +// SPDX-License-Identifier: BSD-3-Clause + +#include "uri.h" + +#include +#include + +static void +badwolf_ensure_uri_scheme_test(void) +{ + const gchar *fallback = "about:blank"; + + struct + { + const gchar *expect; + const gchar *text; + gboolean try_file; + } cases[] = { + // clang formatting hack + {fallback, NULL, FALSE}, + {fallback, NULL, TRUE}, + {fallback, "", FALSE}, + {fallback, "", TRUE}, + {fallback, "/dev/null", FALSE}, + //{"file://dev/null", "/dev/null", TRUE}, + //{"http://example.org", "example.org", FALSE}, + //{"http://example.org", "example.org", TRUE}, + //{fallback, "http://", FALSE}, + //{fallback, "http://", TRUE} + }; + + for(size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) + { + g_info("badwolf_ensure_uri_scheme(\"%s\", %s)", + cases[i].text, + cases[i].try_file ? "TRUE" : "FALSE"); + + const gchar *got = badwolf_ensure_uri_scheme(cases[i].text, cases[i].try_file); + + if(got != cases[i].expect) g_error("expected: \"%s\", got: \"%s\"", cases[i].expect, got); + } +} + +int +main(int argc, char *argv[]) +{ + g_test_init(&argc, &argv, NULL); + + g_test_add_func("/badwolf_ensure_uri_scheme/test", badwolf_ensure_uri_scheme_test); + + return g_test_run(); +} -- cgit v1.3.1-23-gd82d From add21f1aa1daac01ad155bd808bfef3e9753448d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 16 Dec 2019 01:52:58 +0100 Subject: .gitlab-ci.yml: test both gcc and clang --- .gitlab-ci.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7893114..5a5ba7d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,9 @@ stages: make: stage: build script: - - pacman -Syu --noconfirm webkit2gtk pkg-config gettext + - pacman -Syu --noconfirm webkit2gtk pkg-config gettext gcc + - make CC=gcc + - make clean - make CC=clang - make install @@ -25,8 +27,11 @@ format: scan-build: stage: analysis script: - - pacman -Syu --noconfirm webkit2gtk pkg-config gettext - - scan-build -o scan-build make + - pacman -Syu --noconfirm webkit2gtk pkg-config gettext gcc + - scan-build --use-cc=gcc -o scan-build-gcc make + - make clean + - scan-build --use-cc=clang -o scan-build-clang make artifacts: paths: - - scan-build/* + - scan-build-gcc/* + - scan-build-clang/* -- cgit v1.3.1-23-gd82d From ffd482d156a0acf02656277d86e10d29d3539363 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 16 Dec 2019 01:54:16 +0100 Subject: .gitlab-ci.yml: run test instead of build --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5a5ba7d..6753a20 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,16 +5,16 @@ before_script: stages: - lint - - build + - test - analysis -make: - stage: build +test: + stage: test script: - pacman -Syu --noconfirm webkit2gtk pkg-config gettext gcc - - make CC=gcc + - make CC=gcc test - make clean - - make CC=clang + - make CC=clang test - make install format: -- cgit v1.3.1-23-gd82d From 9579ef40ff0c16b905a444903688f2f343ff91a6 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 16 Dec 2019 03:24:30 +0100 Subject: uri_test.c: fixup --- Makefile | 2 +- uri_test.c | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index c065d79..2612ad5 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ badwolf: $(OBJS) uri_test: uri.o uri_test.o $(CC) -std=c11 -o $@ uri.o uri_test.o $(LDFLAGS) $(LIBS) - ./$@ + $(DBG) ./$@ .PHONY: test test: $(EXE_test) diff --git a/uri_test.c b/uri_test.c index c5ebe7e..13fa3eb 100644 --- a/uri_test.c +++ b/uri_test.c @@ -18,17 +18,21 @@ badwolf_ensure_uri_scheme_test(void) const gchar *text; gboolean try_file; } cases[] = { - // clang formatting hack + // + {"http://uri.c", "http://uri.c", FALSE}, + {"http://uri.c", "http://uri.c", TRUE}, + {"file:///dev/null", "file:///dev/null", FALSE}, + {"file:///dev/null", "file:///dev/null", TRUE}, {fallback, NULL, FALSE}, {fallback, NULL, TRUE}, {fallback, "", FALSE}, {fallback, "", TRUE}, - {fallback, "/dev/null", FALSE}, - //{"file://dev/null", "/dev/null", TRUE}, - //{"http://example.org", "example.org", FALSE}, - //{"http://example.org", "example.org", TRUE}, - //{fallback, "http://", FALSE}, - //{fallback, "http://", TRUE} + {"http:///dev/null", "/dev/null", FALSE}, + {"file:///dev/null", "/dev/null", TRUE}, + {"http://example.org", "example.org", FALSE}, + {"http://example.org", "example.org", TRUE}, + {"http://", "http://", FALSE}, + {"http://", "http://", TRUE} // }; for(size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) @@ -39,7 +43,10 @@ badwolf_ensure_uri_scheme_test(void) const gchar *got = badwolf_ensure_uri_scheme(cases[i].text, cases[i].try_file); - if(got != cases[i].expect) g_error("expected: \"%s\", got: \"%s\"", cases[i].expect, got); + if(g_strcmp0(got, cases[i].expect) != 0) + { + g_error("expected: \"%s\", got: \"%s\"", cases[i].expect, got); + } } } -- cgit v1.3.1-23-gd82d From b748c68f4c0557e4c663d8d108a45f3edfca1898 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 16 Dec 2019 03:25:15 +0100 Subject: uri.c: Revert to g_uri_parse_scheme() instead of SoupURI --- uri.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/uri.c b/uri.c index bc2bc01..7b97e48 100644 --- a/uri.c +++ b/uri.c @@ -4,6 +4,7 @@ #include "uri.h" +#include /* g_strcmp0() */ #include /* g_fprintf() */ #include /* soup* */ #include /* access() */ @@ -12,26 +13,10 @@ const gchar * badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file) { const gchar *fallback = "about:blank"; - SoupURI *uri; - uri = soup_uri_new(text); - if(!uri) return fallback; + if(g_strcmp0(text, "") <= 0) return fallback; - //g_fprintf(stderr, "uri->scheme = %s, uri->path = %s\n", uri->scheme, uri->path); - - if(!uri->path) - { - soup_uri_free(uri); - return fallback; - } - - if(uri->scheme) - { - soup_uri_free(uri); - return text; - } - - soup_uri_free(uri); + if(g_uri_parse_scheme(text)) return text; if(try_file && (access(text, R_OK) == 0)) return g_strdup_printf("file://%s", text); -- cgit v1.3.1-23-gd82d From 379690e63f294943c27d64a21e68ffb7aa880b22 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 16 Dec 2019 04:07:41 +0100 Subject: README.md: Add note about LibSoup --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7fa1da3..f8cda59 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,11 @@ Motivation from other clients Date: Mon, 16 Dec 2019 04:09:23 +0100 Subject: Makefile: fix for NetBSD make --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 2612ad5..0d9344f 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,7 @@ TRANS = fr.mo DOCS = usr.bin.badwolf README.md KnowledgeBase.md CC = cc +DBG = CFLAGS = -g -Wall -Wextra -Wconversion -Wsign-conversion -O2 CDEPS = `pkg-config --cflags $(DEPS)` -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" LIBS = `pkg-config --libs $(DEPS)` -- cgit v1.3.1-23-gd82d From 3f954fa3e26f437d436260719fb9d3ab4110aa74 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 16 Dec 2019 05:32:40 +0100 Subject: Update translation --- Makefile | 8 ++++--- po/fr.po | 66 ++++++++++++++++++++++++++++++++++++++++++------------- po/messages.pot | 68 +++++++++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 108 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index 0d9344f..8a5dd69 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ APPSDIR = $(PREFIX)/share/applications PACKAGE = Badwolf DEPS = gtk+-3.0 webkit2gtk-4.0 libsoup-2.4 +SRCS = uri.c uri_test.c keybindings.c badwolf.c OBJS = uri.o keybindings.o badwolf.o OBJS_test = uri_test.o EXE = badwolf @@ -24,18 +25,19 @@ DBG = CFLAGS = -g -Wall -Wextra -Wconversion -Wsign-conversion -O2 CDEPS = `pkg-config --cflags $(DEPS)` -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" LIBS = `pkg-config --libs $(DEPS)` +MSGFMT = msgfmt all: $(EXE) $(TRANS) -po/messages.pot: badwolf.c - xgettext --keyword=_ --language=C -o $@ --add-comments --sort-output -j --copyright-holder="Haelwenn (lanodan) Monnier " --package-name="$(PACKAGE)" --package-version="$(shell ./version.sh)" --msgid-bugs-address="contact+badwolf-msgid@hacktivis.me" badwolf.c +po/messages.pot: $(SRCS) + xgettext --keyword=_ --language=C -o $@ --add-comments --sort-output -j --copyright-holder="Haelwenn (lanodan) Monnier " --package-name="$(PACKAGE)" --package-version="$(VERSION_FULL)" --msgid-bugs-address="contact+badwolf-msgid@hacktivis.me" $(SRCS) po/%.po: po/messages.pot msgmerge --update $@ $< ${TRANS}: po/${@:.mo=.po} mkdir -p locale/${@:.mo=}/LC_MESSAGES - msgfmt -o locale/${@:.mo=}/LC_MESSAGES/$(PACKAGE).mo po/${@:.mo=.po} + $(MSGFMT) -o locale/${@:.mo=}/LC_MESSAGES/$(PACKAGE).mo po/${@:.mo=.po} badwolf: $(OBJS) $(CC) -std=c11 -o $@ $(OBJS) $(LDFLAGS) $(LIBS) diff --git a/po/fr.po b/po/fr.po index 2b99fcb..0bf9863 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2019-10-31 14:09+0100\n" +"POT-Creation-Date: 2019-12-16 05:26+0100\n" "PO-Revision-Date: 2019-05-11 05:03+0200\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -17,30 +17,66 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: badwolf.c:527 badwolf.c:692 badwolf.c:719 +#: badwolf.c:378 +msgid "Add Exception" +msgstr "Ajouter une Exception" + +#: badwolf.c:527 badwolf.c:692 badwolf.c:719 badwolf.c:753 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit à la compilation: %d.%d.%d\n" -#: badwolf.c:457 badwolf.c:621 badwolf.c:643 +#: badwolf.c:378 +msgid "Ignore" +msgstr "Ignorer" + +#: badwolf.c:457 badwolf.c:621 badwolf.c:643 badwolf.c:680 msgid "New tab" msgstr "Nouvel onglet" -#: badwolf.c:549 badwolf.c:714 badwolf.c:740 +#: badwolf.c:549 badwolf.c:714 badwolf.c:740 badwolf.c:775 msgid "Open new tab" msgstr "Ouvrir un nouvel onglet" -#: badwolf.c:690 badwolf.c:717 +#: badwolf.c:690 badwolf.c:717 badwolf.c:751 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Version de Badwolf: %s\n" -#: badwolf.c:532 badwolf.c:697 badwolf.c:724 +#: badwolf.c:532 badwolf.c:697 badwolf.c:724 badwolf.c:758 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit au lancement: %d.%d.%d\n" -#: badwolf.c:373 badwolf.c:532 +#: badwolf.c:352 +msgid "Some unknown error occurred validating the certificate\n" +msgstr "Une error inconnue est apparue pendant la validation du certificat\n" + +#: badwolf.c:334 +msgid "The Certificate Authority is unknown.\n" +msgstr "L'autoritée de certification (CA) est inconnue.\n" + +#: badwolf.c:346 +msgid "The certificate has been revoked.\n" +msgstr "Le certificat à été révoqué.\n" + +#: badwolf.c:343 +msgid "The certificate has expired.\n" +msgstr "Le certificat à expiré.\n" + +#: badwolf.c:349 +msgid "The certificate is considered to be insecure.\n" +msgstr "Le certificat est considéré comme non-sécurisé.\n" + +#: badwolf.c:340 +msgid "The certificate isn't valid yet.\n" +msgstr "Le certificat n'est pas encore valide.\n" + +#: badwolf.c:337 +msgid "The given identity doesn't match the expected one.\n" +msgstr "L'identitée ne correspond pas à celle attendue.\n" + +#: badwolf.c:373 badwolf.c:532 badwolf.c:565 msgid "Toggle javascript" msgstr "Activer/Désactiver javascript" @@ -52,38 +88,38 @@ msgstr "A_rrêter" msgid "_Save" msgstr "_Sauvegarder" -#: badwolf.c:413 badwolf.c:572 badwolf.c:573 +#: badwolf.c:413 badwolf.c:572 badwolf.c:573 badwolf.c:606 msgid "search in current page" msgstr "recherche dans la page courante" -#: badwolf.c:100 badwolf.c:234 badwolf.c:118 +#: badwolf.c:100 badwolf.c:234 badwolf.c:118 badwolf.c:94 #, fuzzy msgid "the web process crashed.\n" msgstr "le processus web à cessé de fonctionner.\n" -#: badwolf.c:104 badwolf.c:238 badwolf.c:122 +#: badwolf.c:104 badwolf.c:238 badwolf.c:122 badwolf.c:98 #, fuzzy msgid "the web process exceeded the memory limit.\n" msgstr "le processus web à dépassé la limitation de mémoire.\n" -#: badwolf.c:108 badwolf.c:242 badwolf.c:126 +#: badwolf.c:108 badwolf.c:242 badwolf.c:126 badwolf.c:102 #, fuzzy msgid "the web process terminated for an unknown reason.\n" msgstr "le processus web s’est interrompu pour une raison inconnue.\n" -#: badwolf.c:101 badwolf.c:235 badwolf.c:119 +#: badwolf.c:101 badwolf.c:235 badwolf.c:119 badwolf.c:95 msgid "title|Crashed" msgstr "Crash" -#: badwolf.c:105 badwolf.c:239 badwolf.c:123 +#: badwolf.c:105 badwolf.c:239 badwolf.c:123 badwolf.c:99 msgid "title|Out of Memory" msgstr "Dépassement Mémoire" -#: badwolf.c:109 badwolf.c:243 badwolf.c:127 +#: badwolf.c:109 badwolf.c:243 badwolf.c:127 badwolf.c:103 msgid "title|Unknown Crash" msgstr "Crash inconnu" -#: badwolf.c:730 +#: badwolf.c:730 badwolf.c:765 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "Répertoire webkit-web-extension configuré à %s\n" diff --git a/po/messages.pot b/po/messages.pot index 61da5d2..c50f501 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.3.0+g4b96925\n" +"Project-Id-Version: Badwolf 0.4.0+g5659b01\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2019-10-31 17:40+0100\n" +"POT-Creation-Date: 2019-12-16 05:26+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,30 +17,66 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: badwolf.c:527 badwolf.c:692 badwolf.c:719 +#: badwolf.c:378 +msgid "Add Exception" +msgstr "" + +#: badwolf.c:527 badwolf.c:692 badwolf.c:719 badwolf.c:753 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:457 badwolf.c:621 badwolf.c:643 +#: badwolf.c:378 +msgid "Ignore" +msgstr "" + +#: badwolf.c:457 badwolf.c:621 badwolf.c:643 badwolf.c:680 msgid "New tab" msgstr "" -#: badwolf.c:549 badwolf.c:714 badwolf.c:740 +#: badwolf.c:549 badwolf.c:714 badwolf.c:740 badwolf.c:775 msgid "Open new tab" msgstr "" -#: badwolf.c:690 badwolf.c:717 +#: badwolf.c:690 badwolf.c:717 badwolf.c:751 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:532 badwolf.c:697 badwolf.c:724 +#: badwolf.c:532 badwolf.c:697 badwolf.c:724 badwolf.c:758 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:373 badwolf.c:532 +#: badwolf.c:352 +msgid "Some unknown error occurred validating the certificate\n" +msgstr "" + +#: badwolf.c:334 +msgid "The Certificate Authority is unknown.\n" +msgstr "" + +#: badwolf.c:346 +msgid "The certificate has been revoked.\n" +msgstr "" + +#: badwolf.c:343 +msgid "The certificate has expired.\n" +msgstr "" + +#: badwolf.c:349 +msgid "The certificate is considered to be insecure.\n" +msgstr "" + +#: badwolf.c:340 +msgid "The certificate isn't valid yet.\n" +msgstr "" + +#: badwolf.c:337 +msgid "The given identity doesn't match the expected one.\n" +msgstr "" + +#: badwolf.c:373 badwolf.c:532 badwolf.c:565 msgid "Toggle javascript" msgstr "" @@ -52,35 +88,35 @@ msgstr "" msgid "_Save" msgstr "" -#: badwolf.c:413 badwolf.c:572 badwolf.c:573 +#: badwolf.c:413 badwolf.c:572 badwolf.c:573 badwolf.c:606 msgid "search in current page" msgstr "" -#: badwolf.c:100 badwolf.c:234 badwolf.c:118 +#: badwolf.c:100 badwolf.c:234 badwolf.c:118 badwolf.c:94 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:104 badwolf.c:238 badwolf.c:122 +#: badwolf.c:104 badwolf.c:238 badwolf.c:122 badwolf.c:98 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:108 badwolf.c:242 badwolf.c:126 +#: badwolf.c:108 badwolf.c:242 badwolf.c:126 badwolf.c:102 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:101 badwolf.c:235 badwolf.c:119 +#: badwolf.c:101 badwolf.c:235 badwolf.c:119 badwolf.c:95 msgid "title|Crashed" msgstr "Crashed" -#: badwolf.c:105 badwolf.c:239 badwolf.c:123 +#: badwolf.c:105 badwolf.c:239 badwolf.c:123 badwolf.c:99 msgid "title|Out of Memory" msgstr "Out of Memory" -#: badwolf.c:109 badwolf.c:243 badwolf.c:127 +#: badwolf.c:109 badwolf.c:243 badwolf.c:127 badwolf.c:103 msgid "title|Unknown Crash" msgstr "Unknown Crash" -#: badwolf.c:730 +#: badwolf.c:730 badwolf.c:765 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" -- cgit v1.3.1-23-gd82d From db49a0a36361a742f0e5a1f834fb5fea4e259cb2 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 16 Dec 2019 05:41:03 +0100 Subject: Add more strings to translation --- badwolf.c | 2 +- keybindings.c | 2 +- po/fr.po | 13 +++++++++++-- po/messages.pot | 13 +++++++++++-- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/badwolf.c b/badwolf.c index 627cb3f..e9b7a00 100644 --- a/badwolf.c +++ b/badwolf.c @@ -373,7 +373,7 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, GTK_DIALOG_MODAL & GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_NONE, - "TLS Error for %s.", + _("TLS Error for %s."), failing_text); gtk_dialog_add_buttons(GTK_DIALOG(dialog), _("Add Exception"), 1, _("Ignore"), 0, NULL); gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0); diff --git a/keybindings.c b/keybindings.c index d75a438..0ea4384 100644 --- a/keybindings.c +++ b/keybindings.c @@ -11,7 +11,7 @@ badwolf_about_dialog(GtkWindow *main_window) "license", "SPDX-License-Identifier: BSD-3-Clause", "copyright", "2019 Haelwenn (lanodan) Monnier ", "website", homepage, - "comments", "Minimalist and privacy-oriented WebKitGTK+ browser", + "comments", _("Minimalist and privacy-oriented WebKitGTK+ browser"), "version", version, //FIXME: "logo-icon-name", g_get_application_name(), NULL diff --git a/po/fr.po b/po/fr.po index 0bf9863..d8af0f3 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2019-12-16 05:26+0100\n" -"PO-Revision-Date: 2019-05-11 05:03+0200\n" +"POT-Creation-Date: 2019-12-16 05:37+0100\n" +"PO-Revision-Date: 2019-12-16 05:37+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" "Language: fr\n" @@ -30,6 +30,10 @@ msgstr "Version WebKit à la compilation: %d.%d.%d\n" msgid "Ignore" msgstr "Ignorer" +#: keybindings.c:14 +msgid "Minimalist and privacy-oriented WebKitGTK+ browser" +msgstr "Navigateur WebKitGTK+ minimaliste et orienté vie privée" + #: badwolf.c:457 badwolf.c:621 badwolf.c:643 badwolf.c:680 msgid "New tab" msgstr "Nouvel onglet" @@ -52,6 +56,11 @@ msgstr "Version WebKit au lancement: %d.%d.%d\n" msgid "Some unknown error occurred validating the certificate\n" msgstr "Une error inconnue est apparue pendant la validation du certificat\n" +#: badwolf.c:376 +#, c-format +msgid "TLS Error for %s." +msgstr "Erreur TLS pour %s." + #: badwolf.c:334 msgid "The Certificate Authority is unknown.\n" msgstr "L'autoritée de certification (CA) est inconnue.\n" diff --git a/po/messages.pot b/po/messages.pot index c50f501..a6321ff 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.4.0+g5659b01\n" +"Project-Id-Version: Badwolf 0.4.0+g3f954fa\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2019-12-16 05:26+0100\n" +"POT-Creation-Date: 2019-12-16 05:37+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -30,6 +30,10 @@ msgstr "" msgid "Ignore" msgstr "" +#: keybindings.c:14 +msgid "Minimalist and privacy-oriented WebKitGTK+ browser" +msgstr "" + #: badwolf.c:457 badwolf.c:621 badwolf.c:643 badwolf.c:680 msgid "New tab" msgstr "" @@ -52,6 +56,11 @@ msgstr "" msgid "Some unknown error occurred validating the certificate\n" msgstr "" +#: badwolf.c:376 +#, c-format +msgid "TLS Error for %s." +msgstr "" + #: badwolf.c:334 msgid "The Certificate Authority is unknown.\n" msgstr "" -- cgit v1.3.1-23-gd82d From f91e67e3c7f57fc61bad0dbad337ebf70111ec31 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 16 Dec 2019 05:49:32 +0100 Subject: keybindings.c, uri.c: Fix&clean #include/s --- keybindings.c | 2 ++ uri.c | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keybindings.c b/keybindings.c index 0ea4384..0c39c46 100644 --- a/keybindings.c +++ b/keybindings.c @@ -2,6 +2,8 @@ #include "badwolf.h" +#include /* _() */ + static void badwolf_about_dialog(GtkWindow *main_window) { diff --git a/uri.c b/uri.c index 7b97e48..b287140 100644 --- a/uri.c +++ b/uri.c @@ -4,10 +4,8 @@ #include "uri.h" -#include /* g_strcmp0() */ -#include /* g_fprintf() */ -#include /* soup* */ -#include /* access() */ +#include /* g_strcmp0() */ +#include /* access() */ const gchar * badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file) -- cgit v1.3.1-23-gd82d From b83e68106620bc9832354c51a75e67c58e423e59 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 16 Dec 2019 22:30:25 +0100 Subject: keybindings.c: Grab link activation in About --- keybindings.c | 53 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/keybindings.c b/keybindings.c index 0c39c46..d0126e5 100644 --- a/keybindings.c +++ b/keybindings.c @@ -1,24 +1,49 @@ +// BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser +// Copyright © 2019 Haelwenn (lanodan) Monnier +// SPDX-License-Identifier: BSD-3-Clause + #include "keybindings.h" #include "badwolf.h" #include /* _() */ +static gboolean +about_dialogCb_activate_link(GtkAboutDialog *about_dialog, gchar *uri, gpointer user_data) +{ + (void)about_dialog; + struct Window *window = (struct Window *)user_data; + + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, uri, NULL)); + + gtk_widget_destroy(GTK_WIDGET(about_dialog)); + + return TRUE; +} + static void -badwolf_about_dialog(GtkWindow *main_window) +badwolf_about_dialog(GtkWindow *main_window, gpointer user_data) { - // clang-format off - gtk_show_about_dialog( - main_window, - "license", "SPDX-License-Identifier: BSD-3-Clause", - "copyright", "2019 Haelwenn (lanodan) Monnier ", - "website", homepage, - "comments", _("Minimalist and privacy-oriented WebKitGTK+ browser"), - "version", version, - //FIXME: "logo-icon-name", g_get_application_name(), - NULL - ); - // clang-format on + struct Window *window = (struct Window *)user_data; + GtkWidget *about_dialog = gtk_about_dialog_new(); + + gtk_window_set_transient_for(GTK_WINDOW(about_dialog), main_window); + gtk_window_set_destroy_with_parent(GTK_WINDOW(about_dialog), TRUE); + + gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(about_dialog), + "SPDX-License-Identifier: BSD-3-Clause"); + gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about_dialog), + "2019 Haelwenn (lanodan) Monnier "); + gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about_dialog), homepage); + gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about_dialog), + _("Minimalist and privacy-oriented WebKitGTK+ browser")); + gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about_dialog), version); + + g_signal_connect( + about_dialog, "activate-link", G_CALLBACK(about_dialogCb_activate_link), window); + + (void)gtk_dialog_run(GTK_DIALOG(about_dialog)); + gtk_widget_destroy(about_dialog); } static void @@ -113,7 +138,7 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client * { switch(((GdkEventKey *)event)->keyval) { - case GDK_KEY_F1: badwolf_about_dialog(GTK_WINDOW(window->main_window)); return TRUE; + case GDK_KEY_F1: badwolf_about_dialog(GTK_WINDOW(window->main_window), window); return TRUE; } } -- cgit v1.3.1-23-gd82d From 0dc338ad3f7c7789960f25ce6c4a2e2c886e2307 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 18 Dec 2019 16:27:46 +0100 Subject: Add GtkSettings overwrite on dark-theme Bug: https://bugs.webkit.org/show_bug.cgi?id=197947 --- badwolf.c | 7 +++++++ config.h | 6 ++++++ keybindings.c | 5 ++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/badwolf.c b/badwolf.c index e9b7a00..2467ce4 100644 --- a/badwolf.c +++ b/badwolf.c @@ -748,6 +748,13 @@ main(int argc, char *argv[]) gtk_init(&argc, &argv); +#ifdef BADWOLF_PREFER_DARK_THEME + g_object_set(gtk_settings_get_default(), + "gtk-application-prefer-dark-theme", + BADWOLF_PREFER_DARK_THEME, + NULL); +#endif + g_fprintf(stderr, _("Running Badwolf version: %s\n"), version); g_fprintf(stderr, _("Buildtime WebKit version: %d.%d.%d\n"), diff --git a/config.h b/config.h index 4aa5c5a..c88d59d 100644 --- a/config.h +++ b/config.h @@ -86,4 +86,10 @@ */ #define BADWOLF_STATUSLABEL_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE +/* BADWOLF_PREFER_DARK_THEME: Overwrites user GtkSettings for gtk-application-prefer-dark-theme + * Done as a temporary workaround against https://bugs.webkit.org/show_bug.cgi?id=197947 + * Remove definition to keep user settings, should only be done once the bug is fixed. + */ +#define BADWOLF_PREFER_DARK_THEME FALSE + #endif /* CONFIG_H_INCLUDED */ diff --git a/keybindings.c b/keybindings.c index d0126e5..b5e9228 100644 --- a/keybindings.c +++ b/keybindings.c @@ -24,7 +24,7 @@ about_dialogCb_activate_link(GtkAboutDialog *about_dialog, gchar *uri, gpointer static void badwolf_about_dialog(GtkWindow *main_window, gpointer user_data) { - struct Window *window = (struct Window *)user_data; + struct Window *window = (struct Window *)user_data; GtkWidget *about_dialog = gtk_about_dialog_new(); gtk_window_set_transient_for(GTK_WINDOW(about_dialog), main_window); @@ -39,8 +39,7 @@ badwolf_about_dialog(GtkWindow *main_window, gpointer user_data) _("Minimalist and privacy-oriented WebKitGTK+ browser")); gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about_dialog), version); - g_signal_connect( - about_dialog, "activate-link", G_CALLBACK(about_dialogCb_activate_link), window); + g_signal_connect(about_dialog, "activate-link", G_CALLBACK(about_dialogCb_activate_link), window); (void)gtk_dialog_run(GTK_DIALOG(about_dialog)); gtk_widget_destroy(about_dialog); -- cgit v1.3.1-23-gd82d From 607300e550bd06e32875030797829977904d5a78 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 22 Dec 2019 00:39:05 +0100 Subject: badwolf.c: Improve TLS Error messages --- badwolf.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/badwolf.c b/badwolf.c index 2467ce4..1c94da4 100644 --- a/badwolf.c +++ b/badwolf.c @@ -330,26 +330,28 @@ detail_tls_certificate_flags(GTlsCertificateFlags tls_errors) { GString *errors = g_string_new(NULL); + g_string_append_printf(errors, _("Couldn't verify the TLS certificate to ensure a better security of the connection. You might want to verify your machine and network.\n\n")); + if(tls_errors & G_TLS_CERTIFICATE_UNKNOWN_CA) - g_string_append_printf(errors, _("The Certificate Authority is unknown.\n")); + g_string_append_printf(errors, _("Error: The X509 Certificate Authority is unknown.\n")); if(tls_errors & G_TLS_CERTIFICATE_BAD_IDENTITY) - g_string_append(errors, _("The given identity doesn't match the expected one.\n")); + g_string_append(errors, _("Error: The given identity doesn't match the expected one.\n")); if(tls_errors & G_TLS_CERTIFICATE_NOT_ACTIVATED) - g_string_append(errors, _("The certificate isn't valid yet.\n")); + g_string_append(errors, _("Error: The certificate isn't valid yet. Check your system's clock.\n")); if(tls_errors & G_TLS_CERTIFICATE_EXPIRED) - g_string_append(errors, _("The certificate has expired.\n")); + g_string_append(errors, _("Error: The certificate has expired. Check your system's clock.\n")); if(tls_errors & G_TLS_CERTIFICATE_REVOKED) - g_string_append(errors, _("The certificate has been revoked.\n")); + g_string_append(errors, _("Error: The certificate has been revoked.\n")); if(tls_errors & G_TLS_CERTIFICATE_INSECURE) - g_string_append(errors, _("The certificate is considered to be insecure.\n")); + g_string_append(errors, _("Error: The certificate is considered to be insecure.\n")); if(tls_errors & G_TLS_CERTIFICATE_GENERIC_ERROR) - g_string_append(errors, _("Some unknown error occurred validating the certificate\n")); + g_string_append(errors, _("Error: Some unknown error occurred validating the certificate.\n")); return g_string_free(errors, FALSE); } @@ -375,7 +377,7 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, GTK_BUTTONS_NONE, _("TLS Error for %s."), failing_text); - gtk_dialog_add_buttons(GTK_DIALOG(dialog), _("Add Exception"), 1, _("Ignore"), 0, NULL); + gtk_dialog_add_buttons(GTK_DIALOG(dialog), _("Temporarly Add Exception"), 1, _("Continue"), 0, NULL); gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0); gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), "%s\n", error_details); -- cgit v1.3.1-23-gd82d From 3c2ee134e9f6aae03aa28edce2d185d6c3e582a8 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 22 Dec 2019 01:14:37 +0100 Subject: Update translation --- Makefile | 2 +- badwolf.c | 6 +++ po/fr.po | 129 +++++++++++++++++++++++++++++--------------------------- po/messages.pot | 112 ++++++++++++++++++++++++------------------------ 4 files changed, 133 insertions(+), 116 deletions(-) diff --git a/Makefile b/Makefile index 8a5dd69..f3fcbc5 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ MSGFMT = msgfmt all: $(EXE) $(TRANS) po/messages.pot: $(SRCS) - xgettext --keyword=_ --language=C -o $@ --add-comments --sort-output -j --copyright-holder="Haelwenn (lanodan) Monnier " --package-name="$(PACKAGE)" --package-version="$(VERSION_FULL)" --msgid-bugs-address="contact+badwolf-msgid@hacktivis.me" $(SRCS) + xgettext --keyword=_ --language=C --from-code=UTF-8 -o $@ --add-comments --sort-output --copyright-holder="Haelwenn (lanodan) Monnier " --package-name="$(PACKAGE)" --package-version="$(VERSION_FULL)" --msgid-bugs-address="contact+badwolf-msgid@hacktivis.me" $(SRCS) po/%.po: po/messages.pot msgmerge --update $@ $< diff --git a/badwolf.c b/badwolf.c index 1c94da4..c513bf1 100644 --- a/badwolf.c +++ b/badwolf.c @@ -807,5 +807,11 @@ main(int argc, char *argv[]) gtk_widget_show_all(window->main_window); gtk_main(); + +#if 0 + /* TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. */ + _("ø"); +#endif + return 0; } diff --git a/po/fr.po b/po/fr.po index d8af0f3..e83eab4 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2019-12-16 05:37+0100\n" -"PO-Revision-Date: 2019-12-16 05:37+0100\n" +"POT-Creation-Date: 2019-12-22 00:57+0100\n" +"PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" "Language: fr\n" @@ -17,118 +17,125 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: badwolf.c:378 -msgid "Add Exception" -msgstr "Ajouter une Exception" - -#: badwolf.c:527 badwolf.c:692 badwolf.c:719 badwolf.c:753 +#: badwolf.c:760 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit à la compilation: %d.%d.%d\n" #: badwolf.c:378 -msgid "Ignore" -msgstr "Ignorer" +msgid "Continue" +msgstr "Continuer" + +#: badwolf.c:331 +msgid "" +"Couldn't verify the TLS certificate to ensure a better security of the " +"connection. You might want to verify your machine and network.\n" +"\n" +msgstr "" +"Impossibilitée de vérifier le certificat TLS pour assurer une meilleure " +"sécurité de la connection. Penser potentiellement à vérifier votre machine " +"et son réseau.\n" +"\n" + +#: badwolf.c:352 +msgid "Error: Some unknown error occurred validating the certificate.\n" +msgstr "" +"Erreur : Une error inconnue est apparue pendant la validation du " +"certificat.\n" + +#: badwolf.c:334 +msgid "Error: The X509 Certificate Authority is unknown.\n" +msgstr "Erreur : L'autoritée de certification (CA X509) est inconnue.\n" + +#: badwolf.c:346 +msgid "Error: The certificate has been revoked.\n" +msgstr "Erreur : Le certificat à été révoqué.\n" + +#: badwolf.c:343 +msgid "Error: The certificate has expired. Check your system's clock.\n" +msgstr "Erreur : Le certificat à expiré.\n" + +#: badwolf.c:349 +msgid "Error: The certificate is considered to be insecure.\n" +msgstr "Erreur : Le certificat est considéré comme non-sécurisé.\n" + +#: badwolf.c:340 +msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" +msgstr "Erreur : Le certificat n'est pas encore valide.\n" + +#: badwolf.c:337 +msgid "Error: The given identity doesn't match the expected one.\n" +msgstr "Erreur : L'identitée ne correspond pas à celle attendue.\n" -#: keybindings.c:14 +#: keybindings.c:39 msgid "Minimalist and privacy-oriented WebKitGTK+ browser" msgstr "Navigateur WebKitGTK+ minimaliste et orienté vie privée" -#: badwolf.c:457 badwolf.c:621 badwolf.c:643 badwolf.c:680 +#: badwolf.c:680 msgid "New tab" msgstr "Nouvel onglet" -#: badwolf.c:549 badwolf.c:714 badwolf.c:740 badwolf.c:775 +#: badwolf.c:782 msgid "Open new tab" msgstr "Ouvrir un nouvel onglet" -#: badwolf.c:690 badwolf.c:717 badwolf.c:751 +#: badwolf.c:758 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Version de Badwolf: %s\n" -#: badwolf.c:532 badwolf.c:697 badwolf.c:724 badwolf.c:758 +#: badwolf.c:765 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit au lancement: %d.%d.%d\n" -#: badwolf.c:352 -msgid "Some unknown error occurred validating the certificate\n" -msgstr "Une error inconnue est apparue pendant la validation du certificat\n" - #: badwolf.c:376 #, c-format msgid "TLS Error for %s." msgstr "Erreur TLS pour %s." -#: badwolf.c:334 -msgid "The Certificate Authority is unknown.\n" -msgstr "L'autoritée de certification (CA) est inconnue.\n" - -#: badwolf.c:346 -msgid "The certificate has been revoked.\n" -msgstr "Le certificat à été révoqué.\n" - -#: badwolf.c:343 -msgid "The certificate has expired.\n" -msgstr "Le certificat à expiré.\n" - -#: badwolf.c:349 -msgid "The certificate is considered to be insecure.\n" -msgstr "Le certificat est considéré comme non-sécurisé.\n" - -#: badwolf.c:340 -msgid "The certificate isn't valid yet.\n" -msgstr "Le certificat n'est pas encore valide.\n" - -#: badwolf.c:337 -msgid "The given identity doesn't match the expected one.\n" -msgstr "L'identitée ne correspond pas à celle attendue.\n" +#: badwolf.c:378 +msgid "Temporarly Add Exception" +msgstr "Ajouter Temporairement une Exception" -#: badwolf.c:373 badwolf.c:532 badwolf.c:565 +#: badwolf.c:565 msgid "Toggle javascript" msgstr "Activer/Désactiver javascript" -#: badwolf.c:382 -msgid "_Cancel" -msgstr "A_rrêter" - -#: badwolf.c:384 -msgid "_Save" -msgstr "_Sauvegarder" - -#: badwolf.c:413 badwolf.c:572 badwolf.c:573 badwolf.c:606 +#: badwolf.c:606 msgid "search in current page" msgstr "recherche dans la page courante" -#: badwolf.c:100 badwolf.c:234 badwolf.c:118 badwolf.c:94 -#, fuzzy +#: badwolf.c:92 msgid "the web process crashed.\n" msgstr "le processus web à cessé de fonctionner.\n" -#: badwolf.c:104 badwolf.c:238 badwolf.c:122 badwolf.c:98 -#, fuzzy +#: badwolf.c:96 msgid "the web process exceeded the memory limit.\n" msgstr "le processus web à dépassé la limitation de mémoire.\n" -#: badwolf.c:108 badwolf.c:242 badwolf.c:126 badwolf.c:102 -#, fuzzy +#: badwolf.c:100 msgid "the web process terminated for an unknown reason.\n" msgstr "le processus web s’est interrompu pour une raison inconnue.\n" -#: badwolf.c:101 badwolf.c:235 badwolf.c:119 badwolf.c:95 +#: badwolf.c:93 msgid "title|Crashed" msgstr "Crash" -#: badwolf.c:105 badwolf.c:239 badwolf.c:123 badwolf.c:99 +#: badwolf.c:97 msgid "title|Out of Memory" msgstr "Dépassement Mémoire" -#: badwolf.c:109 badwolf.c:243 badwolf.c:127 badwolf.c:103 +#: badwolf.c:101 msgid "title|Unknown Crash" msgstr "Crash inconnu" -#: badwolf.c:730 badwolf.c:765 +#: badwolf.c:772 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "Répertoire webkit-web-extension configuré à %s\n" + +#. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. +#: badwolf.c:811 +msgid "ø" +msgstr "" diff --git a/po/messages.pot b/po/messages.pot index a6321ff..3e497fd 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.4.0+g3f954fa\n" +"Project-Id-Version: Badwolf 0.4.0+g607300e\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2019-12-16 05:37+0100\n" +"POT-Creation-Date: 2019-12-22 00:57+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,115 +17,119 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: badwolf.c:378 -msgid "Add Exception" -msgstr "" - -#: badwolf.c:527 badwolf.c:692 badwolf.c:719 badwolf.c:753 +#: badwolf.c:760 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" #: badwolf.c:378 -msgid "Ignore" +msgid "Continue" msgstr "" -#: keybindings.c:14 -msgid "Minimalist and privacy-oriented WebKitGTK+ browser" +#: badwolf.c:331 +msgid "" +"Couldn't verify the TLS certificate to ensure a better security of the " +"connection. You might want to verify your machine and network.\n" +"\n" msgstr "" -#: badwolf.c:457 badwolf.c:621 badwolf.c:643 badwolf.c:680 -msgid "New tab" +#: badwolf.c:352 +msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:549 badwolf.c:714 badwolf.c:740 badwolf.c:775 -msgid "Open new tab" +#: badwolf.c:334 +msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:690 badwolf.c:717 badwolf.c:751 -#, c-format -msgid "Running Badwolf version: %s\n" +#: badwolf.c:346 +msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:532 badwolf.c:697 badwolf.c:724 badwolf.c:758 -#, c-format -msgid "Runtime WebKit version: %d.%d.%d\n" +#: badwolf.c:343 +msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:352 -msgid "Some unknown error occurred validating the certificate\n" +#: badwolf.c:349 +msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:376 -#, c-format -msgid "TLS Error for %s." +#: badwolf.c:340 +msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:334 -msgid "The Certificate Authority is unknown.\n" +#: badwolf.c:337 +msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" -#: badwolf.c:346 -msgid "The certificate has been revoked.\n" +#: keybindings.c:39 +msgid "Minimalist and privacy-oriented WebKitGTK+ browser" msgstr "" -#: badwolf.c:343 -msgid "The certificate has expired.\n" +#: badwolf.c:680 +msgid "New tab" msgstr "" -#: badwolf.c:349 -msgid "The certificate is considered to be insecure.\n" +#: badwolf.c:782 +msgid "Open new tab" msgstr "" -#: badwolf.c:340 -msgid "The certificate isn't valid yet.\n" +#: badwolf.c:758 +#, c-format +msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:337 -msgid "The given identity doesn't match the expected one.\n" +#: badwolf.c:765 +#, c-format +msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:373 badwolf.c:532 badwolf.c:565 -msgid "Toggle javascript" +#: badwolf.c:376 +#, c-format +msgid "TLS Error for %s." msgstr "" -#: badwolf.c:382 -msgid "_Cancel" +#: badwolf.c:378 +msgid "Temporarly Add Exception" msgstr "" -#: badwolf.c:384 -msgid "_Save" +#: badwolf.c:565 +msgid "Toggle javascript" msgstr "" -#: badwolf.c:413 badwolf.c:572 badwolf.c:573 badwolf.c:606 +#: badwolf.c:606 msgid "search in current page" msgstr "" -#: badwolf.c:100 badwolf.c:234 badwolf.c:118 badwolf.c:94 +#: badwolf.c:92 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:104 badwolf.c:238 badwolf.c:122 badwolf.c:98 +#: badwolf.c:96 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:108 badwolf.c:242 badwolf.c:126 badwolf.c:102 +#: badwolf.c:100 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:101 badwolf.c:235 badwolf.c:119 badwolf.c:95 +#: badwolf.c:93 msgid "title|Crashed" -msgstr "Crashed" +msgstr "" -#: badwolf.c:105 badwolf.c:239 badwolf.c:123 badwolf.c:99 +#: badwolf.c:97 msgid "title|Out of Memory" -msgstr "Out of Memory" +msgstr "" -#: badwolf.c:109 badwolf.c:243 badwolf.c:127 badwolf.c:103 +#: badwolf.c:101 msgid "title|Unknown Crash" -msgstr "Unknown Crash" +msgstr "" -#: badwolf.c:730 badwolf.c:765 +#: badwolf.c:772 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" + +#. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. +#: badwolf.c:811 +msgid "ø" +msgstr "" -- cgit v1.3.1-23-gd82d From e7feb699ddf109e3d31827999721b19e4c310a6d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 22 Dec 2019 01:38:49 +0100 Subject: po/fr.po: Corrections https://twinkaga.in/objects/6a2914e5-5481-4b48-9d04-963a5aaa9bf2 --- po/fr.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/po/fr.po b/po/fr.po index e83eab4..e4d49cc 100644 --- a/po/fr.po +++ b/po/fr.po @@ -32,20 +32,20 @@ msgid "" "connection. You might want to verify your machine and network.\n" "\n" msgstr "" -"Impossibilitée de vérifier le certificat TLS pour assurer une meilleure " -"sécurité de la connection. Penser potentiellement à vérifier votre machine " +"Impossibilité de vérifier le certificat TLS pour assurer une meilleure " +"sécurité de la connection. Pensez potentiellement à vérifier votre machine " "et son réseau.\n" "\n" #: badwolf.c:352 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -"Erreur : Une error inconnue est apparue pendant la validation du " +"Erreur : Une erreur inconnue est apparue pendant la validation du " "certificat.\n" #: badwolf.c:334 msgid "Error: The X509 Certificate Authority is unknown.\n" -msgstr "Erreur : L'autoritée de certification (CA X509) est inconnue.\n" +msgstr "Erreur : L'autorité de certification (CA X509) est inconnue.\n" #: badwolf.c:346 msgid "Error: The certificate has been revoked.\n" @@ -53,7 +53,7 @@ msgstr "Erreur : Le certificat à été révoqué.\n" #: badwolf.c:343 msgid "Error: The certificate has expired. Check your system's clock.\n" -msgstr "Erreur : Le certificat à expiré.\n" +msgstr "Erreur : Le certificat a expiré.\n" #: badwolf.c:349 msgid "Error: The certificate is considered to be insecure.\n" @@ -65,7 +65,7 @@ msgstr "Erreur : Le certificat n'est pas encore valide.\n" #: badwolf.c:337 msgid "Error: The given identity doesn't match the expected one.\n" -msgstr "Erreur : L'identitée ne correspond pas à celle attendue.\n" +msgstr "Erreur : L'identité ne correspond pas à celle attendue.\n" #: keybindings.c:39 msgid "Minimalist and privacy-oriented WebKitGTK+ browser" @@ -108,11 +108,11 @@ msgstr "recherche dans la page courante" #: badwolf.c:92 msgid "the web process crashed.\n" -msgstr "le processus web à cessé de fonctionner.\n" +msgstr "le processus web a cessé de fonctionner.\n" #: badwolf.c:96 msgid "the web process exceeded the memory limit.\n" -msgstr "le processus web à dépassé la limitation de mémoire.\n" +msgstr "le processus web a dépassé la limitation de mémoire.\n" #: badwolf.c:100 msgid "the web process terminated for an unknown reason.\n" -- cgit v1.3.1-23-gd82d From d2fc907c4be771e790feff5b87647df75ebef7fa Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 8 Jan 2020 04:28:50 +0100 Subject: COPYING: New file Copyright is assigned to the project rather than myself for future-proof ability --- COPYING | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 COPYING diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..6ba3f5f --- /dev/null +++ b/COPYING @@ -0,0 +1,26 @@ +Copyright (c) 2019-2020, Badwolf Authors +All rights reserved. + +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. +3. Neither the name of the nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER 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. -- cgit v1.3.1-23-gd82d From 42f87f328e7e53ca317eeb90378d09cc28543517 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 8 Jan 2020 05:18:19 +0100 Subject: badwolf.c: fix formatting --- badwolf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/badwolf.c b/badwolf.c index c513bf1..bfffef4 100644 --- a/badwolf.c +++ b/badwolf.c @@ -330,7 +330,9 @@ detail_tls_certificate_flags(GTlsCertificateFlags tls_errors) { GString *errors = g_string_new(NULL); - g_string_append_printf(errors, _("Couldn't verify the TLS certificate to ensure a better security of the connection. You might want to verify your machine and network.\n\n")); + g_string_append_printf(errors, + _("Couldn't verify the TLS certificate to ensure a better security of the " + "connection. You might want to verify your machine and network.\n\n")); if(tls_errors & G_TLS_CERTIFICATE_UNKNOWN_CA) g_string_append_printf(errors, _("Error: The X509 Certificate Authority is unknown.\n")); @@ -339,7 +341,8 @@ detail_tls_certificate_flags(GTlsCertificateFlags tls_errors) g_string_append(errors, _("Error: The given identity doesn't match the expected one.\n")); if(tls_errors & G_TLS_CERTIFICATE_NOT_ACTIVATED) - g_string_append(errors, _("Error: The certificate isn't valid yet. Check your system's clock.\n")); + g_string_append(errors, + _("Error: The certificate isn't valid yet. Check your system's clock.\n")); if(tls_errors & G_TLS_CERTIFICATE_EXPIRED) g_string_append(errors, _("Error: The certificate has expired. Check your system's clock.\n")); @@ -377,7 +380,8 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, GTK_BUTTONS_NONE, _("TLS Error for %s."), failing_text); - gtk_dialog_add_buttons(GTK_DIALOG(dialog), _("Temporarly Add Exception"), 1, _("Continue"), 0, NULL); + gtk_dialog_add_buttons( + GTK_DIALOG(dialog), _("Temporarly Add Exception"), 1, _("Continue"), 0, NULL); gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0); gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), "%s\n", error_details); -- cgit v1.3.1-23-gd82d From 3d066fb243e8e94e73fcdc51e79e6088dc6d3de9 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 8 Jan 2020 10:08:31 +0100 Subject: decisions.md: New file --- decisions.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 decisions.md diff --git a/decisions.md b/decisions.md new file mode 100644 index 0000000..6ee4e5a --- /dev/null +++ b/decisions.md @@ -0,0 +1,33 @@ +# Decisions taken over the project lifetime +## What is this? +See +Bascially, the idea is to have a file in your projects repo, where you record +the decisions you make over the course of the project's lifetime. +Rewriting history will not be done but Post-Scriptum notices will. + +## 2020-01-08 08:42:00Z : Start of the decisions.md file +From memory and git log: + +- Changelog is done when preparing for a release, it is copied into the git tag description. This means that there isn't a central file and isn't a changelog entry added with commits. +- OpenPGP is deprecated in favor of signify, reasons being security and portability. +- Prefer using lower and more standard/ubiquitous layers for implementations, one example is the about information with printf and Gtk Dialog rather than a custom scheme in WebKitGTK. + - using GLib instead of POSIX was done at first but the quality/behaviour of GLib (like `g_malloc()` calling `abort()` on errors) reverted this decision. +- WebKitGTK was picked because it is the only WebKit port which is maintained enough without a bus-factor (consider giving QtWebKit a hand too?). +- The `.clang-format` file was copied from the one living in my home directory: + - function declaration is at the start of the line to allow jumping to it with a simple editor + - braces on their own lines to allow for comments space + - "tabs for indentation and space for alignement" style is used for flexibility +- mdoc was picked over other formats for the manpage, as it is implemented in mandoc and GNU groff, much simpler to read/write and transform to other formats (like HTML or Markdown). +- Markdown was picked over other formats for informal documentation, it is a simple format supported by most forges, a format which is easier to write and parse could be considered +- Proprietary systems are not supported for their lack of auditability and transparency. +- C was picked because: + 1. I wanted to avoid being limited by binding completeness or model + 2. I think it is a good language which is fit for this purpose provided you are careful enough (such as using LLVM to it's full potential for checks) + 3. It is portable and doesn't introduces more dependencies than is already needed +- POSIX was picked for it's portability (only known one where it's absent is Windows but it's not going to be supported) +- Writing a portable (almost POSIX-only) Makefile with `pkg-config(1)` was picked over other build systems which tend to be over-complicated and rely on only one implementation. +- Originally the URL entry accepted only valid URLs, this was changed to a bit of heuristics for fixing it when it was entered by the user. +- No search entry is provided, this is to encourage users to avoid search engines as much as possible, support for SmartBookmarks with keywords (similar to DuckDuckGo/Searx !bangs) will be added after support for suggestions via bookmarks +- Bookmarks are first-class citizens as they are data explicitely controlled by the user +- No browsing history is provided, this is to encourage to use and improve bookmarks, it will be added later on with data retention limits, ability to wipe it and non-reachable from WebKit (and so the Wild Web). +- Javascript is turned off by default with a checkbox to enable it temporarly, Permissions Requests (microphone, geolocation, …) are all denied, something similar to uMatrix and NoScript will eventually be done to fix this -- cgit v1.3.1-23-gd82d From e97228fc74b15026f2c8db56c069ffed11898d4d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 8 Jan 2020 10:07:13 +0100 Subject: badwolf.c: g_fprintf → fprintf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- badwolf.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/badwolf.c b/badwolf.c index bfffef4..d46c91c 100644 --- a/badwolf.c +++ b/badwolf.c @@ -9,9 +9,9 @@ #include "uri.h" #include /* _() and other internationalization/localization helpers */ -#include /* g_fprintf() */ #include /* soup* */ #include /* LC_* */ +#include /* fprintf() */ #include /* malloc() */ const gchar *homepage = "https://hacktivis.me/projects/badwolf"; @@ -91,15 +91,15 @@ WebViewCb_web_process_terminated(WebKitWebView *webView, switch(reason) { case WEBKIT_WEB_PROCESS_CRASHED: - g_fprintf(stderr, _("the web process crashed.\n")); + fprintf(stderr, _("the web process crashed.\n")); webView_tab_label_change(browser, _("title|Crashed")); break; case WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT: - g_fprintf(stderr, _("the web process exceeded the memory limit.\n")); + fprintf(stderr, _("the web process exceeded the memory limit.\n")); webView_tab_label_change(browser, _("title|Out of Memory")); break; default: - g_fprintf(stderr, _("the web process terminated for an unknown reason.\n")); + fprintf(stderr, _("the web process terminated for an unknown reason.\n")); webView_tab_label_change(browser, _("title|Unknown Crash")); } @@ -761,21 +761,21 @@ main(int argc, char *argv[]) NULL); #endif - g_fprintf(stderr, _("Running Badwolf version: %s\n"), version); - g_fprintf(stderr, - _("Buildtime WebKit version: %d.%d.%d\n"), - WEBKIT_MAJOR_VERSION, - WEBKIT_MINOR_VERSION, - WEBKIT_MICRO_VERSION); - g_fprintf(stderr, - _("Runtime WebKit version: %d.%d.%d\n"), - webkit_get_major_version(), - webkit_get_minor_version(), - webkit_get_micro_version()); + fprintf(stderr, _("Running Badwolf version: %s\n"), version); + fprintf(stderr, + _("Buildtime WebKit version: %d.%d.%d\n"), + WEBKIT_MAJOR_VERSION, + WEBKIT_MINOR_VERSION, + WEBKIT_MICRO_VERSION); + fprintf(stderr, + _("Runtime WebKit version: %d.%d.%d\n"), + webkit_get_major_version(), + webkit_get_minor_version(), + webkit_get_micro_version()); web_extensions_directory = g_build_filename(g_get_user_data_dir(), "badwolf", "webkit-web-extension", NULL); - g_fprintf(stderr, _("webkit-web-extension directory set to: %s\n"), web_extensions_directory); + fprintf(stderr, _("webkit-web-extension directory set to: %s\n"), web_extensions_directory); window->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); window->notebook = gtk_notebook_new(); -- cgit v1.3.1-23-gd82d From ccc42ba4f8e1e87f949b055c77d875be450aff48 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 8 Jan 2020 10:08:05 +0100 Subject: badwolf.c: g_malloc → malloc+perror+exit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- badwolf.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/badwolf.c b/badwolf.c index d46c91c..74f6a7f 100644 --- a/badwolf.c +++ b/badwolf.c @@ -11,7 +11,7 @@ #include /* _() and other internationalization/localization helpers */ #include /* soup* */ #include /* LC_* */ -#include /* fprintf() */ +#include /* perror(), fprintf() */ #include /* malloc() */ const gchar *homepage = "https://hacktivis.me/projects/badwolf"; @@ -745,7 +745,12 @@ int main(int argc, char *argv[]) { // getting an abort if this one fails to alloc - struct Window *window = g_malloc(sizeof(struct Window)); + struct Window *window = malloc(sizeof(struct Window)); + if(window == NULL) + { + perror("malloc"); + return 1; + } setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, DATADIR "/locale"); -- cgit v1.3.1-23-gd82d From 7b797bfa1b22b5238a37ba281c59f477b00715e7 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 18 Jan 2020 20:37:24 +0100 Subject: README: Document doing translations --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index f8cda59..8b5d974 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,14 @@ Comparing from other small WebKit browsers for unixes found in the wild: Motivation from other clients +## Contributing +### Translations +You need to have gettext installed. If you want a GUI, poedit exists and Weblate is a good web platform that I might consider hosting at some point. + +- Syncing POT file with the source code: ``make po/messages.pot`` +- Syncing PO file with the POT file: ``make po/de.po`` +- Initialising a new PO file (example for German, `de_DE`): ``msginit -l de_DE -i po/messages.pot -o po/de.po`` + ## Repositories ### git - Main: , -- cgit v1.3.1-23-gd82d From 03e5ee8158b64e70b629dcf77c974b9dcea65d92 Mon Sep 17 00:00:00 2001 From: Pedro Lucas Porcellis Date: Tue, 21 Jan 2020 22:24:14 -0300 Subject: Add pt_BR translation Signed-off-by: Haelwenn (lanodan) Monnier --- po/pt_BR.po | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 po/pt_BR.po diff --git a/po/pt_BR.po b/po/pt_BR.po new file mode 100644 index 0000000..5e57452 --- /dev/null +++ b/po/pt_BR.po @@ -0,0 +1,145 @@ +# BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser +# Copyright (C) 2020 Haelwenn (lanodan) Monnier +# This file is distributed under the same license as the Badwolf package. +# Haelwenn (lanodan) Monnier , 2020 +# +msgid "" +msgstr "" +"Project-Id-Version: Badwolf 0.4.0+g607300e\n" +"Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" +"POT-Creation-Date: 2019-12-22 00:57+0100\n" +"PO-Revision-Date: 2020-01-20 22:17-0300\n" +"Last-Translator: Pedro Lucas Porcellis \n" +"Language-Team: Brazilian Portuguese\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: badwolf.c:760 +#, c-format +msgid "Buildtime WebKit version: %d.%d.%d\n" +msgstr "Versão do WebKit %d.%d.%d\n" + +#: badwolf.c:378 +msgid "Continue" +msgstr "Continuar" + +#: badwolf.c:331 +msgid "" +"Couldn't verify the TLS certificate to ensure a better security of the " +"connection. You might want to verify your machine and network.\n" +"\n" +msgstr "" +"Não foi possível verificar o certificado TLS para garantir uma melhor " +"segurança da conexão. Talvez você deva verificar a sua máquina e " +"rede.\n" +"\n" + +#: badwolf.c:352 +msgid "Error: Some unknown error occurred validating the certificate.\n" +msgstr "" +"Erro: Algum erro desconhecido ocorreu enquanto validava o " +"certificado.\n" + +#: badwolf.c:334 +msgid "Error: The X509 Certificate Authority is unknown.\n" +msgstr "Erro: A Autoridade de Certificados X509 é desconhecida.\n" + +#: badwolf.c:346 +msgid "Error: The certificate has been revoked.\n" +msgstr "Erro: O certificado foi revogado.\n" + +#: badwolf.c:343 +msgid "Error: The certificate has expired. Check your system's clock.\n" +msgstr "" +"Erro: O certificado foi expirado. Verifique o relógio do seu sistema.\n" + +#: badwolf.c:349 +msgid "Error: The certificate is considered to be insecure.\n" +msgstr "Erro: O certificado é considerado inseguro.\n" + +#: badwolf.c:340 +msgid "" +"Error: The certificate isn't valid yet. Check your system's clock.\n" +msgstr "" +"Erro: O certificado não é válido ainda. Verifique o relógio do seu " +"sistema.\n" + +#: badwolf.c:337 +msgid "Error: The given identity doesn't match the expected one.\n" +msgstr "Erro: A identidade não confere com a esperada.\n" + +#: keybindings.c:39 +msgid "Minimalist and privacy-oriented WebKitGTK+ browser" +msgstr "Navegador orientado pela privacidade e minimalismo" + +#: badwolf.c:680 +msgid "New tab" +msgstr "Nova aba" + +#: badwolf.c:782 +msgid "Open new tab" +msgstr "Abrir uma Nova aba" + +#: badwolf.c:758 +#, c-format +msgid "Running Badwolf version: %s\n" +msgstr "Rodando versão %s do Badwolf\n" + +#: badwolf.c:765 +#, c-format +msgid "Runtime WebKit version: %d.%d.%d\n" +msgstr "Versão do WebKit: %d.%d.%d\n" + +#: badwolf.c:376 +#, c-format +msgid "TLS Error for %s." +msgstr "Erro TLS para %s." + +#: badwolf.c:378 +msgid "Temporarly Add Exception" +msgstr "Temporáriamente adicionar exceção" + +#: badwolf.c:565 +msgid "Toggle javascript" +msgstr "Habilitar Javascript" + +#: badwolf.c:606 +msgid "search in current page" +msgstr "buscar na página atual" + +#: badwolf.c:92 +msgid "the web process crashed.\n" +msgstr "o processo web travou.\n" + +#: badwolf.c:96 +msgid "the web process exceeded the memory limit.\n" +msgstr "o processo web excedeu o limite de memória.\n" + +#: badwolf.c:100 +msgid "the web process terminated for an unknown reason.\n" +msgstr "o processo web terminou por uma razão desconhecida.\n" + +#: badwolf.c:93 +msgid "title|Crashed" +msgstr "Erro" + +#: badwolf.c:97 +msgid "title|Out of Memory" +msgstr "Sem memória" + +#: badwolf.c:101 +msgid "title|Unknown Crash" +msgstr "Erro desconhecido" + +#: badwolf.c:772 +#, c-format +msgid "webkit-web-extension directory set to: %s\n" +msgstr "diretório de extensões configurado para: %s\n" + +#. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. +#: badwolf.c:811 +msgid "ø" +msgstr "ø" -- cgit v1.3.1-23-gd82d From cdfbd1418e15cc9cdab77619a83ca11286b05b03 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 19 Jan 2020 20:39:01 +0100 Subject: Revert "README.md: Add note about LibSoup" This reverts commit 379690e63f294943c27d64a21e68ffb7aa880b22. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8b5d974..dda0791 100644 --- a/README.md +++ b/README.md @@ -45,11 +45,10 @@ You need to have gettext installed. If you want a GUI, poedit exists and Weblate ## Manual Installation Dependencies are: -- POSIX make (works with GNU or BSD) - C11 Compiler (such as clang or gcc) -- A pkgconfig implementation, pkg-config and pkgconf are supported - [WebKitGTK](https://webkitgtk.org/), only the latest stable is supported -- [LibSoup](https://wiki.gnome.org/Projects/libsoup), should be pulled by WebKitGTK +- POSIX make with extension for shell in variables (works with GNU, {Net,Free,Open}BSD) +- A pkg-config implementation (pkgconf is recommended) - (optionnal) gettext implementation (such as GNU Gettext) Compilation is done with `make`, install with `make install`. An example AppArmor profile is provided at `usr.bin.badwolf`, please do runtime checks before deploying. -- cgit v1.3.1-23-gd82d From b12dd026a2b6d6202f12da57000ee364acf30992 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 19 Jan 2020 20:44:23 +0100 Subject: README.md: Add link to homepage --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dda0791..2e3d245 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # BadWolf -Minimalist and privacy-oriented WebKitGTK+ browser +Minimalist and privacy-oriented WebKitGTK+ browser. + +Homepage: + ``` Copyright © 2019 Haelwenn (lanodan) Monnier SPDX-License-Identifier: BSD-3-Clause -- cgit v1.3.1-23-gd82d From e6bdb683651e3dc75cb16ee5bc81a2d810a262f4 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 22 Jan 2020 03:24:20 +0100 Subject: Makefile: Add pt_BR translation --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f3fcbc5..0a5aa3e 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ OBJS = uri.o keybindings.o badwolf.o OBJS_test = uri_test.o EXE = badwolf EXE_test = uri_test -TRANS = fr.mo +TRANS = fr.mo pt_BR.mo DOCS = usr.bin.badwolf README.md KnowledgeBase.md CC = cc -- cgit v1.3.1-23-gd82d From d4a4b0ab1b5809a7a85b786135627bf9e0448908 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 22 Jan 2020 16:30:15 +0100 Subject: Update copyright to (2019-)2020 Badwolf Authors --- Makefile | 2 +- README.md | 2 +- badwolf.1 | 2 +- badwolf.c | 2 +- keybindings.c | 2 +- po/fr.po | 59 ++++++++++++++++++++++++---------------------- po/messages.pot | 61 +++++++++++++++++++++++++----------------------- po/pt_BR.po | 72 ++++++++++++++++++++++++++++----------------------------- uri.c | 2 +- uri_test.c | 2 +- usr.bin.badwolf | 2 +- 11 files changed, 106 insertions(+), 102 deletions(-) diff --git a/Makefile b/Makefile index 0a5aa3e..024eb56 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ MSGFMT = msgfmt all: $(EXE) $(TRANS) po/messages.pot: $(SRCS) - xgettext --keyword=_ --language=C --from-code=UTF-8 -o $@ --add-comments --sort-output --copyright-holder="Haelwenn (lanodan) Monnier " --package-name="$(PACKAGE)" --package-version="$(VERSION_FULL)" --msgid-bugs-address="contact+badwolf-msgid@hacktivis.me" $(SRCS) + xgettext --keyword=_ --language=C --from-code=UTF-8 -o $@ --add-comments --sort-output --copyright-holder="Badwolf Authors " --package-name="$(PACKAGE)" --package-version="$(VERSION_FULL)" --msgid-bugs-address="contact+badwolf-msgid@hacktivis.me" $(SRCS) po/%.po: po/messages.pot msgmerge --update $@ $< diff --git a/README.md b/README.md index 2e3d245..75752b0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Minimalist and privacy-oriented WebKitGTK+ browser. Homepage: ``` -Copyright © 2019 Haelwenn (lanodan) Monnier +Copyright © 2019-2020 Badwolf Authors SPDX-License-Identifier: BSD-3-Clause ``` diff --git a/badwolf.1 b/badwolf.1 index 0b044d5..6f8ecb8 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -1,5 +1,5 @@ ./" BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -./" Copyright © 2019 Haelwenn (lanodan) Monnier +./" Copyright © 2019-2020 Badwolf Authors ./" SPDX-License-Identifier: BSD-3-Clause .Dd 2019-10-31 .Dt badwolf 1 diff --git a/badwolf.c b/badwolf.c index 74f6a7f..64136f7 100644 --- a/badwolf.c +++ b/badwolf.c @@ -1,5 +1,5 @@ // BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -// Copyright © 2019 Haelwenn (lanodan) Monnier +// Copyright © 2019-2020 Badwolf Authors // SPDX-License-Identifier: BSD-3-Clause #include "badwolf.h" diff --git a/keybindings.c b/keybindings.c index b5e9228..86713c2 100644 --- a/keybindings.c +++ b/keybindings.c @@ -1,5 +1,5 @@ // BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -// Copyright © 2019 Haelwenn (lanodan) Monnier +// Copyright © 2019-2020 Badwolf Authors // SPDX-License-Identifier: BSD-3-Clause #include "keybindings.h" diff --git a/po/fr.po b/po/fr.po index e4d49cc..5691800 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1,5 +1,5 @@ # BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -# Copyright (C) 2019 Haelwenn (lanodan) Monnier +# Copyright (C) 2019-2020 Badwolf Authors # This file is distributed under the same license as the Badwolf package. # Haelwenn (lanodan) Monnier , 2019 # @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2019-12-22 00:57+0100\n" +"POT-Creation-Date: 2020-01-22 16:20+0100\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -17,16 +17,16 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: badwolf.c:760 +#: badwolf.c:771 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit à la compilation: %d.%d.%d\n" -#: badwolf.c:378 +#: badwolf.c:384 msgid "Continue" msgstr "Continuer" -#: badwolf.c:331 +#: badwolf.c:334 msgid "" "Couldn't verify the TLS certificate to ensure a better security of the " "connection. You might want to verify your machine and network.\n" @@ -37,33 +37,33 @@ msgstr "" "et son réseau.\n" "\n" -#: badwolf.c:352 +#: badwolf.c:357 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" "Erreur : Une erreur inconnue est apparue pendant la validation du " "certificat.\n" -#: badwolf.c:334 +#: badwolf.c:338 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Erreur : L'autorité de certification (CA X509) est inconnue.\n" -#: badwolf.c:346 +#: badwolf.c:351 msgid "Error: The certificate has been revoked.\n" msgstr "Erreur : Le certificat à été révoqué.\n" -#: badwolf.c:343 +#: badwolf.c:348 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "Erreur : Le certificat a expiré.\n" -#: badwolf.c:349 +#: badwolf.c:354 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Erreur : Le certificat est considéré comme non-sécurisé.\n" -#: badwolf.c:340 +#: badwolf.c:345 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "Erreur : Le certificat n'est pas encore valide.\n" -#: badwolf.c:337 +#: badwolf.c:341 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erreur : L'identité ne correspond pas à celle attendue.\n" @@ -71,71 +71,74 @@ msgstr "Erreur : L'identité ne correspond pas à celle attendue.\n" msgid "Minimalist and privacy-oriented WebKitGTK+ browser" msgstr "Navigateur WebKitGTK+ minimaliste et orienté vie privée" -#: badwolf.c:680 +#: badwolf.c:686 msgid "New tab" msgstr "Nouvel onglet" -#: badwolf.c:782 +#: badwolf.c:793 msgid "Open new tab" msgstr "Ouvrir un nouvel onglet" -#: badwolf.c:758 +#: badwolf.c:769 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Version de Badwolf: %s\n" -#: badwolf.c:765 +#: badwolf.c:776 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit au lancement: %d.%d.%d\n" -#: badwolf.c:376 +#: badwolf.c:381 #, c-format msgid "TLS Error for %s." msgstr "Erreur TLS pour %s." -#: badwolf.c:378 +#: badwolf.c:384 msgid "Temporarly Add Exception" msgstr "Ajouter Temporairement une Exception" -#: badwolf.c:565 +#: badwolf.c:571 msgid "Toggle javascript" msgstr "Activer/Désactiver javascript" -#: badwolf.c:606 +#: badwolf.c:612 msgid "search in current page" msgstr "recherche dans la page courante" -#: badwolf.c:92 +#: badwolf.c:94 +#, c-format msgid "the web process crashed.\n" msgstr "le processus web a cessé de fonctionner.\n" -#: badwolf.c:96 +#: badwolf.c:98 +#, c-format msgid "the web process exceeded the memory limit.\n" msgstr "le processus web a dépassé la limitation de mémoire.\n" -#: badwolf.c:100 +#: badwolf.c:102 +#, c-format msgid "the web process terminated for an unknown reason.\n" msgstr "le processus web s’est interrompu pour une raison inconnue.\n" -#: badwolf.c:93 +#: badwolf.c:95 msgid "title|Crashed" msgstr "Crash" -#: badwolf.c:97 +#: badwolf.c:99 msgid "title|Out of Memory" msgstr "Dépassement Mémoire" -#: badwolf.c:101 +#: badwolf.c:103 msgid "title|Unknown Crash" msgstr "Crash inconnu" -#: badwolf.c:772 +#: badwolf.c:783 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "Répertoire webkit-web-extension configuré à %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:811 +#: badwolf.c:822 msgid "ø" msgstr "" diff --git a/po/messages.pot b/po/messages.pot index 3e497fd..fc77c19 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -1,14 +1,14 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Haelwenn (lanodan) Monnier +# Copyright (C) YEAR Badwolf Authors # This file is distributed under the same license as the Badwolf package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.4.0+g607300e\n" +"Project-Id-Version: Badwolf 0.4.0+ge6bdb68\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2019-12-22 00:57+0100\n" +"POT-Creation-Date: 2020-01-22 16:20+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,47 +17,47 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: badwolf.c:760 +#: badwolf.c:771 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:378 +#: badwolf.c:384 msgid "Continue" msgstr "" -#: badwolf.c:331 +#: badwolf.c:334 msgid "" "Couldn't verify the TLS certificate to ensure a better security of the " "connection. You might want to verify your machine and network.\n" "\n" msgstr "" -#: badwolf.c:352 +#: badwolf.c:357 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:334 +#: badwolf.c:338 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:346 +#: badwolf.c:351 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:343 +#: badwolf.c:348 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:349 +#: badwolf.c:354 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:340 +#: badwolf.c:345 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:337 +#: badwolf.c:341 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" @@ -65,71 +65,74 @@ msgstr "" msgid "Minimalist and privacy-oriented WebKitGTK+ browser" msgstr "" -#: badwolf.c:680 +#: badwolf.c:686 msgid "New tab" msgstr "" -#: badwolf.c:782 +#: badwolf.c:793 msgid "Open new tab" msgstr "" -#: badwolf.c:758 +#: badwolf.c:769 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:765 +#: badwolf.c:776 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:376 +#: badwolf.c:381 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:378 +#: badwolf.c:384 msgid "Temporarly Add Exception" msgstr "" -#: badwolf.c:565 +#: badwolf.c:571 msgid "Toggle javascript" msgstr "" -#: badwolf.c:606 +#: badwolf.c:612 msgid "search in current page" msgstr "" -#: badwolf.c:92 +#: badwolf.c:94 +#, c-format msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:96 +#: badwolf.c:98 +#, c-format msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:100 +#: badwolf.c:102 +#, c-format msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:93 +#: badwolf.c:95 msgid "title|Crashed" msgstr "" -#: badwolf.c:97 +#: badwolf.c:99 msgid "title|Out of Memory" msgstr "" -#: badwolf.c:101 +#: badwolf.c:103 msgid "title|Unknown Crash" msgstr "" -#: badwolf.c:772 +#: badwolf.c:783 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:811 +#: badwolf.c:822 msgid "ø" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 5e57452..e1aac75 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -1,13 +1,12 @@ # BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -# Copyright (C) 2020 Haelwenn (lanodan) Monnier +# Copyright (C) 2020 Badwolf Authors # This file is distributed under the same license as the Badwolf package. -# Haelwenn (lanodan) Monnier , 2020 # msgid "" msgstr "" "Project-Id-Version: Badwolf 0.4.0+g607300e\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2019-12-22 00:57+0100\n" +"POT-Creation-Date: 2020-01-22 16:20+0100\n" "PO-Revision-Date: 2020-01-20 22:17-0300\n" "Last-Translator: Pedro Lucas Porcellis \n" "Language-Team: Brazilian Portuguese\n" @@ -17,57 +16,53 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: badwolf.c:760 +#: badwolf.c:771 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit %d.%d.%d\n" -#: badwolf.c:378 +#: badwolf.c:384 msgid "Continue" msgstr "Continuar" -#: badwolf.c:331 +#: badwolf.c:334 msgid "" "Couldn't verify the TLS certificate to ensure a better security of the " "connection. You might want to verify your machine and network.\n" "\n" msgstr "" "Não foi possível verificar o certificado TLS para garantir uma melhor " -"segurança da conexão. Talvez você deva verificar a sua máquina e " -"rede.\n" +"segurança da conexão. Talvez você deva verificar a sua máquina e rede.\n" "\n" -#: badwolf.c:352 +#: badwolf.c:357 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -"Erro: Algum erro desconhecido ocorreu enquanto validava o " -"certificado.\n" +"Erro: Algum erro desconhecido ocorreu enquanto validava o certificado.\n" -#: badwolf.c:334 +#: badwolf.c:338 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Erro: A Autoridade de Certificados X509 é desconhecida.\n" -#: badwolf.c:346 +#: badwolf.c:351 msgid "Error: The certificate has been revoked.\n" msgstr "Erro: O certificado foi revogado.\n" -#: badwolf.c:343 +#: badwolf.c:348 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" "Erro: O certificado foi expirado. Verifique o relógio do seu sistema.\n" -#: badwolf.c:349 +#: badwolf.c:354 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Erro: O certificado é considerado inseguro.\n" -#: badwolf.c:340 -msgid "" -"Error: The certificate isn't valid yet. Check your system's clock.\n" +#: badwolf.c:345 +msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -"Erro: O certificado não é válido ainda. Verifique o relógio do seu " -"sistema.\n" +"Erro: O certificado não é válido ainda. Verifique o relógio do seu sistema.\n" -#: badwolf.c:337 +#: badwolf.c:341 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erro: A identidade não confere com a esperada.\n" @@ -75,71 +70,74 @@ msgstr "Erro: A identidade não confere com a esperada.\n" msgid "Minimalist and privacy-oriented WebKitGTK+ browser" msgstr "Navegador orientado pela privacidade e minimalismo" -#: badwolf.c:680 +#: badwolf.c:686 msgid "New tab" msgstr "Nova aba" -#: badwolf.c:782 +#: badwolf.c:793 msgid "Open new tab" msgstr "Abrir uma Nova aba" -#: badwolf.c:758 +#: badwolf.c:769 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Rodando versão %s do Badwolf\n" -#: badwolf.c:765 +#: badwolf.c:776 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit: %d.%d.%d\n" -#: badwolf.c:376 +#: badwolf.c:381 #, c-format msgid "TLS Error for %s." msgstr "Erro TLS para %s." -#: badwolf.c:378 +#: badwolf.c:384 msgid "Temporarly Add Exception" msgstr "Temporáriamente adicionar exceção" -#: badwolf.c:565 +#: badwolf.c:571 msgid "Toggle javascript" msgstr "Habilitar Javascript" -#: badwolf.c:606 +#: badwolf.c:612 msgid "search in current page" msgstr "buscar na página atual" -#: badwolf.c:92 +#: badwolf.c:94 +#, c-format msgid "the web process crashed.\n" msgstr "o processo web travou.\n" -#: badwolf.c:96 +#: badwolf.c:98 +#, c-format msgid "the web process exceeded the memory limit.\n" msgstr "o processo web excedeu o limite de memória.\n" -#: badwolf.c:100 +#: badwolf.c:102 +#, c-format msgid "the web process terminated for an unknown reason.\n" msgstr "o processo web terminou por uma razão desconhecida.\n" -#: badwolf.c:93 +#: badwolf.c:95 msgid "title|Crashed" msgstr "Erro" -#: badwolf.c:97 +#: badwolf.c:99 msgid "title|Out of Memory" msgstr "Sem memória" -#: badwolf.c:101 +#: badwolf.c:103 msgid "title|Unknown Crash" msgstr "Erro desconhecido" -#: badwolf.c:772 +#: badwolf.c:783 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "diretório de extensões configurado para: %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:811 +#: badwolf.c:822 msgid "ø" msgstr "ø" diff --git a/uri.c b/uri.c index b287140..6843e4a 100644 --- a/uri.c +++ b/uri.c @@ -1,5 +1,5 @@ // BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -// Copyright © 2019 Haelwenn (lanodan) Monnier +// Copyright © 2019-2020 Badwolf Authors // SPDX-License-Identifier: BSD-3-Clause #include "uri.h" diff --git a/uri_test.c b/uri_test.c index 13fa3eb..5881120 100644 --- a/uri_test.c +++ b/uri_test.c @@ -1,5 +1,5 @@ // BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -// Copyright © 2019 Haelwenn (lanodan) Monnier +// Copyright © 2019-2020 Badwolf Authors // SPDX-License-Identifier: BSD-3-Clause #include "uri.h" diff --git a/usr.bin.badwolf b/usr.bin.badwolf index 4407f31..0ebce5d 100644 --- a/usr.bin.badwolf +++ b/usr.bin.badwolf @@ -1,5 +1,5 @@ # BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -# Copyright © 2019 Haelwenn (lanodan) Monnier +# Copyright © 2019-2020 Badwolf Authors # SPDX-License-Identifier: BSD-3-Clause # # Made on Gentoo Linux with PREFIX=/usr -- cgit v1.3.1-23-gd82d From 186cee6c2b5d80046c71022d422f9df17bbd21d5 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 30 Jan 2020 03:59:22 +0100 Subject: badwolf.c: Make *window declaration static This allows to avoid a useless malloc() call done ourselves. --- badwolf.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/badwolf.c b/badwolf.c index 64136f7..580fedc 100644 --- a/badwolf.c +++ b/badwolf.c @@ -744,14 +744,7 @@ badwolf_get_tab_position(GtkContainer *notebook, GtkWidget *child) int main(int argc, char *argv[]) { - // getting an abort if this one fails to alloc - struct Window *window = malloc(sizeof(struct Window)); - if(window == NULL) - { - perror("malloc"); - return 1; - } - + struct Window *window = &(struct Window){NULL}; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, DATADIR "/locale"); bind_textdomain_codeset(PACKAGE, "UTF-8"); -- cgit v1.3.1-23-gd82d From 6b5f7edc9b3d420837a3035fb24760de54451c4d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 4 Feb 2020 07:37:51 +0100 Subject: badwolf.c: Always set a format in *printf calls Potential bug found via printf-scan aka pscan --- badwolf.c | 6 +++--- po/fr.po | 17 +++++++---------- po/messages.pot | 19 ++++++++----------- po/pt_BR.po | 17 +++++++---------- 4 files changed, 25 insertions(+), 34 deletions(-) diff --git a/badwolf.c b/badwolf.c index 580fedc..b6318b8 100644 --- a/badwolf.c +++ b/badwolf.c @@ -91,15 +91,15 @@ WebViewCb_web_process_terminated(WebKitWebView *webView, switch(reason) { case WEBKIT_WEB_PROCESS_CRASHED: - fprintf(stderr, _("the web process crashed.\n")); + fprintf(stderr, "%s", _("the web process crashed.\n")); webView_tab_label_change(browser, _("title|Crashed")); break; case WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT: - fprintf(stderr, _("the web process exceeded the memory limit.\n")); + fprintf(stderr, "%s", _("the web process exceeded the memory limit.\n")); webView_tab_label_change(browser, _("title|Out of Memory")); break; default: - fprintf(stderr, _("the web process terminated for an unknown reason.\n")); + fprintf(stderr, "%s", _("the web process terminated for an unknown reason.\n")); webView_tab_label_change(browser, _("title|Unknown Crash")); } diff --git a/po/fr.po b/po/fr.po index 5691800..7f341de 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-01-22 16:20+0100\n" +"POT-Creation-Date: 2020-02-04 07:57+0100\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: badwolf.c:771 +#: badwolf.c:764 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit à la compilation: %d.%d.%d\n" @@ -75,16 +75,16 @@ msgstr "Navigateur WebKitGTK+ minimaliste et orienté vie privée" msgid "New tab" msgstr "Nouvel onglet" -#: badwolf.c:793 +#: badwolf.c:786 msgid "Open new tab" msgstr "Ouvrir un nouvel onglet" -#: badwolf.c:769 +#: badwolf.c:762 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Version de Badwolf: %s\n" -#: badwolf.c:776 +#: badwolf.c:769 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit au lancement: %d.%d.%d\n" @@ -107,17 +107,14 @@ msgid "search in current page" msgstr "recherche dans la page courante" #: badwolf.c:94 -#, c-format msgid "the web process crashed.\n" msgstr "le processus web a cessé de fonctionner.\n" #: badwolf.c:98 -#, c-format msgid "the web process exceeded the memory limit.\n" msgstr "le processus web a dépassé la limitation de mémoire.\n" #: badwolf.c:102 -#, c-format msgid "the web process terminated for an unknown reason.\n" msgstr "le processus web s’est interrompu pour une raison inconnue.\n" @@ -133,12 +130,12 @@ msgstr "Dépassement Mémoire" msgid "title|Unknown Crash" msgstr "Crash inconnu" -#: badwolf.c:783 +#: badwolf.c:776 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "Répertoire webkit-web-extension configuré à %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:822 +#: badwolf.c:815 msgid "ø" msgstr "" diff --git a/po/messages.pot b/po/messages.pot index fc77c19..51b036c 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.4.0+ge6bdb68\n" +"Project-Id-Version: Badwolf 0.4.0+gac60080\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-01-22 16:20+0100\n" +"POT-Creation-Date: 2020-02-04 07:57+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: badwolf.c:771 +#: badwolf.c:764 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" @@ -69,16 +69,16 @@ msgstr "" msgid "New tab" msgstr "" -#: badwolf.c:793 +#: badwolf.c:786 msgid "Open new tab" msgstr "" -#: badwolf.c:769 +#: badwolf.c:762 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:776 +#: badwolf.c:769 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" @@ -101,17 +101,14 @@ msgid "search in current page" msgstr "" #: badwolf.c:94 -#, c-format msgid "the web process crashed.\n" msgstr "" #: badwolf.c:98 -#, c-format msgid "the web process exceeded the memory limit.\n" msgstr "" #: badwolf.c:102 -#, c-format msgid "the web process terminated for an unknown reason.\n" msgstr "" @@ -127,12 +124,12 @@ msgstr "" msgid "title|Unknown Crash" msgstr "" -#: badwolf.c:783 +#: badwolf.c:776 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:822 +#: badwolf.c:815 msgid "ø" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index e1aac75..89fa6ea 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.4.0+g607300e\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-01-22 16:20+0100\n" +"POT-Creation-Date: 2020-02-04 07:57+0100\n" "PO-Revision-Date: 2020-01-20 22:17-0300\n" "Last-Translator: Pedro Lucas Porcellis \n" "Language-Team: Brazilian Portuguese\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: badwolf.c:771 +#: badwolf.c:764 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit %d.%d.%d\n" @@ -74,16 +74,16 @@ msgstr "Navegador orientado pela privacidade e minimalismo" msgid "New tab" msgstr "Nova aba" -#: badwolf.c:793 +#: badwolf.c:786 msgid "Open new tab" msgstr "Abrir uma Nova aba" -#: badwolf.c:769 +#: badwolf.c:762 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Rodando versão %s do Badwolf\n" -#: badwolf.c:776 +#: badwolf.c:769 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit: %d.%d.%d\n" @@ -106,17 +106,14 @@ msgid "search in current page" msgstr "buscar na página atual" #: badwolf.c:94 -#, c-format msgid "the web process crashed.\n" msgstr "o processo web travou.\n" #: badwolf.c:98 -#, c-format msgid "the web process exceeded the memory limit.\n" msgstr "o processo web excedeu o limite de memória.\n" #: badwolf.c:102 -#, c-format msgid "the web process terminated for an unknown reason.\n" msgstr "o processo web terminou por uma razão desconhecida.\n" @@ -132,12 +129,12 @@ msgstr "Sem memória" msgid "title|Unknown Crash" msgstr "Erro desconhecido" -#: badwolf.c:783 +#: badwolf.c:776 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "diretório de extensões configurado para: %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:822 +#: badwolf.c:815 msgid "ø" msgstr "ø" -- cgit v1.3.1-23-gd82d From 90518ee01fe2f0d41a0661b8f4de5cd903de60a1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 4 Feb 2020 07:29:32 +0100 Subject: Makefile: use $PKGCONFIG, use += and ?= BSD extensions Allows to use cross-compilation for ${triple}-pkg-config on systems like Exherbo without special handling. The BSD extensions += and ?= for variable extension is used to avoid having to explicitely pass a list of variables to make, thus making build recipies simpler. Only issue is when CC is unset, you will get CC=c99, which doesn't works as c11 is used. Consider doing something like the following in your build recipes: make CC=${CC:-cc} Reported-by: danyspin97 --- Makefile | 40 ++++++++++++++++++++++++---------------- README.md | 2 +- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 024eb56..d8e9195 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,26 @@ .POSIX: +# POSIX Makefile with extensions common to *BSD and GNU such as: +# - Usage of backticks for shell evaluation +# - Usage of ?= for defining variables when not already defined +# - Usage of += for appending to a variable +PACKAGE = Badwolf VERSION = 0.4.0 -VERSION_FULL = $(VERSION)$(shell ./version.sh) +VERSION_FULL = $(VERSION)`./version.sh` -PREFIX = /usr/local -BINDIR = $(PREFIX)/bin -MANDIR = $(PREFIX)/share/man -DOCDIR = $(PREFIX)/share/doc/badwolf-$(VERSION) -DATADIR = $(PREFIX)/share/badwolf -APPSDIR = $(PREFIX)/share/applications -PACKAGE = Badwolf +PREFIX ?= /usr/local +BINDIR ?= $(PREFIX)/bin +MANDIR ?= $(PREFIX)/share/man +DOCDIR ?= $(PREFIX)/share/doc/badwolf-$(VERSION) +DATADIR ?= $(PREFIX)/share/badwolf +APPSDIR ?= $(PREFIX)/share/applications + +CC ?= cc +DBG ?= +PKGCONFIG ?= pkg-config +MSGFMT ?= msgfmt + +CFLAGS ?= -g -Wall -Wextra -Wconversion -Wsign-conversion -O2 DEPS = gtk+-3.0 webkit2gtk-4.0 libsoup-2.4 SRCS = uri.c uri_test.c keybindings.c badwolf.c @@ -20,12 +31,9 @@ EXE_test = uri_test TRANS = fr.mo pt_BR.mo DOCS = usr.bin.badwolf README.md KnowledgeBase.md -CC = cc -DBG = -CFLAGS = -g -Wall -Wextra -Wconversion -Wsign-conversion -O2 -CDEPS = `pkg-config --cflags $(DEPS)` -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" -LIBS = `pkg-config --libs $(DEPS)` -MSGFMT = msgfmt +CFLAGS += -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" +CFLAGS += `$(PKGCONFIG) --cflags $(DEPS)` +LIBS = `$(PKGCONFIG) --libs $(DEPS)` all: $(EXE) $(TRANS) @@ -43,10 +51,10 @@ badwolf: $(OBJS) $(CC) -std=c11 -o $@ $(OBJS) $(LDFLAGS) $(LIBS) .c: - $(CC) -std=c11 $(CFLAGS) $(CDEPS) $(LDFLAGS) $(LIBS) -o $@ $< + $(CC) -std=c11 $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@ $< .c.o: - $(CC) -std=c11 $(CFLAGS) $(CDEPS) -c -o $@ $< + $(CC) -std=c11 $(CFLAGS) -c -o $@ $< uri_test: uri.o uri_test.o $(CC) -std=c11 -o $@ uri.o uri_test.o $(LDFLAGS) $(LIBS) diff --git a/README.md b/README.md index 75752b0..6ce8eef 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Dependencies are: - A pkg-config implementation (pkgconf is recommended) - (optionnal) gettext implementation (such as GNU Gettext) -Compilation is done with `make`, install with `make install`. An example AppArmor profile is provided at `usr.bin.badwolf`, please do runtime checks before deploying. +Compilation is done with `make CC=${CC:-cc}`, install with `make install`. An example AppArmor profile is provided at `usr.bin.badwolf`, please do runtime checks before deploying. ## 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 generic WebKit extensions that should be resuseable. -- cgit v1.3.1-23-gd82d From 177b29e2e39e9b5833a1bd1587b4ffc470b07f55 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 4 Feb 2020 08:03:13 +0100 Subject: badwolf.c: Remove title| in crash handling It is just too confusable for translators, proper context function should be used instead. --- badwolf.c | 6 +++--- po/fr.po | 15 ++++++++++++++- po/messages.pot | 16 ++++++++++++++-- po/pt_BR.po | 17 ++++++++++++++++- 4 files changed, 47 insertions(+), 7 deletions(-) diff --git a/badwolf.c b/badwolf.c index b6318b8..cb26dcf 100644 --- a/badwolf.c +++ b/badwolf.c @@ -92,15 +92,15 @@ WebViewCb_web_process_terminated(WebKitWebView *webView, { case WEBKIT_WEB_PROCESS_CRASHED: fprintf(stderr, "%s", _("the web process crashed.\n")); - webView_tab_label_change(browser, _("title|Crashed")); + webView_tab_label_change(browser, _("Crashed")); break; case WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT: fprintf(stderr, "%s", _("the web process exceeded the memory limit.\n")); - webView_tab_label_change(browser, _("title|Out of Memory")); + webView_tab_label_change(browser, _("Out of Memory")); break; default: fprintf(stderr, "%s", _("the web process terminated for an unknown reason.\n")); - webView_tab_label_change(browser, _("title|Unknown Crash")); + webView_tab_label_change(browser, _("Unknown Crash")); } return FALSE; diff --git a/po/fr.po b/po/fr.po index 7f341de..a3b348e 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-02-04 07:57+0100\n" +"POT-Creation-Date: 2020-02-04 07:54+0100\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -37,6 +37,11 @@ msgstr "" "et son réseau.\n" "\n" +#: badwolf.c:95 +#, fuzzy +msgid "Crashed" +msgstr "Crash" + #: badwolf.c:357 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" @@ -79,6 +84,10 @@ msgstr "Nouvel onglet" msgid "Open new tab" msgstr "Ouvrir un nouvel onglet" +#: badwolf.c:99 +msgid "Out of Memory" +msgstr "Dépassement Mémoire" + #: badwolf.c:762 #, c-format msgid "Running Badwolf version: %s\n" @@ -102,6 +111,10 @@ msgstr "Ajouter Temporairement une Exception" msgid "Toggle javascript" msgstr "Activer/Désactiver javascript" +#: badwolf.c:103 +msgid "Unknown Crash" +msgstr "Crash inconnu" + #: badwolf.c:612 msgid "search in current page" msgstr "recherche dans la page courante" diff --git a/po/messages.pot b/po/messages.pot index 51b036c..6f2f9f8 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.4.0+gac60080\n" +"Project-Id-Version: Badwolf 0.4.0+g2e84f1d\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-02-04 07:57+0100\n" +"POT-Creation-Date: 2020-02-04 07:54+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -33,6 +33,10 @@ msgid "" "\n" msgstr "" +#: badwolf.c:95 +msgid "Crashed" +msgstr "" + #: badwolf.c:357 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" @@ -73,6 +77,10 @@ msgstr "" msgid "Open new tab" msgstr "" +#: badwolf.c:99 +msgid "Out of Memory" +msgstr "" + #: badwolf.c:762 #, c-format msgid "Running Badwolf version: %s\n" @@ -96,6 +104,10 @@ msgstr "" msgid "Toggle javascript" msgstr "" +#: badwolf.c:103 +msgid "Unknown Crash" +msgstr "" + #: badwolf.c:612 msgid "search in current page" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 89fa6ea..aca5ce3 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.4.0+g607300e\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-02-04 07:57+0100\n" +"POT-Creation-Date: 2020-02-04 07:54+0100\n" "PO-Revision-Date: 2020-01-20 22:17-0300\n" "Last-Translator: Pedro Lucas Porcellis \n" "Language-Team: Brazilian Portuguese\n" @@ -35,6 +35,11 @@ msgstr "" "segurança da conexão. Talvez você deva verificar a sua máquina e rede.\n" "\n" +#: badwolf.c:95 +#, fuzzy +msgid "Crashed" +msgstr "Erro" + #: badwolf.c:357 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" @@ -78,6 +83,11 @@ msgstr "Nova aba" msgid "Open new tab" msgstr "Abrir uma Nova aba" +#: badwolf.c:99 +#, fuzzy +msgid "Out of Memory" +msgstr "Sem memória" + #: badwolf.c:762 #, c-format msgid "Running Badwolf version: %s\n" @@ -101,6 +111,11 @@ msgstr "Temporáriamente adicionar exceção" msgid "Toggle javascript" msgstr "Habilitar Javascript" +#: badwolf.c:103 +#, fuzzy +msgid "Unknown Crash" +msgstr "Erro desconhecido" + #: badwolf.c:612 msgid "search in current page" msgstr "buscar na página atual" -- cgit v1.3.1-23-gd82d From be48f3b29186966f1f4edcdd4ebe2ac800743144 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 4 Feb 2020 08:50:57 +0100 Subject: Makefile: disable backups on msgmerge Git is already used so it makes no sense to have it on. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d8e9195..3e9f2b6 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ po/messages.pot: $(SRCS) xgettext --keyword=_ --language=C --from-code=UTF-8 -o $@ --add-comments --sort-output --copyright-holder="Badwolf Authors " --package-name="$(PACKAGE)" --package-version="$(VERSION_FULL)" --msgid-bugs-address="contact+badwolf-msgid@hacktivis.me" $(SRCS) po/%.po: po/messages.pot - msgmerge --update $@ $< + msgmerge --update --backup=off $@ $< ${TRANS}: po/${@:.mo=.po} mkdir -p locale/${@:.mo=}/LC_MESSAGES -- cgit v1.3.1-23-gd82d From eb974dcccdbcb35fa067ace053bc1fac7406b768 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 4 Feb 2020 09:12:12 +0100 Subject: Makefile: Bump to 0.5.0-rc.1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3e9f2b6..c6092c6 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ # - Usage of += for appending to a variable PACKAGE = Badwolf -VERSION = 0.4.0 +VERSION = 0.5.0-rc.1 VERSION_FULL = $(VERSION)`./version.sh` PREFIX ?= /usr/local -- cgit v1.3.1-23-gd82d