From 128c98567559d443bbb184dff247090eb5b28a8d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 19 May 2020 04:18:43 +0200 Subject: README.md: Fix syntax --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 22846e1..29e6b04 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ You need to have gettext installed. If you want a GUI, poedit exists and Weblate ## Manual Installation Dependencies are: + - C11 Compiler (such as clang or gcc) - [WebKitGTK](https://webkitgtk.org/), only the latest stable is supported - POSIX make with extension for shell in variables (works with GNU, {Net,Free,Open}BSD) -- cgit v1.3.1-23-gd82d From 6880bf722d254d12e8236c78a7d858b9c94deee6 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 29 May 2020 23:44:13 +0200 Subject: uri.c: Add support for relative paths --- po/messages.pot | 4 ++-- uri.c | 19 ++++++++++++++++++- uri_test.c | 5 ++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/po/messages.pot b/po/messages.pot index 115f3b4..8b30b0d 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+gf25fc89.HEAD\n" +"Project-Id-Version: Badwolf 1.0.0+gfffd169.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-18 04:14+0200\n" +"POT-Creation-Date: 2020-05-29 23:45+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/uri.c b/uri.c index 6843e4a..59e50d7 100644 --- a/uri.c +++ b/uri.c @@ -11,12 +11,29 @@ const gchar * badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file) { const gchar *fallback = "about:blank"; + char *path = NULL; if(g_strcmp0(text, "") <= 0) return fallback; if(g_uri_parse_scheme(text)) return text; - if(try_file && (access(text, R_OK) == 0)) return g_strdup_printf("file://%s", text); + if(try_file) + { + path = realpath(text, NULL); + gchar *f = NULL; + + if(path != NULL) + { + if(access(path, R_OK) == 0) + { + f = g_strdup_printf("file://%s", path); + } + + free(path); + + return f; + } + } return g_strdup_printf("http://%s", text); } diff --git a/uri_test.c b/uri_test.c index 5881120..a153817 100644 --- a/uri_test.c +++ b/uri_test.c @@ -29,10 +29,13 @@ badwolf_ensure_uri_scheme_test(void) {fallback, "", TRUE}, {"http:///dev/null", "/dev/null", FALSE}, {"file:///dev/null", "/dev/null", TRUE}, + {"http:///usr/../dev/null", "/usr/../dev/null", FALSE}, + {"file:///dev/null", "/usr/../dev/null", TRUE}, {"http://example.org", "example.org", FALSE}, {"http://example.org", "example.org", TRUE}, {"http://", "http://", FALSE}, - {"http://", "http://", TRUE} // + {"http://", "http://", TRUE}, + {"http://badwolf.c", "badwolf.c", FALSE} // }; for(size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) -- cgit v1.3.1-23-gd82d From ed40d74fdde65134365334b8d0d2b5593c121b89 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 29 May 2020 23:55:25 +0200 Subject: Fix implicit-declaration for realpath --- Makefile | 2 +- po/messages.pot | 4 ++-- uri.c | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f371a28..9cd4d96 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ EXE_test = uri_test TRANS = fr.mo pt_BR.mo DOCS = usr.bin.badwolf README.md KnowledgeBase.md interface.txt -CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" +CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" CDEPS += `$(PKGCONFIG) --cflags $(DEPS)` LIBS = `$(PKGCONFIG) --libs $(DEPS)` diff --git a/po/messages.pot b/po/messages.pot index 8b30b0d..28609d4 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.0+gfffd169.develop\n" +"Project-Id-Version: Badwolf 1.0.0+g6880bf7.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-29 23:45+0200\n" +"POT-Creation-Date: 2020-05-29 23:52+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/uri.c b/uri.c index 59e50d7..912bf86 100644 --- a/uri.c +++ b/uri.c @@ -4,7 +4,8 @@ #include "uri.h" -#include /* g_strcmp0() */ +#include /* g_strcmp0(), g_uri_parse_scheme(), g_strdup_printf */ +#include /* realpath(), free() */ #include /* access() */ const gchar * -- cgit v1.3.1-23-gd82d From 828e2e38e092a8ccc11a57b66baa14e2291f59e6 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 12 Jun 2020 01:50:39 +0200 Subject: downloads: Ellipsize destination file path --- config.h | 12 ++++++++++++ downloads.c | 1 + po/messages.pot | 14 +++++++------- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/config.h b/config.h index d963cb6..14b142c 100644 --- a/config.h +++ b/config.h @@ -93,4 +93,16 @@ */ #define BADWOLF_STATUSLABEL_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE +/* BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE: pango ellipsize mode of the download destination path, + * can be one of: + * - PANGO_ELLIPSIZE_NONE + * - PANGO_ELLIPSIZE_START + * - PANGO_ELLIPSIZE_MIDDLE + * - PANGO_ELLIPSIZE_END + * + * See https://developer.gnome.org/pango/stable/pango-Layout-Objects.html#PangoEllipsizeMode + */ +#define BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE + + #endif /* CONFIG_H_INCLUDED */ diff --git a/downloads.c b/downloads.c index 1a21ada..9b83edd 100644 --- a/downloads.c +++ b/downloads.c @@ -42,6 +42,7 @@ download_new_entry(WebKitDownload *webkit_download, struct Download *download) download->stop_icon = gtk_button_new_from_icon_name("process-stop", GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(download->progress), TRUE); + gtk_label_set_ellipsize(GTK_LABEL(download->file_path), BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE); g_signal_connect( download->stop_icon, "clicked", G_CALLBACK(download_stop_iconCb_clicked), webkit_download); diff --git a/po/messages.pot b/po/messages.pot index 28609d4..45867ee 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.0+g6880bf7.develop\n" +"Project-Id-Version: Badwolf 1.0.0+ged40d74.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-29 23:52+0200\n" +"POT-Creation-Date: 2020-06-12 01:46+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,27 +17,27 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: downloads.c:117 +#: downloads.c:118 #, c-format msgid "%02i:%02i:%02i Download cancelled" msgstr "" -#: downloads.c:119 +#: downloads.c:120 #, c-format msgid "%02i:%02i:%02i Download error" msgstr "" -#: downloads.c:141 +#: downloads.c:142 #, c-format msgid "%02i:%02i:%02i Download finished" msgstr "" -#: downloads.c:167 +#: downloads.c:168 #, c-format msgid "%02i:%02i:%02i Downloading…" msgstr "" -#: downloads.c:195 downloads.c:212 downloads.c:215 +#: downloads.c:196 downloads.c:213 downloads.c:216 msgid "Badwolf Downloads" msgstr "" -- cgit v1.3.1-23-gd82d From 4b85e087dad714f6e969f702e8be7319531afc37 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 12 Jun 2020 02:20:14 +0200 Subject: downloads: Use a ListBox in a ScrollWindow --- config.h | 1 - downloads.c | 17 ++++++++++------- po/messages.pot | 14 +++++++------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/config.h b/config.h index 14b142c..8426ce3 100644 --- a/config.h +++ b/config.h @@ -104,5 +104,4 @@ */ #define BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE - #endif /* CONFIG_H_INCLUDED */ diff --git a/downloads.c b/downloads.c index 9b83edd..09b7bb0 100644 --- a/downloads.c +++ b/downloads.c @@ -53,8 +53,7 @@ download_new_entry(WebKitDownload *webkit_download, struct Download *download) gtk_box_pack_start(GTK_BOX(download->container), download->status, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(download->container), download->file_path, FALSE, FALSE, 0); - gtk_box_pack_start( - GTK_BOX(download->window->downloads_tab), download->container, FALSE, FALSE, 0); + gtk_list_box_insert(GTK_LIST_BOX(download->window->downloads_tab), download->container, -1); gtk_widget_show_all(download->container); } @@ -180,14 +179,18 @@ downloadCb_received_data(WebKitDownload *webkit_download, guint64 data_lenght, g GtkWidget * badwolf_downloads_tab_new() { - return gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); + return gtk_list_box_new(); } void badwolf_downloads_tab_attach(struct Window *window) { - gtk_notebook_insert_page(GTK_NOTEBOOK(window->notebook), window->downloads_tab, NULL, 0); - gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(window->notebook), window->downloads_tab, TRUE); + GtkWidget *scrolled_window = gtk_scrolled_window_new(NULL, NULL); + gtk_widget_set_name(scrolled_window, "browser__scrollwin_downloads"); + gtk_container_add(GTK_CONTAINER(scrolled_window), window->downloads_tab); + gtk_notebook_insert_page(GTK_NOTEBOOK(window->notebook), scrolled_window, NULL, 0); + + gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(window->notebook), scrolled_window, TRUE); GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(tab_box, "browser__tabbox"); @@ -211,9 +214,9 @@ badwolf_downloads_tab_attach(struct Window *window) gtk_box_pack_start(GTK_BOX(tab_box), label, TRUE, TRUE, 0); gtk_widget_set_tooltip_text(tab_box, _("Badwolf Downloads")); - gtk_notebook_set_tab_label(GTK_NOTEBOOK(window->notebook), window->downloads_tab, tab_box); + gtk_notebook_set_tab_label(GTK_NOTEBOOK(window->notebook), scrolled_window, tab_box); gtk_notebook_set_menu_label_text( - GTK_NOTEBOOK(window->notebook), window->downloads_tab, _("Badwolf Downloads")); + GTK_NOTEBOOK(window->notebook), scrolled_window, _("Badwolf Downloads")); gtk_widget_show_all(tab_box); } diff --git a/po/messages.pot b/po/messages.pot index 45867ee..0d84a9f 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.0+ged40d74.develop\n" +"Project-Id-Version: Badwolf 1.0.0+g828e2e3.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-06-12 01:46+0200\n" +"POT-Creation-Date: 2020-06-12 02:16+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,27 +17,27 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: downloads.c:118 +#: downloads.c:117 #, c-format msgid "%02i:%02i:%02i Download cancelled" msgstr "" -#: downloads.c:120 +#: downloads.c:119 #, c-format msgid "%02i:%02i:%02i Download error" msgstr "" -#: downloads.c:142 +#: downloads.c:141 #, c-format msgid "%02i:%02i:%02i Download finished" msgstr "" -#: downloads.c:168 +#: downloads.c:167 #, c-format msgid "%02i:%02i:%02i Downloading…" msgstr "" -#: downloads.c:196 downloads.c:213 downloads.c:216 +#: downloads.c:199 downloads.c:216 downloads.c:218 msgid "Badwolf Downloads" msgstr "" -- cgit v1.3.1-23-gd82d From cb232d9e919d67c71a96d7ab1fc85cf5aa968b81 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 16 Jun 2020 01:45:13 +0200 Subject: Add webcontext hex id to tab label --- badwolf.c | 20 +++++++++++++----- badwolf.h | 1 + interface.txt | 1 + po/messages.pot | 64 ++++++++++++++++++++++++++++----------------------------- 4 files changed, 49 insertions(+), 37 deletions(-) diff --git a/badwolf.c b/badwolf.c index 54dcf53..b0e2beb 100644 --- a/badwolf.c +++ b/badwolf.c @@ -12,13 +12,14 @@ #include /* _() and other internationalization/localization helpers */ #include /* soup* */ #include /* LC_* */ -#include /* perror(), fprintf() */ +#include /* perror(), fprintf(), snprintf() */ #include /* malloc() */ #include /* access() */ gchar *web_extensions_directory; -const gchar *homepage = "https://hacktivis.me/projects/badwolf"; -const gchar *version = VERSION; +const gchar *homepage = "https://hacktivis.me/projects/badwolf"; +const gchar *version = VERSION; +int context_id_counter = 0; static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data); static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView, @@ -134,6 +135,10 @@ GtkWidget * badwolf_new_tab_box(const gchar *title, struct Client *browser) { (void)browser; + char context_id_str[7]; + + snprintf(context_id_str, 7, "%4X: ", browser->context_id); + GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(tab_box, "browser__tabbox"); GtkWidget *close = @@ -141,6 +146,8 @@ badwolf_new_tab_box(const gchar *title, struct Client *browser) gtk_widget_set_name(close, "browser__tabbox__close"); GtkWidget *label = gtk_label_new(title); gtk_widget_set_name(label, "browser__tabbox__label"); + GtkWidget *context_label = gtk_label_new(context_id_str); + gtk_widget_set_name(label, "browser__tabbox__context_label"); GtkWidget *playing = gtk_image_new_from_icon_name("audio-volume-high-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_widget_set_name(playing, "browser__tabbox__playing"); @@ -155,8 +162,10 @@ badwolf_new_tab_box(const gchar *title, struct Client *browser) gtk_label_set_ellipsize(GTK_LABEL(label), BADWOLF_TAB_LABEL_ELLIPSIZE); gtk_label_set_single_line_mode(GTK_LABEL(label), TRUE); + gtk_label_set_single_line_mode(GTK_LABEL(context_label), TRUE); gtk_box_pack_start(GTK_BOX(tab_box), playing, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(tab_box), context_label, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(tab_box), label, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(tab_box), close, FALSE, FALSE, 0); @@ -589,8 +598,9 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat if(browser == NULL) return NULL; - browser->window = window; - browser->box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); + browser->window = window; + browser->context_id = context_id_counter++; + browser->box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_widget_set_name(browser->box, "browser__box"); browser->toolbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); diff --git a/badwolf.h b/badwolf.h index 7911c33..99d7b78 100644 --- a/badwolf.h +++ b/badwolf.h @@ -26,6 +26,7 @@ struct Client GtkWidget *auto_load_images; GtkWidget *location; + int context_id; WebKitWebView *webView; struct Window *window; diff --git a/interface.txt b/interface.txt index 76d9526..f23a149 100644 --- a/interface.txt +++ b/interface.txt @@ -3,6 +3,7 @@ - Each tab contains a Browser View or the Downloads View ## Tab Labels +- An hexadecimal number identifying the webkit process context - An icon to indicate if a media is playing - The title of the web view - A close button diff --git a/po/messages.pot b/po/messages.pot index 0d84a9f..c150e4e 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.0+g828e2e3.develop\n" +"Project-Id-Version: Badwolf 1.0.0+g4b85e08.context-id\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-06-12 02:16+0200\n" +"POT-Creation-Date: 2020-06-16 01:41+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -37,27 +37,27 @@ msgstr "" msgid "%02i:%02i:%02i Downloading…" msgstr "" -#: downloads.c:199 downloads.c:216 downloads.c:218 +#: downloads.c:199 downloads.c:216 downloads.c:219 msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:910 +#: badwolf.c:920 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:403 +#: badwolf.c:412 msgid "Continue" msgstr "" -#: badwolf.c:353 +#: badwolf.c:362 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:99 +#: badwolf.c:100 msgid "Crashed" msgstr "" @@ -65,31 +65,31 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:376 +#: badwolf.c:385 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:357 +#: badwolf.c:366 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:370 +#: badwolf.c:379 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:367 +#: badwolf.c:376 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:373 +#: badwolf.c:382 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:364 +#: badwolf.c:373 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:360 +#: badwolf.c:369 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" @@ -100,79 +100,79 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:839 +#: badwolf.c:849 msgid "New tab" msgstr "" -#: badwolf.c:959 +#: badwolf.c:969 msgid "Open new tab" msgstr "" -#: badwolf.c:103 +#: badwolf.c:104 msgid "Out of Memory" msgstr "" -#: badwolf.c:908 +#: badwolf.c:918 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:915 +#: badwolf.c:925 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:400 +#: badwolf.c:409 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:403 +#: badwolf.c:412 msgid "Temporarily Add Exception" msgstr "" -#: badwolf.c:610 +#: badwolf.c:620 msgid "Toggle javascript" msgstr "" -#: badwolf.c:615 +#: badwolf.c:625 msgid "Toggle loading images automatically" msgstr "" -#: badwolf.c:107 +#: badwolf.c:108 msgid "Unknown Crash" msgstr "" -#: badwolf.c:613 +#: badwolf.c:623 msgid "_IMG" msgstr "" -#: badwolf.c:608 +#: badwolf.c:618 msgid "_JS" msgstr "" -#: badwolf.c:728 +#: badwolf.c:738 msgid "search in current page" msgstr "" -#: badwolf.c:98 +#: badwolf.c:99 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:102 +#: badwolf.c:103 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:106 +#: badwolf.c:107 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:922 +#: badwolf.c:932 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:993 +#: badwolf.c:1003 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 31e176f6f7c2ac8cf7d1c147a2f20c4e74b21932 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 16 Jun 2020 06:21:16 +0200 Subject: fix context_id incrementation --- badwolf.c | 23 ++++++++++++++--------- badwolf.h | 2 +- po/messages.pot | 50 +++++++++++++++++++++++++------------------------- 3 files changed, 40 insertions(+), 35 deletions(-) diff --git a/badwolf.c b/badwolf.c index b0e2beb..a8b8802 100644 --- a/badwolf.c +++ b/badwolf.c @@ -293,10 +293,15 @@ WebViewCb_create(WebKitWebView *related_web_view, gpointer user_data) { (void)navigation_action; - struct Window *window = (struct Window *)user_data; - struct Client *browser = new_browser(window, NULL, related_web_view); + struct Client *old_browser = (struct Client *)user_data; + struct Client *browser = NULL; + + // shouldn't be needed but better be safe + old_browser->webView = related_web_view; + + browser = new_browser(old_browser->window, NULL, old_browser); - if(badwolf_new_tab(GTK_NOTEBOOK(window->notebook), browser) < 0) + if(badwolf_new_tab(GTK_NOTEBOOK(old_browser->window->notebook), browser) < 0) return NULL; else return browser->webView; @@ -590,16 +595,16 @@ widgetCb_drop_button3_event(GtkWidget *widget, GdkEvent *event, gpointer user_da } struct Client * -new_browser(struct Window *window, const gchar *target_url, WebKitWebView *related_web_view) +new_browser(struct Window *window, const gchar *target_url, struct Client *old_browser) { struct Client *browser = malloc(sizeof(struct Client)); - target_url = badwolf_ensure_uri_scheme(target_url, (related_web_view == NULL)); + target_url = badwolf_ensure_uri_scheme(target_url, (old_browser == NULL)); char *badwolf_l10n = NULL; if(browser == NULL) return NULL; browser->window = window; - browser->context_id = context_id_counter++; + browser->context_id = old_browser == NULL ? context_id_counter++ : old_browser->context_id; browser->box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_widget_set_name(browser->box, "browser__box"); @@ -670,7 +675,7 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat "web-context", web_context, "related-view", - related_web_view, + old_browser == NULL ? NULL : old_browser->webView, "settings", settings, NULL)); @@ -799,7 +804,7 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat "notify::estimated-load-progress", G_CALLBACK(WebViewCb_notify__estimated_load_progress), browser); - g_signal_connect(browser->webView, "create", G_CALLBACK(WebViewCb_create), window); + g_signal_connect(browser->webView, "create", G_CALLBACK(WebViewCb_create), browser); g_signal_connect(browser->webView, "close", G_CALLBACK(WebViewCb_close), browser); g_signal_connect( browser->webView, "key-press-event", G_CALLBACK(WebViewCb_key_press_event), browser); @@ -830,7 +835,7 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat /* signals for box container */ g_signal_connect(browser->box, "key-press-event", G_CALLBACK(boxCb_key_press_event), browser); - if(related_web_view == NULL) webkit_web_view_load_uri(browser->webView, target_url); + if(old_browser == NULL) webkit_web_view_load_uri(browser->webView, target_url); return browser; } diff --git a/badwolf.h b/badwolf.h index 99d7b78..530f9c8 100644 --- a/badwolf.h +++ b/badwolf.h @@ -38,7 +38,7 @@ struct Client 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, const gchar *target_url, WebKitWebView *related_web_view); +new_browser(struct Window *window, const gchar *target_url, struct Client *old_browser); int badwolf_new_tab(GtkNotebook *notebook, struct Client *browser); gint badwolf_get_tab_position(GtkContainer *notebook, GtkWidget *child); #endif /* BADWOLF_H_INCLUDED */ diff --git a/po/messages.pot b/po/messages.pot index c150e4e..e669e74 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.0+g4b85e08.context-id\n" +"Project-Id-Version: Badwolf 1.0.0+g5c8cf6d.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-06-16 01:41+0200\n" +"POT-Creation-Date: 2020-06-16 06:32+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,16 +41,16 @@ msgstr "" msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:920 +#: badwolf.c:925 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:412 +#: badwolf.c:417 msgid "Continue" msgstr "" -#: badwolf.c:362 +#: badwolf.c:367 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" @@ -65,31 +65,31 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:385 +#: badwolf.c:390 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:366 +#: badwolf.c:371 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:379 +#: badwolf.c:384 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:376 +#: badwolf.c:381 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:382 +#: badwolf.c:387 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:373 +#: badwolf.c:378 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:369 +#: badwolf.c:374 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" @@ -100,11 +100,11 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:849 +#: badwolf.c:854 msgid "New tab" msgstr "" -#: badwolf.c:969 +#: badwolf.c:974 msgid "Open new tab" msgstr "" @@ -112,30 +112,30 @@ msgstr "" msgid "Out of Memory" msgstr "" -#: badwolf.c:918 +#: badwolf.c:923 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:925 +#: badwolf.c:930 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:409 +#: badwolf.c:414 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:412 +#: badwolf.c:417 msgid "Temporarily Add Exception" msgstr "" -#: badwolf.c:620 +#: badwolf.c:625 msgid "Toggle javascript" msgstr "" -#: badwolf.c:625 +#: badwolf.c:630 msgid "Toggle loading images automatically" msgstr "" @@ -143,15 +143,15 @@ msgstr "" msgid "Unknown Crash" msgstr "" -#: badwolf.c:623 +#: badwolf.c:628 msgid "_IMG" msgstr "" -#: badwolf.c:618 +#: badwolf.c:623 msgid "_JS" msgstr "" -#: badwolf.c:738 +#: badwolf.c:743 msgid "search in current page" msgstr "" @@ -167,12 +167,12 @@ msgstr "" msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:932 +#: badwolf.c:937 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:1003 +#: badwolf.c:1008 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 5e7964460e8f5cec2a2b823d9814e491e36b6979 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 3 Jul 2020 06:34:05 +0200 Subject: badwolf.1: Fix syntax issues This seems to fix some issues with how GNU groff renders it. --- badwolf.1 | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/badwolf.1 b/badwolf.1 index d25674b..a9c2ce1 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -2,7 +2,7 @@ ./" Copyright © 2019-2020 Badwolf Authors ./" SPDX-License-Identifier: BSD-3-Clause .Dd 2019-10-31 -.Dt badwolf 1 +.Dt BADWOLF 1 .Sh NAME .Nm badwolf .Nd minimalist and privacy-oriented WebkitGTK browser @@ -20,8 +20,9 @@ will probably get added at a later release. .Sh KEYBINDINGS The following section lists the keybinding by their action, each item is described by the widget the focus is on or .Aq any -if it works for the whole window, followed by the keybind it grabs. A is short for Alt, C is short for Control, S is short for Shift. -.Bl -width Ds -tag +if it works for the whole window, followed by the keybind it grabs. +A is short for Alt, C is short for Control, S is short for Shift. +.Bl -tag -width Ds .It webview C-Scroll Zooms the webpage in/out. .It webview C-0 @@ -51,11 +52,12 @@ Go to the previous/next tab .It any F1 Shows the about dialog .It any Alt-n -Where n is any numeric-row key. Go to the n-th tab, 0 goes to the last one. +Where n is any numeric-row key. +Go to the n-th tab, 0 goes to the last one. .El .Ss DEFAULT ONES Here is a incomplete list of the default Webkit/GTK keybindings: -.Bl -width Ds -tag +.Bl -tag -width Ds .It any C-PageUp / C-PageDown Go to the previous/next tab .It search C-g / C-S-g @@ -64,11 +66,13 @@ When the search box is focused it goes to the Next/Previous search term. Cancels current search .El .Sh ENVIRONMENT -.Bl -width Ds -tag +.Bl -tag -width Ds .It Ev BADWOLF_L10N -A colon-separated list in the form lang_COUNTRY where lang is in ISO-639 and COUNTRY in ISO-3166. For example +A colon-separated list in the form lang_COUNTRY where lang is in ISO-639 and COUNTRY in ISO-3166. +For example .Ic BADWOLF_L10N="en_GB:fr_FR:de_DE" . -When this variable isn't set, spelling isn't activated. A more generic variable name is also intended to be used in the future. +When this variable isn't set, spelling isn't activated. +A more generic variable name is also intended to be used in the future. .El .Sh FILES .Bl -tag -width Ds -compact @@ -79,13 +83,14 @@ to be loaded into .Nm . Note: They aren't the JavaScript-based Web-Extensions supported by Firefox or Chrome, but native code in shared objects using the WebKitGTK API. .Pp Examples of useful extensions may be found at: -.Bl -compact +.Bl -item -compact .Lk https://hacktivis.me/git/badwolf-extensions .Lk https://github.com/jun7/wyebadblock .El .It Pa ${DATADIR:-/usr/local/share}/badwolf/interface.css .It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/interface.css -CSS files (respectively system and user-level) for styling badwolf interface. See +CSS files (respectively system and user-level) for styling badwolf interface. +See .Lk https://developer.gnome.org/gtk3/stable/chap-css-properties.html for the properties being available. .Pp @@ -95,6 +100,8 @@ environment variable on launching .Nm and going to the CSS tab. .El +.Sh AUTHORS +.An Haelwenn (lanodan) Monnier Aq Mt contact+badwolf@hacktivis.me .Sh BUGS You can submit contributions or tickets to .Lk https://gitlab.com/lanodan/badwolf @@ -102,5 +109,3 @@ or .Mt contact+badwolf@hacktivis.me , with .Xr git-send-email 1 for patches. -.Sh AUTHORS -.An Haelwenn (lanodan) Monnier Aq Mt contact+badwolf@hacktivis.me -- cgit v1.3.1-23-gd82d From 2ccd806e3927e440773e64cb7eb47b9607c648c9 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 3 Jul 2020 06:43:07 +0200 Subject: badwolf.1: Use full modifier names instead of A/C/S --- badwolf.1 | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/badwolf.1 b/badwolf.1 index a9c2ce1..d1bda3e 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -21,21 +21,20 @@ will probably get added at a later release. The following section lists the keybinding by their action, each item is described by the widget the focus is on or .Aq any if it works for the whole window, followed by the keybind it grabs. -A is short for Alt, C is short for Control, S is short for Shift. .Bl -tag -width Ds -.It webview C-Scroll +.It webview Ctrl-Scroll Zooms the webpage in/out. -.It webview C-0 +.It webview Ctrl-0 Resets webpage zoom to 100%. -.It any C-t +.It any Ctrl-t Creates a new tab (in a new session, similar as pressing the button) -.It browser C-F4, browser A-d +.It browser Ctrl-F4, browser Alt-d Closes the current tab -.It browser C-f +.It browser Ctrl-f Focuses on the search entry -.It browser C-l +.It browser Ctrl-l Focuses on the location(URL) entry -.It browser C-S-r / C-r, browser F5 +.It browser Ctrl-Shift-r / Ctrl-r, browser F5 Reloads the content in the current tab (with/without clearing cache) .It browser Escape Stops loading the content in the current tab @@ -43,11 +42,11 @@ Stops loading the content in the current tab Toggles caret browsing. .It browser F12 Opens the web inspector. -.It browser C-[ / C-] +.It browser Ctrl-[ / Ctrl-] Go back/forward in current tab’s history -.It browser C-p +.It browser Ctrl-p Print the current page. (spawns a dialog) -.It any A-Left / A-Right +.It any Alt-Left / Alt-Right Go to the previous/next tab .It any F1 Shows the about dialog @@ -58,9 +57,9 @@ Go to the n-th tab, 0 goes to the last one. .Ss DEFAULT ONES Here is a incomplete list of the default Webkit/GTK keybindings: .Bl -tag -width Ds -.It any C-PageUp / C-PageDown +.It any Ctrl-PageUp / Ctrl-PageDown Go to the previous/next tab -.It search C-g / C-S-g +.It search Ctrl-g / Ctrl-Shift-g When the search box is focused it goes to the Next/Previous search term. .It search Escape Cancels current search -- cgit v1.3.1-23-gd82d From a33acf084bca33816f9869bf6dfa00fdd4c7b5cb Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 4 Jul 2020 01:32:07 +0200 Subject: README.md: Add IRC+Matrix --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 29e6b04..97b27ef 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,10 @@ You need to have gettext installed. If you want a GUI, poedit exists and Weblate - 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`` +## Contacts / Discussions +- IRC: `#badwolf-browser` on FreeNode +- Matrix (bridge): + ## Repositories ### git - Main: , -- cgit v1.3.1-23-gd82d From e94212d51be4e15e12a67e633baa32f0a0d6273b Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 4 Jul 2020 06:52:00 +0200 Subject: badwolf: badwolf_get_tab_position → gtk_notebook_page_num MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- badwolf.c | 16 ++------------- po/messages.pot | 62 ++++++++++++++++++++++++++++----------------------------- 2 files changed, 33 insertions(+), 45 deletions(-) diff --git a/badwolf.c b/badwolf.c index a8b8802..6bb0470 100644 --- a/badwolf.c +++ b/badwolf.c @@ -75,8 +75,7 @@ WebViewCb_close(WebKitWebView *webView, gpointer user_data) struct Client *browser = (struct Client *)user_data; GtkNotebook *notebook = GTK_NOTEBOOK(browser->window->notebook); - gtk_notebook_remove_page(notebook, - badwolf_get_tab_position(GTK_CONTAINER(notebook), browser->box)); + gtk_notebook_remove_page(notebook, gtk_notebook_page_num(GTK_NOTEBOOK(notebook), browser->box)); gtk_widget_destroy(browser->box); @@ -221,7 +220,7 @@ webView_tab_label_change(struct Client *browser, const gchar *title) gtk_notebook_set_menu_label_text(GTK_NOTEBOOK(notebook), browser->box, title); // Set the window title if the title change was on the current tab - if(badwolf_get_tab_position(GTK_CONTAINER(notebook), browser->box) == + if(gtk_notebook_page_num(GTK_NOTEBOOK(notebook), browser->box) == gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook))) gtk_window_set_title(GTK_WINDOW(browser->window->main_window), title); } @@ -898,17 +897,6 @@ notebookCb_switch__page(GtkNotebook *notebook, GtkWidget *page, guint page_num, gtk_window_set_title(GTK_WINDOW(window->main_window), gtk_widget_get_tooltip_text(label)); } -gint -badwolf_get_tab_position(GtkContainer *notebook, GtkWidget *child) -{ - GValue position = G_VALUE_INIT; - g_value_init(&position, G_TYPE_INT); - - gtk_container_child_get_property(notebook, child, "position", &position); - - return g_value_get_int(&position); -} - int main(int argc, char *argv[]) { diff --git a/po/messages.pot b/po/messages.pot index e669e74..b2ca404 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.0+g5c8cf6d.develop\n" +"Project-Id-Version: Badwolf 1.0.0+g498bce5.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-06-16 06:32+0200\n" +"POT-Creation-Date: 2020-07-04 06:53+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,23 +41,23 @@ msgstr "" msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:925 +#: badwolf.c:913 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:417 +#: badwolf.c:416 msgid "Continue" msgstr "" -#: badwolf.c:367 +#: badwolf.c:366 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:100 +#: badwolf.c:99 msgid "Crashed" msgstr "" @@ -65,31 +65,31 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:390 +#: badwolf.c:389 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:371 +#: badwolf.c:370 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:384 +#: badwolf.c:383 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:381 +#: badwolf.c:380 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:387 +#: badwolf.c:386 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:378 +#: badwolf.c:377 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:374 +#: badwolf.c:373 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" @@ -100,79 +100,79 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:854 +#: badwolf.c:853 msgid "New tab" msgstr "" -#: badwolf.c:974 +#: badwolf.c:962 msgid "Open new tab" msgstr "" -#: badwolf.c:104 +#: badwolf.c:103 msgid "Out of Memory" msgstr "" -#: badwolf.c:923 +#: badwolf.c:911 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:930 +#: badwolf.c:918 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:414 +#: badwolf.c:413 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:417 +#: badwolf.c:416 msgid "Temporarily Add Exception" msgstr "" -#: badwolf.c:625 +#: badwolf.c:624 msgid "Toggle javascript" msgstr "" -#: badwolf.c:630 +#: badwolf.c:629 msgid "Toggle loading images automatically" msgstr "" -#: badwolf.c:108 +#: badwolf.c:107 msgid "Unknown Crash" msgstr "" -#: badwolf.c:628 +#: badwolf.c:627 msgid "_IMG" msgstr "" -#: badwolf.c:623 +#: badwolf.c:622 msgid "_JS" msgstr "" -#: badwolf.c:743 +#: badwolf.c:742 msgid "search in current page" msgstr "" -#: badwolf.c:99 +#: badwolf.c:98 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:103 +#: badwolf.c:102 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:107 +#: badwolf.c:106 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:937 +#: badwolf.c:925 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:1008 +#: badwolf.c:996 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From eaf289e8ebb017f7de4081a1564737da044dd341 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 4 Jul 2020 07:15:29 +0200 Subject: Switch automatically to a tab when user-requested This changes behavior but doesn't breaks meaning nor documentation and significantly improves usability. So meant to be applied directly into 1.0.x release branch. Closes: https://gitlab.com/lanodan/badWolf/-/issues/8 --- badwolf.c | 18 ++++++++++++------ badwolf.h | 2 +- keybindings.c | 6 ++++-- po/messages.pot | 18 +++++++++--------- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/badwolf.c b/badwolf.c index 6bb0470..d3dcde9 100644 --- a/badwolf.c +++ b/badwolf.c @@ -300,7 +300,7 @@ WebViewCb_create(WebKitWebView *related_web_view, browser = new_browser(old_browser->window, NULL, old_browser); - if(badwolf_new_tab(GTK_NOTEBOOK(old_browser->window->notebook), browser) < 0) + if(badwolf_new_tab(GTK_NOTEBOOK(old_browser->window->notebook), browser, FALSE) < 0) return NULL; else return browser->webView; @@ -839,7 +839,8 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b return browser; } -/* badwolf_new_tab: Inserts struct Client *browser in GtkNotebook *notebook +/* badwolf_new_tab: Inserts struct Client *browser in GtkNotebook *notebook + * and optionally switches selected tab to it. * * returns: * 0 : Ran successfully @@ -847,7 +848,7 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b * -2 : browser is NULL */ int -badwolf_new_tab(GtkNotebook *notebook, struct Client *browser) +badwolf_new_tab(GtkNotebook *notebook, struct Client *browser, bool auto_switch) { gint current_page = gtk_notebook_get_current_page(notebook); gchar *title = _("New tab"); @@ -864,6 +865,11 @@ badwolf_new_tab(GtkNotebook *notebook, struct Client *browser) gtk_widget_queue_draw(GTK_WIDGET(notebook)); + if(auto_switch) + { + gtk_notebook_set_current_page(notebook, gtk_notebook_page_num(notebook, browser->box)); + } + return 0; } @@ -874,7 +880,7 @@ new_tabCb_clicked(GtkButton *new_tab, gpointer user_data) struct Window *window = (struct Window *)user_data; struct Client *browser = new_browser(window, NULL, NULL); - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), browser); + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), browser, TRUE); } static void @@ -982,10 +988,10 @@ main(int argc, char *argv[]) gtk_widget_show_all(window->main_window); if(argc == 1) - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, NULL, NULL)); + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, NULL, NULL), FALSE); else for(int i = 1; i < argc; ++i) - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, argv[i], NULL)); + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, argv[i], NULL), FALSE); gtk_notebook_set_current_page(GTK_NOTEBOOK(window->notebook), 1); diff --git a/badwolf.h b/badwolf.h index 530f9c8..a375be6 100644 --- a/badwolf.h +++ b/badwolf.h @@ -39,6 +39,6 @@ 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, const gchar *target_url, struct Client *old_browser); -int badwolf_new_tab(GtkNotebook *notebook, struct Client *browser); +int badwolf_new_tab(GtkNotebook *notebook, struct Client *browser, bool auto_switch); gint badwolf_get_tab_position(GtkContainer *notebook, GtkWidget *child); #endif /* BADWOLF_H_INCLUDED */ diff --git a/keybindings.c b/keybindings.c index 75860ed..95e3fd5 100644 --- a/keybindings.c +++ b/keybindings.c @@ -14,7 +14,7 @@ about_dialogCb_activate_link(GtkAboutDialog *about_dialog, gchar *uri, gpointer (void)about_dialog; struct Window *window = (struct Window *)user_data; - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, uri, NULL)); + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, uri, NULL), FALSE); gtk_widget_destroy(GTK_WIDGET(about_dialog)); @@ -112,7 +112,9 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client * { case GDK_KEY_Page_Down: gtk_notebook_next_page(notebook); return TRUE; case GDK_KEY_Page_Up: gtk_notebook_prev_page(notebook); return TRUE; - case GDK_KEY_t: badwolf_new_tab(notebook, new_browser(window, NULL, NULL)); return TRUE; + case GDK_KEY_t: + badwolf_new_tab(notebook, new_browser(window, NULL, NULL), TRUE); + return TRUE; } } } diff --git a/po/messages.pot b/po/messages.pot index b2ca404..fd9ca35 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.0+g498bce5.develop\n" +"Project-Id-Version: Badwolf 1.0.0+ge94212d.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-07-04 06:53+0200\n" +"POT-Creation-Date: 2020-07-04 07:13+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,7 +41,7 @@ msgstr "" msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:913 +#: badwolf.c:919 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" @@ -100,11 +100,11 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:853 +#: badwolf.c:854 msgid "New tab" msgstr "" -#: badwolf.c:962 +#: badwolf.c:968 msgid "Open new tab" msgstr "" @@ -112,12 +112,12 @@ msgstr "" msgid "Out of Memory" msgstr "" -#: badwolf.c:911 +#: badwolf.c:917 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:918 +#: badwolf.c:924 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" @@ -167,12 +167,12 @@ msgstr "" msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:925 +#: badwolf.c:931 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:996 +#: badwolf.c:1002 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 17b9802a08bac9a12eaa7f2e5d63b8d1e97108bd Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 5 Jul 2020 05:23:28 +0200 Subject: README.md: Inkscape is used instead of rsvg --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 97b27ef..6804aea 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Dependencies are: Compilation is done with `make`, install with `make install` (`DESTDIR` and `PREFIX` environment variables are supported, amongs other common ones). An example AppArmor profile is provided at `usr.bin.badwolf`, please do some long runtime checks before shipping it or a modified version, help can be provided but with no support. -You'll also need `rsvg-convert(1)` (from librsvg) and scour if you want to regenerate the icons, for example after modifying them or adding a new size. These aren't needed for normal installation as it is bundled. +You'll also need inkscape (command line only) if you want to regenerate the icons, for example after modifying them or adding a new size. These aren't needed for normal installation as it is bundled. ## 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 6b58d37c4a86819a39868a37a95444cd2abfc4b4 Mon Sep 17 00:00:00 2001 From: Oğuz Ersen Date: Fri, 17 Jul 2020 21:36:26 +0000 Subject: po/tr.po: Add Turkish translation. --- po/tr.po | 183 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 po/tr.po diff --git a/po/tr.po b/po/tr.po new file mode 100644 index 0000000..040c48c --- /dev/null +++ b/po/tr.po @@ -0,0 +1,183 @@ +# Turkish translations for Badwolf package. +# Copyright (C) 2020 Badwolf Authors +# This file is distributed under the same license as the Badwolf package. +# Oğuz Ersen , 2020. +# +msgid "" +msgstr "" +"Project-Id-Version: Badwolf 1.0.2+g17b9802.develop\n" +"Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" +"POT-Creation-Date: 2020-07-11 11:35+0200\n" +"PO-Revision-Date: 2020-07-17 23:50+0300\n" +"Last-Translator: Oğuz Ersen \n" +"Language-Team: Turkish\n" +"Language: tr\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" + +#: downloads.c:117 +#, c-format +msgid "%02i:%02i:%02i Download cancelled" +msgstr "%02i:%02i:%02i İndirme iptal edildi" + +#: downloads.c:119 +#, c-format +msgid "%02i:%02i:%02i Download error" +msgstr "%02i:%02i:%02i İndirme hatası" + +#: downloads.c:141 +#, c-format +msgid "%02i:%02i:%02i Download finished" +msgstr "%02i:%02i:%02i İndirme tamamlandı" + +#: downloads.c:167 +#, c-format +msgid "%02i:%02i:%02i Downloading…" +msgstr "%02i:%02i:%02i İndiriliyor…" + +#: downloads.c:199 downloads.c:216 downloads.c:219 +msgid "Badwolf Downloads" +msgstr "Badwolf İndirmeleri" + +#: badwolf.c:919 +#, c-format +msgid "Buildtime WebKit version: %d.%d.%d\n" +msgstr "Oluşturma zamanı WebKit sürümü: %d.%d.%d\n" + +#: badwolf.c:416 +msgid "Continue" +msgstr "Devam Et" + +#: badwolf.c:366 +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 "" +"Bağlantının güvenliğini daha iyi sağlamak için TLS sertifikası " +"doğrulanamadı. Makinenizi ve ağınızı doğrulamak isteyebilirsiniz.\n" +"\n" + +#: badwolf.c:99 +msgid "Crashed" +msgstr "Çöktü" + +#: downloads.c:39 +msgid "Download starting…" +msgstr "İndirme başlatılıyor…" + +#: badwolf.c:389 +msgid "Error: Some unknown error occurred validating the certificate.\n" +msgstr "Hata: Sertifika doğrulanırken bilinmeyen bir hata oluştu.\n" + +#: badwolf.c:370 +msgid "Error: The X509 Certificate Authority is unknown.\n" +msgstr "Hata: X509 Sertifika Yetkilisi bilinmiyor.\n" + +#: badwolf.c:383 +msgid "Error: The certificate has been revoked.\n" +msgstr "Hata: Sertifika yürürlükten kaldırıldı.\n" + +#: badwolf.c:380 +msgid "Error: The certificate has expired. Check your system's clock.\n" +msgstr "Hata: Sertifikanın süresi doldu. Sisteminizin saatini gözden geçirin.\n" + +#: badwolf.c:386 +msgid "Error: The certificate is considered to be insecure.\n" +msgstr "Hata: Sertifikanın güvensiz olduğu kabul ediliyor.\n" + +#: badwolf.c:377 +msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" +msgstr "Hata: Sertifika henüz geçerli değil. Sisteminizin saatini gözden geçirin.\n" + +#: badwolf.c:373 +msgid "Error: The given identity doesn't match the expected one.\n" +msgstr "Hata: Verilen kimlik beklenen ile eşleşmiyor.\n" + +#: keybindings.c:32 +#, c-format +msgid "" +"Minimalist and privacy-oriented WebKitGTK+ browser\n" +"Runtime WebKit version: %d.%d.%d" +msgstr "" +"Sadelik ve gizlilik odaklı WebKitGTK+ tarayıcısı\n" +"Çalışma zamanı WebKit sürümü: %d.%d.%d" + +#: badwolf.c:854 +msgid "New tab" +msgstr "Yeni sekme" + +#: badwolf.c:968 +msgid "Open new tab" +msgstr "Yeni sekme aç" + +#: badwolf.c:103 +msgid "Out of Memory" +msgstr "Yetersiz Bellek" + +#: badwolf.c:917 +#, c-format +msgid "Running Badwolf version: %s\n" +msgstr "Çalışan Badwolf sürümü: %s\n" + +#: badwolf.c:924 +#, c-format +msgid "Runtime WebKit version: %d.%d.%d\n" +msgstr "Çalışma zamanı WebKit sürümü: %d.%d.%d\n" + +#: badwolf.c:413 +#, c-format +msgid "TLS Error for %s." +msgstr "%s için TLS Hatası." + +#: badwolf.c:416 +msgid "Temporarily Add Exception" +msgstr "Geçici Olarak İstisna Ekle" + +#: badwolf.c:624 +msgid "Toggle javascript" +msgstr "Javascript'i aç/kapat" + +#: badwolf.c:629 +msgid "Toggle loading images automatically" +msgstr "Resimleri otomatik yüklemeyi aç/kapat" + +#: badwolf.c:107 +msgid "Unknown Crash" +msgstr "Bilinmeyen Çökme" + +#: badwolf.c:627 +msgid "_IMG" +msgstr "_RSM" + +#: badwolf.c:622 +msgid "_JS" +msgstr "_JS" + +#: badwolf.c:742 +msgid "search in current page" +msgstr "geçerli sayfada ara" + +#: badwolf.c:98 +msgid "the web process crashed.\n" +msgstr "web işlemi çöktü.\n" + +#: badwolf.c:102 +msgid "the web process exceeded the memory limit.\n" +msgstr "web işlemi bellek sınırını aştı.\n" + +#: badwolf.c:106 +msgid "the web process terminated for an unknown reason.\n" +msgstr "web işlemi bilinmeyen bir nedenle sona erdi.\n" + +#: badwolf.c:931 +#, c-format +msgid "webkit-web-extension directory set to: %s\n" +msgstr "webkit-web-extension dizini şuna ayarlandı: %s\n" + +#. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. +#: badwolf.c:1002 +msgid "ø" +msgstr "" -- cgit v1.3.1-23-gd82d From 46812bf39b6a4502f60aa3766b7d503d0534393c Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 10 Aug 2020 20:08:14 +0200 Subject: Makefile: Add tr.mo to translations --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1500c84..73b8dc0 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ OBJS = uri.o keybindings.o downloads.o badwolf.o OBJS_test = uri_test.o EXE = badwolf EXE_test = uri_test -TRANS = fr.mo pt_BR.mo +TRANS = fr.mo pt_BR.mo tr.mo DOCS = usr.bin.badwolf README.md KnowledgeBase.md interface.txt CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" -- cgit v1.3.1-23-gd82d From 2893b270d50bf4fa036439695febd51fdc6fcb08 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 11 Aug 2020 20:40:44 +0200 Subject: badwolf: declare private global as static --- badwolf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/badwolf.c b/badwolf.c index d3dcde9..9d4d3eb 100644 --- a/badwolf.c +++ b/badwolf.c @@ -16,10 +16,11 @@ #include /* malloc() */ #include /* access() */ -gchar *web_extensions_directory; -const gchar *homepage = "https://hacktivis.me/projects/badwolf"; -const gchar *version = VERSION; -int context_id_counter = 0; +const gchar *homepage = "https://hacktivis.me/projects/badwolf"; +const gchar *version = VERSION; + +static gchar *web_extensions_directory; +static int context_id_counter = 0; static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data); static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView, -- cgit v1.3.1-23-gd82d From 6c764f63abe75d1d8747efd34dd097e744e515dd Mon Sep 17 00:00:00 2001 From: nXecure Date: Thu, 20 Aug 2020 10:26:28 +0000 Subject: Makefile: Make cp command of badwolf binary consistent with others --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 73b8dc0..0cf6b1e 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ test: $(EXE_test) .PHONY: install install: all mkdir -p $(DESTDIR)$(BINDIR) - cp -p badwolf $(DESTDIR)$(BINDIR)/badwolf + cp -p badwolf $(DESTDIR)$(BINDIR) mkdir -p $(DESTDIR)$(MANDIR)/man1 cp -p badwolf.1 $(DESTDIR)$(MANDIR)/man1 mkdir -p $(DESTDIR)$(DATADIR)/locale -- cgit v1.3.1-23-gd82d From 3a0b708a88209682bf813ac50cd21e4f8014839a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 20 Aug 2020 23:08:23 +0200 Subject: Makefile: Make all cp command end with a / on directory targets --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0cf6b1e..a136a28 100644 --- a/Makefile +++ b/Makefile @@ -78,12 +78,12 @@ test: $(EXE_test) .PHONY: install install: all mkdir -p $(DESTDIR)$(BINDIR) - cp -p badwolf $(DESTDIR)$(BINDIR) + cp -p badwolf $(DESTDIR)$(BINDIR)/ mkdir -p $(DESTDIR)$(MANDIR)/man1 - cp -p badwolf.1 $(DESTDIR)$(MANDIR)/man1 + cp -p badwolf.1 $(DESTDIR)$(MANDIR)/man1/ mkdir -p $(DESTDIR)$(DATADIR)/locale - cp -r locale/ $(DESTDIR)$(DATADIR) - cp interface.css $(DESTDIR)$(DATADIR) + cp -r locale/ $(DESTDIR)$(DATADIR)/ + cp interface.css $(DESTDIR)$(DATADIR)/ mkdir -p $(DESTDIR)$(APPSDIR) cp -p badwolf.desktop $(DESTDIR)$(APPSDIR)/ mkdir -p $(DESTDIR)$(DOCDIR) -- cgit v1.3.1-23-gd82d From 7e427d599e74d8b1b89afafdaa7628a3e8483afb Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 22 Aug 2020 08:15:32 +0200 Subject: badwolf.c: unref web_context and settings, let widget_destroy remove the page --- badwolf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/badwolf.c b/badwolf.c index 9d4d3eb..36950b7 100644 --- a/badwolf.c +++ b/badwolf.c @@ -74,9 +74,6 @@ WebViewCb_close(WebKitWebView *webView, gpointer user_data) { (void)webView; struct Client *browser = (struct Client *)user_data; - GtkNotebook *notebook = GTK_NOTEBOOK(browser->window->notebook); - - gtk_notebook_remove_page(notebook, gtk_notebook_page_num(GTK_NOTEBOOK(notebook), browser->box)); gtk_widget_destroy(browser->box); @@ -680,6 +677,8 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b settings, NULL)); gtk_widget_set_name(GTK_WIDGET(browser->webView), "browser__webView"); + g_object_unref(web_context); + g_object_unref(settings); gtk_box_pack_start( GTK_BOX(browser->toolbar), GTK_WIDGET(browser->back), FALSE, FALSE, BADWOLF_TOOLBAR_PADDING); -- cgit v1.3.1-23-gd82d From b6e995810f9cba4dac83d57643a5f9698699cbad Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 22 Aug 2020 08:35:48 +0200 Subject: badwolf.c: Only create CSS Providers when needed --- badwolf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/badwolf.c b/badwolf.c index 36950b7..d0b337a 100644 --- a/badwolf.c +++ b/badwolf.c @@ -940,10 +940,10 @@ main(int argc, char *argv[]) gtk_window_set_role(GTK_WINDOW(window->main_window), "browser"); gtk_window_set_icon_name(GTK_WINDOW(window->main_window), "badwolf"); - GtkCssProvider *css_provider_app = gtk_css_provider_new(); - gchar *provider_path_app = g_build_filename(DATADIR, "interface.css", NULL); + gchar *provider_path_app = g_build_filename(DATADIR, "interface.css", NULL); if(access(provider_path_app, R_OK) == 0) { + GtkCssProvider *css_provider_app = gtk_css_provider_new(); gtk_css_provider_load_from_path(css_provider_app, provider_path_app, NULL); gtk_style_context_add_provider_for_screen( gtk_widget_get_screen(GTK_WIDGET(window->main_window)), @@ -952,11 +952,11 @@ main(int argc, char *argv[]) } g_free(provider_path_app); - GtkCssProvider *css_provider_user = gtk_css_provider_new(); gchar *provider_path_user = g_build_filename(g_get_user_data_dir(), "badwolf", "interface.css", NULL); if(access(provider_path_user, R_OK) == 0) { + GtkCssProvider *css_provider_user = gtk_css_provider_new(); gtk_css_provider_load_from_path(css_provider_user, provider_path_user, NULL); gtk_style_context_add_provider_for_screen( gtk_widget_get_screen(GTK_WIDGET(window->main_window)), -- cgit v1.3.1-23-gd82d From abb47b4c0faf2eadcdce62c285fea8af7edd8894 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 2 Nov 2019 22:01:00 +0100 Subject: Add completion --- Makefile | 4 ++-- badwolf.1 | 2 ++ badwolf.c | 4 ++++ bookmarks.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ bookmarks.h | 3 +++ 5 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 bookmarks.c create mode 100644 bookmarks.h diff --git a/Makefile b/Makefile index a136a28..8ba3003 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,8 @@ INKSCAPE ?= inkscape ICON_SIZES = icons/hicolor/24x24/apps/badwolf.png icons/hicolor/32x32/apps/badwolf.png icons/hicolor/48x48/apps/badwolf.png icons/hicolor/64x64/apps/badwolf.png icons/hicolor/128x128/apps/badwolf.png icons/hicolor/256x256/apps/badwolf.png DEPS = gtk+-3.0 webkit2gtk-4.0 libsoup-2.4 -SRCS = uri.c uri_test.c keybindings.c downloads.c badwolf.c -OBJS = uri.o keybindings.o downloads.o badwolf.o +SRCS = bookmarks.c uri.c uri_test.c keybindings.c downloads.c badwolf.c +OBJS = bookmarks.o uri.o keybindings.o downloads.o badwolf.o OBJS_test = uri_test.o EXE = badwolf EXE_test = uri_test diff --git a/badwolf.1 b/badwolf.1 index d1bda3e..96a20d3 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -75,6 +75,8 @@ A more generic variable name is also intended to be used in the future. .El .Sh FILES .Bl -tag -width Ds -compact +.It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/URLs.txt +File containing a URL on each line. [UNSTABLE] .It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/webkit-web-extensions/ Directory containing the .Lk https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebExtension.html WebKitWebExtensions diff --git a/badwolf.c b/badwolf.c index d0b337a..bf4916b 100644 --- a/badwolf.c +++ b/badwolf.c @@ -6,6 +6,7 @@ #include "config.h" #include "downloads.h" +#include "bookmarks.h" #include "keybindings.h" #include "uri.h" @@ -738,6 +739,7 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b gtk_entry_set_text(GTK_ENTRY(browser->location), target_url); gtk_entry_set_input_purpose(GTK_ENTRY(browser->location), GTK_INPUT_PURPOSE_URL); + gtk_entry_set_completion(GTK_ENTRY(browser->location), location_completion); gtk_entry_set_placeholder_text(GTK_ENTRY(browser->search), _("search in current page")); @@ -930,6 +932,8 @@ main(int argc, char *argv[]) g_build_filename(g_get_user_data_dir(), "badwolf", "webkit-web-extension", NULL); fprintf(stderr, _("webkit-web-extension directory set to: %s\n"), web_extensions_directory); + location_completion_init(); + window->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); window->notebook = gtk_notebook_new(); window->new_tab = gtk_button_new_from_icon_name("tab-new-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); diff --git a/bookmarks.c b/bookmarks.c new file mode 100644 index 0000000..f43ed46 --- /dev/null +++ b/bookmarks.c @@ -0,0 +1,45 @@ +#include "badwolf.h" +#include "bookmarks.h" + +#include +#include /* g_fprintf() */ + +void +location_completion_init() +{ + GtkTreeIter iter; + GtkListStore *list_store; + GIOChannel *file_channel; + GError *file_err = NULL; + gchar *file_line; + + location_completion = gtk_entry_completion_new(); + + list_store = gtk_list_store_new(1, G_TYPE_STRING); + + gchar *filename = g_build_filename(g_get_user_data_dir(), "badwolf", "URLs.txt", NULL); + g_fprintf(stderr, "URL Completion: loading at %s\n", filename); + file_channel = g_io_channel_new_file(filename, "r", &file_err); + + if(file_channel != NULL) + { + while(G_IO_STATUS_NORMAL == + g_io_channel_read_line(file_channel, &file_line, NULL, NULL, &file_err)) + { + gtk_list_store_append(list_store, &iter); + gtk_list_store_set(list_store, &iter, 0, g_strchomp(file_line), -1); + } + g_free(file_line); + g_io_channel_unref(file_channel); + //g_io_channel_shutdown(file_channel, FALSE, &file_err); + g_fprintf(stderr, "URL Completion: Done.\n"); + } + else + g_fprintf(stderr, "URL Completion: Failed to load file.\n"); + + gtk_list_store_append(list_store, &iter); + gtk_list_store_set(list_store, &iter, 0, homepage, -1); + + gtk_entry_completion_set_model(location_completion, GTK_TREE_MODEL(list_store)); + gtk_entry_completion_set_text_column(location_completion, 0); +} diff --git a/bookmarks.h b/bookmarks.h new file mode 100644 index 0000000..2e44eb3 --- /dev/null +++ b/bookmarks.h @@ -0,0 +1,3 @@ +#include +GtkEntryCompletion *location_completion; +void location_completion_init(); -- cgit v1.3.1-23-gd82d From a7ba36264f3a62013d393075bd992ac252d3e51a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 3 Nov 2019 21:34:46 +0100 Subject: Add support for XBEL Bookmarks --- KnowledgeBase.md | 17 ++++++++++ Makefile | 2 +- README.md | 1 + badwolf.1 | 10 ++++-- badwolf.c | 1 + bookmarks.c | 99 ++++++++++++++++++++++++++++++++++++++++---------------- 6 files changed, 100 insertions(+), 30 deletions(-) diff --git a/KnowledgeBase.md b/KnowledgeBase.md index f5f9f9a..af59415 100644 --- a/KnowledgeBase.md +++ b/KnowledgeBase.md @@ -2,3 +2,20 @@ - WebKit2 Extensions Tutorial: https://blogs.igalia.com/carlosgc/2013/09/10/webkit2gtk-web-process-extensions/ - https://trac.torproject.org/projects/tor/wiki/doc/ImportantGoogleChromeBugs / https://trac.torproject.org/projects/tor/ticket/1925 - https://webkit.org/blog/3476/content-blockers-first-look/ + +# Bookmark formats +The different plain-text formats used by web browsers found in the wild, done +in Augmented Backus–Naur Form (ABNF). + +url = *CHAR +title = *CHAR + +## uzbl +bookmark = URL TAB title [TAB tags] +tags = *(*CHAR SP) + +Documenter comment: How does it manages when the separator (TAB here) is +present in the title? + +## qutebrowser +bookmark = URL SP title diff --git a/Makefile b/Makefile index 8ba3003..8ba9b7e 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ INKSCAPE ?= inkscape # for i in 24 32 48 64 128 256; do echo icons/hicolor/${i}x${i}/apps/badwolf.png; done | tr '\n' ' ' ICON_SIZES = icons/hicolor/24x24/apps/badwolf.png icons/hicolor/32x32/apps/badwolf.png icons/hicolor/48x48/apps/badwolf.png icons/hicolor/64x64/apps/badwolf.png icons/hicolor/128x128/apps/badwolf.png icons/hicolor/256x256/apps/badwolf.png -DEPS = gtk+-3.0 webkit2gtk-4.0 libsoup-2.4 +DEPS = gtk+-3.0 webkit2gtk-4.0 libsoup-2.4 libxml-2.0 SRCS = bookmarks.c uri.c uri_test.c keybindings.c downloads.c badwolf.c OBJS = bookmarks.o uri.o keybindings.o downloads.o badwolf.o OBJS_test = uri_test.o diff --git a/README.md b/README.md index 6804aea..b83d134 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ Dependencies are: - C11 Compiler (such as clang or gcc) - [WebKitGTK](https://webkitgtk.org/), only the latest stable is supported +- [libxml-2.0](http://www.xmlsoft.org/), no known version limitation - 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) diff --git a/badwolf.1 b/badwolf.1 index 96a20d3..6bbe2b2 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -75,8 +75,14 @@ A more generic variable name is also intended to be used in the future. .El .Sh FILES .Bl -tag -width Ds -compact -.It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/URLs.txt -File containing a URL on each line. [UNSTABLE] +.It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/bookmarks.xbel +XBEL (XML Bookmark Exchange Language) file, known to be currently supported by: +.Xr elinks 1 , +.Xr konqueror 1 , +.Xr kbookmarkeditor 1 . Doing a symbolic link from their path works fine. +.Pp +For more information about this format see: +.Lk http://pyxml.sourceforge.net/topics/xbel/ .It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/webkit-web-extensions/ Directory containing the .Lk https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebExtension.html WebKitWebExtensions diff --git a/badwolf.c b/badwolf.c index bf4916b..f284378 100644 --- a/badwolf.c +++ b/badwolf.c @@ -7,6 +7,7 @@ #include "config.h" #include "downloads.h" #include "bookmarks.h" +#include "config.h" #include "keybindings.h" #include "uri.h" diff --git a/bookmarks.c b/bookmarks.c index f43ed46..23cb558 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -1,45 +1,90 @@ -#include "badwolf.h" #include "bookmarks.h" -#include +#include "badwolf.h" + #include /* g_fprintf() */ +#include +#include void -location_completion_init() +location_completion_setup(GtkListStore *list_store) { - GtkTreeIter iter; - GtkListStore *list_store; - GIOChannel *file_channel; - GError *file_err = NULL; - gchar *file_line; + gtk_entry_completion_set_model(location_completion, GTK_TREE_MODEL(list_store)); + gtk_entry_completion_set_text_column(location_completion, 0); +} - location_completion = gtk_entry_completion_new(); +void +location_completion_cleanup(xmlXPathObjectPtr xpathObj, xmlXPathContextPtr xpathCtx, xmlDocPtr doc) +{ + if(xpathObj != NULL) xmlXPathFreeObject(xpathObj); + if(xpathCtx != NULL) xmlXPathFreeContext(xpathCtx); + if(doc != NULL) xmlFreeDoc(doc); +} - list_store = gtk_list_store_new(1, G_TYPE_STRING); +GtkTreeIter +load_xpath_results(GtkListStore *list_store, xmlNodeSetPtr nodes) +{ + GtkTreeIter iter; + int size; - gchar *filename = g_build_filename(g_get_user_data_dir(), "badwolf", "URLs.txt", NULL); - g_fprintf(stderr, "URL Completion: loading at %s\n", filename); - file_channel = g_io_channel_new_file(filename, "r", &file_err); + size = (nodes) ? nodes->nodeNr : 0; - if(file_channel != NULL) - { - while(G_IO_STATUS_NORMAL == - g_io_channel_read_line(file_channel, &file_line, NULL, NULL, &file_err)) + g_fprintf(stderr, "Bookmarks: Found %d bookmarks.\n", size); + for(int i = 0; i < size; i++) + if(nodes->nodeTab[i]) { gtk_list_store_append(list_store, &iter); - gtk_list_store_set(list_store, &iter, 0, g_strchomp(file_line), -1); + gtk_list_store_set( + list_store, &iter, 0, (char *)xmlXPathCastNodeToString(nodes->nodeTab[i]), -1); } - g_free(file_line); - g_io_channel_unref(file_channel); - //g_io_channel_shutdown(file_channel, FALSE, &file_err); - g_fprintf(stderr, "URL Completion: Done.\n"); - } - else - g_fprintf(stderr, "URL Completion: Failed to load file.\n"); + return iter; +} + +void +location_completion_init() +{ + const xmlChar *xpathExpr = "//bookmark/@href"; + char *filename = g_build_filename(g_get_user_data_dir(), "badwolf", "bookmarks.xbel", NULL); + xmlDocPtr doc = NULL; + xmlXPathContextPtr xpathCtx = NULL; + xmlXPathObjectPtr xpathObj = NULL; + GtkTreeIter iter; + GtkListStore *list_store = gtk_list_store_new(1, G_TYPE_STRING); + + location_completion = gtk_entry_completion_new(); gtk_list_store_append(list_store, &iter); gtk_list_store_set(list_store, &iter, 0, homepage, -1); - gtk_entry_completion_set_model(location_completion, GTK_TREE_MODEL(list_store)); - gtk_entry_completion_set_text_column(location_completion, 0); + g_fprintf(stderr, "Bookmarks: loading at %s\n", filename); + doc = xmlParseFile(filename); + if(doc == NULL) + { + g_fprintf(stderr, "Bookmarks: unable to parse file \"%s\"\n", filename); + location_completion_cleanup(xpathObj, xpathCtx, doc); + return; + } + + xpathCtx = xmlXPathNewContext(doc); + if(xpathCtx == NULL) + { + g_fprintf(stderr, "Bookmarks: unable to create new XPath context\n"); + location_completion_cleanup(xpathObj, xpathCtx, doc); + return; + } + + xpathObj = xmlXPathEvalExpression(xpathExpr, xpathCtx); + if(xpathObj == NULL) + { + g_fprintf(stderr, "Bookmarks: unable to evaluate xpath expression \"%s\"\n", xpathExpr); + location_completion_cleanup(xpathObj, xpathCtx, doc); + return; + } + + iter = load_xpath_results(list_store, xpathObj->nodesetval); + + location_completion_cleanup(xpathObj, xpathCtx, doc); + location_completion_setup(list_store); + + g_fprintf(stderr, "Bookmarks: Done.\n"); } -- cgit v1.3.1-23-gd82d From 3f164de8eb38f06138d908536b198dcd507a3a74 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 3 Nov 2019 22:44:18 +0100 Subject: bookmarks.c: Wildcard-based suggestion matching --- bookmarks.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/bookmarks.c b/bookmarks.c index 23cb558..4bbfb8a 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -6,11 +6,30 @@ #include #include +gboolean +location_completion_matches(GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter, gpointer user_data) +{ + (void)user_data; + gchar *buffer; + gchar *pattern; + gboolean result; + + pattern = g_strdup_printf("*%s*", key); + + gtk_tree_model_get(gtk_entry_completion_get_model(completion), iter, 0, &buffer, -1); + result = g_pattern_match_simple(pattern, buffer); + + g_free(buffer); + g_free(pattern); + return result; +} + void location_completion_setup(GtkListStore *list_store) { gtk_entry_completion_set_model(location_completion, GTK_TREE_MODEL(list_store)); gtk_entry_completion_set_text_column(location_completion, 0); + gtk_entry_completion_set_match_func(location_completion, location_completion_matches, NULL, NULL); } void -- cgit v1.3.1-23-gd82d From 41cfd1ccae96dda3378b9666e38e70e547fe87f2 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 4 Nov 2019 20:11:02 +0100 Subject: Show selected completion as a inline-selection --- bookmarks.c | 7 ++++++- config.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bookmarks.c b/bookmarks.c index 4bbfb8a..8a69814 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -1,13 +1,17 @@ #include "bookmarks.h" #include "badwolf.h" +#include "config.h" #include /* g_fprintf() */ #include #include gboolean -location_completion_matches(GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter, gpointer user_data) +location_completion_matches(GtkEntryCompletion *completion, + const gchar *key, + GtkTreeIter *iter, + gpointer user_data) { (void)user_data; gchar *buffer; @@ -30,6 +34,7 @@ location_completion_setup(GtkListStore *list_store) gtk_entry_completion_set_model(location_completion, GTK_TREE_MODEL(list_store)); gtk_entry_completion_set_text_column(location_completion, 0); gtk_entry_completion_set_match_func(location_completion, location_completion_matches, NULL, NULL); + gtk_entry_completion_set_inline_selection(location_completion, BADWOLF_LOCATION_INLINE_SELECTION); } void diff --git a/config.h b/config.h index 8426ce3..6bd76df 100644 --- a/config.h +++ b/config.h @@ -104,4 +104,7 @@ */ #define BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE +// BADWOLF_LOCATION_INLINE_SELECTION: show selected completion as a selection in location entry +#define BADWOLF_LOCATION_INLINE_SELECTION TRUE + #endif /* CONFIG_H_INCLUDED */ -- cgit v1.3.1-23-gd82d From 720eb415a73893bf4c3894c10e27c66996f7e67e Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 16 Dec 2019 14:35:37 +0100 Subject: Fix setting up completion --- badwolf.c | 16 ++++++++++++++-- bookmarks.c | 24 ++++++++++++------------ bookmarks.h | 4 ++-- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/badwolf.c b/badwolf.c index f284378..ca1f5d7 100644 --- a/badwolf.c +++ b/badwolf.c @@ -23,6 +23,7 @@ const gchar *version = VERSION; static gchar *web_extensions_directory; static int context_id_counter = 0; +GtkTreeModel *bookmarks_completion_model; static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data); static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView, @@ -738,9 +739,17 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b gtk_label_set_single_line_mode(GTK_LABEL(browser->statuslabel), TRUE); gtk_label_set_ellipsize(GTK_LABEL(browser->statuslabel), BADWOLF_STATUSLABEL_ELLIPSIZE); + if(bookmarks_completion_model != NULL) + { + GtkEntryCompletion *location_completion = gtk_entry_completion_new(); + GtkTreeModel *location_completion_model = bookmarks_completion_model; + + bookmarks_completion_setup(location_completion, location_completion_model); + gtk_entry_set_completion(GTK_ENTRY(browser->location), location_completion); + } + gtk_entry_set_text(GTK_ENTRY(browser->location), target_url); gtk_entry_set_input_purpose(GTK_ENTRY(browser->location), GTK_INPUT_PURPOSE_URL); - gtk_entry_set_completion(GTK_ENTRY(browser->location), location_completion); gtk_entry_set_placeholder_text(GTK_ENTRY(browser->search), _("search in current page")); @@ -933,7 +942,8 @@ main(int argc, char *argv[]) g_build_filename(g_get_user_data_dir(), "badwolf", "webkit-web-extension", NULL); fprintf(stderr, _("webkit-web-extension directory set to: %s\n"), web_extensions_directory); - location_completion_init(); + bookmarks_completion_model = bookmarks_completion_init(); + g_object_ref(bookmarks_completion_model); window->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); window->notebook = gtk_notebook_new(); @@ -1002,6 +1012,8 @@ main(int argc, char *argv[]) gtk_main(); + g_object_unref(bookmarks_completion_model); + #if 0 /* TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. */ _("ø"); diff --git a/bookmarks.c b/bookmarks.c index 8a69814..59faf95 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -7,7 +7,7 @@ #include #include -gboolean +static gboolean location_completion_matches(GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter, @@ -29,15 +29,15 @@ location_completion_matches(GtkEntryCompletion *completion, } void -location_completion_setup(GtkListStore *list_store) +bookmarks_completion_setup(GtkEntryCompletion *location_completion, GtkTreeModel *tree_model) { - gtk_entry_completion_set_model(location_completion, GTK_TREE_MODEL(list_store)); + gtk_entry_completion_set_model(location_completion, tree_model); gtk_entry_completion_set_text_column(location_completion, 0); gtk_entry_completion_set_match_func(location_completion, location_completion_matches, NULL, NULL); gtk_entry_completion_set_inline_selection(location_completion, BADWOLF_LOCATION_INLINE_SELECTION); } -void +static void location_completion_cleanup(xmlXPathObjectPtr xpathObj, xmlXPathContextPtr xpathCtx, xmlDocPtr doc) { if(xpathObj != NULL) xmlXPathFreeObject(xpathObj); @@ -45,7 +45,7 @@ location_completion_cleanup(xmlXPathObjectPtr xpathObj, xmlXPathContextPtr xpath if(doc != NULL) xmlFreeDoc(doc); } -GtkTreeIter +static GtkTreeIter load_xpath_results(GtkListStore *list_store, xmlNodeSetPtr nodes) { GtkTreeIter iter; @@ -65,8 +65,8 @@ load_xpath_results(GtkListStore *list_store, xmlNodeSetPtr nodes) return iter; } -void -location_completion_init() +GtkTreeModel * +bookmarks_completion_init() { const xmlChar *xpathExpr = "//bookmark/@href"; char *filename = g_build_filename(g_get_user_data_dir(), "badwolf", "bookmarks.xbel", NULL); @@ -76,7 +76,6 @@ location_completion_init() GtkTreeIter iter; GtkListStore *list_store = gtk_list_store_new(1, G_TYPE_STRING); - location_completion = gtk_entry_completion_new(); gtk_list_store_append(list_store, &iter); gtk_list_store_set(list_store, &iter, 0, homepage, -1); @@ -86,7 +85,7 @@ location_completion_init() { g_fprintf(stderr, "Bookmarks: unable to parse file \"%s\"\n", filename); location_completion_cleanup(xpathObj, xpathCtx, doc); - return; + return NULL; } xpathCtx = xmlXPathNewContext(doc); @@ -94,7 +93,7 @@ location_completion_init() { g_fprintf(stderr, "Bookmarks: unable to create new XPath context\n"); location_completion_cleanup(xpathObj, xpathCtx, doc); - return; + return NULL; } xpathObj = xmlXPathEvalExpression(xpathExpr, xpathCtx); @@ -102,13 +101,14 @@ location_completion_init() { g_fprintf(stderr, "Bookmarks: unable to evaluate xpath expression \"%s\"\n", xpathExpr); location_completion_cleanup(xpathObj, xpathCtx, doc); - return; + return NULL; } iter = load_xpath_results(list_store, xpathObj->nodesetval); location_completion_cleanup(xpathObj, xpathCtx, doc); - location_completion_setup(list_store); g_fprintf(stderr, "Bookmarks: Done.\n"); + + return GTK_TREE_MODEL(list_store); } diff --git a/bookmarks.h b/bookmarks.h index 2e44eb3..29bd553 100644 --- a/bookmarks.h +++ b/bookmarks.h @@ -1,3 +1,3 @@ #include -GtkEntryCompletion *location_completion; -void location_completion_init(); +GtkTreeModel *bookmarks_completion_init(); +void bookmarks_completion_setup(GtkEntryCompletion *location_completion, GtkTreeModel *tree_model); -- cgit v1.3.1-23-gd82d From 5af5a723bfa9a3da2df754e63a3833445ecdb49b Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 22 Aug 2020 07:53:38 +0200 Subject: bookmarks: Check for access before reading, remove homepage --- bookmarks.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bookmarks.c b/bookmarks.c index 59faf95..dcf579d 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -6,6 +6,7 @@ #include /* g_fprintf() */ #include #include +#include /* access() */ static gboolean location_completion_matches(GtkEntryCompletion *completion, @@ -76,8 +77,10 @@ bookmarks_completion_init() GtkTreeIter iter; GtkListStore *list_store = gtk_list_store_new(1, G_TYPE_STRING); - gtk_list_store_append(list_store, &iter); - gtk_list_store_set(list_store, &iter, 0, homepage, -1); + if(access(filename, R_OK) != 0) { + g_fprintf(stderr, "Bookmarks: No loadable file found at %s\n", filename); + return NULL; + } g_fprintf(stderr, "Bookmarks: loading at %s\n", filename); doc = xmlParseFile(filename); -- cgit v1.3.1-23-gd82d From 140404d3c9ba28d75c5bccd31b405af614afe352 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 11 Oct 2020 08:26:55 +0200 Subject: badwolf: Remove GTK_THEME hack WebKitGTK 2.30.0 removed usage of the system's GTK Theme for the WebView --- badwolf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/badwolf.c b/badwolf.c index ca1f5d7..ba26f88 100644 --- a/badwolf.c +++ b/badwolf.c @@ -644,8 +644,6 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b browser->statuslabel = gtk_label_new(NULL); gtk_widget_set_name(browser->statuslabel, "browser__statuslabel"); - setenv("GTK_THEME", ":light", 0); - WebKitWebContext *web_context = webkit_web_context_new_ephemeral(); webkit_web_context_set_sandbox_enabled(web_context, TRUE); webkit_web_context_set_process_model(web_context, -- cgit v1.3.1-23-gd82d From a702a8c2a7c173174804165e05f314549753e289 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 11 Oct 2020 09:17:54 +0200 Subject: Enable Intelligent Tracking Protection (ITP) Note: Permission requests are still stuck to deny by default, so third-party domains are always denied access --- badwolf.c | 10 ++++++---- bookmarks.c | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/badwolf.c b/badwolf.c index ba26f88..065aeb8 100644 --- a/badwolf.c +++ b/badwolf.c @@ -4,10 +4,9 @@ #include "badwolf.h" -#include "config.h" -#include "downloads.h" #include "bookmarks.h" #include "config.h" +#include "downloads.h" #include "keybindings.h" #include "uri.h" @@ -644,11 +643,14 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b browser->statuslabel = gtk_label_new(NULL); gtk_widget_set_name(browser->statuslabel, "browser__statuslabel"); - WebKitWebContext *web_context = webkit_web_context_new_ephemeral(); + WebKitWebsiteDataManager *website_data_manager = webkit_website_data_manager_new_ephemeral(); + webkit_website_data_manager_set_itp_enabled(website_data_manager, TRUE); + + WebKitWebContext *web_context = + webkit_web_context_new_with_website_data_manager(website_data_manager); webkit_web_context_set_sandbox_enabled(web_context, TRUE); webkit_web_context_set_process_model(web_context, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); - webkit_web_context_set_web_extensions_directory(web_context, web_extensions_directory); badwolf_l10n = getenv("BADWOLF_L10N"); diff --git a/bookmarks.c b/bookmarks.c index dcf579d..c6e2ece 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -6,7 +6,7 @@ #include /* g_fprintf() */ #include #include -#include /* access() */ +#include /* access() */ static gboolean location_completion_matches(GtkEntryCompletion *completion, @@ -77,7 +77,8 @@ bookmarks_completion_init() GtkTreeIter iter; GtkListStore *list_store = gtk_list_store_new(1, G_TYPE_STRING); - if(access(filename, R_OK) != 0) { + if(access(filename, R_OK) != 0) + { g_fprintf(stderr, "Bookmarks: No loadable file found at %s\n", filename); return NULL; } -- cgit v1.3.1-23-gd82d From 2938c5cf138bef4f65644d9213233fa0e5a5ee6f Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 11 Oct 2020 20:50:39 +0200 Subject: bookmarks: Add support for XInclude --- badwolf.1 | 2 +- bookmarks.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/badwolf.1 b/badwolf.1 index 6bbe2b2..ca02f83 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -79,7 +79,7 @@ A more generic variable name is also intended to be used in the future. XBEL (XML Bookmark Exchange Language) file, known to be currently supported by: .Xr elinks 1 , .Xr konqueror 1 , -.Xr kbookmarkeditor 1 . Doing a symbolic link from their path works fine. +.Xr kbookmarkeditor 1 . Doing a symbolic link from their path works fine but you might also want to use XInclude to merge multiple XBEL files. .Pp For more information about this format see: .Lk http://pyxml.sourceforge.net/topics/xbel/ diff --git a/bookmarks.c b/bookmarks.c index c6e2ece..6d35216 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -92,6 +92,8 @@ bookmarks_completion_init() return NULL; } + xmlXIncludeProcess(doc); + xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { -- cgit v1.3.1-23-gd82d From 6fa3ab417f9339a7dcfbbdf4e0909e58298c3d39 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 17 Oct 2020 07:26:16 +0200 Subject: bookmarks: Fix compiler warnings --- bookmarks.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bookmarks.c b/bookmarks.c index 6d35216..2eb321d 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -5,6 +5,7 @@ #include /* g_fprintf() */ #include +#include #include #include /* access() */ @@ -46,7 +47,7 @@ location_completion_cleanup(xmlXPathObjectPtr xpathObj, xmlXPathContextPtr xpath if(doc != NULL) xmlFreeDoc(doc); } -static GtkTreeIter +static void load_xpath_results(GtkListStore *list_store, xmlNodeSetPtr nodes) { GtkTreeIter iter; @@ -62,20 +63,17 @@ load_xpath_results(GtkListStore *list_store, xmlNodeSetPtr nodes) gtk_list_store_set( list_store, &iter, 0, (char *)xmlXPathCastNodeToString(nodes->nodeTab[i]), -1); } - - return iter; } GtkTreeModel * bookmarks_completion_init() { - const xmlChar *xpathExpr = "//bookmark/@href"; + const xmlChar *xpathExpr = (const xmlChar *)"//bookmark/@href"; char *filename = g_build_filename(g_get_user_data_dir(), "badwolf", "bookmarks.xbel", NULL); xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; - GtkTreeIter iter; - GtkListStore *list_store = gtk_list_store_new(1, G_TYPE_STRING); + GtkListStore *list_store = gtk_list_store_new(1, G_TYPE_STRING); if(access(filename, R_OK) != 0) { @@ -110,7 +108,7 @@ bookmarks_completion_init() return NULL; } - iter = load_xpath_results(list_store, xpathObj->nodesetval); + load_xpath_results(list_store, xpathObj->nodesetval); location_completion_cleanup(xpathObj, xpathCtx, doc); -- cgit v1.3.1-23-gd82d From 639754df3fe028535bffe618320f24f23d13b85e Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 22 Oct 2020 20:03:46 +0200 Subject: decisions.md: Add rationale on tab-create behavior change --- decisions.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/decisions.md b/decisions.md index cc8ab5c..7d0712e 100644 --- a/decisions.md +++ b/decisions.md @@ -5,6 +5,12 @@ 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-07-04 : Automatically switch to a user-created tab / Breaking the UI +I got pointed out that when creating a new tab the user has to needlessly switch to it while it could be done when they request it. +I also decided to still release it in a point release, so without bump of Major because while it does changes the behavior it doesn't break the associated meaning, while this would be a breaking change for an API I could take it as a minor adjustment in a user-interface. + +Note: This would be an API if user-interface interactions could be scripted (like in HaikuOS) but I'm not aware of people actually doing this one with GTK programs. + ## 2020-02-04 & 2020-02-09 : Use BSD extensions in the Makefile 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. They are also compatible with GNU make so portability shouldn't have significantly dropped. -- cgit v1.3.1-23-gd82d From 38cbe249da856189a8463d3d49a96dbaf0df72db Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 22 Oct 2020 20:02:08 +0200 Subject: badwolf.1: Update description to include "web browser" As suggested by msiism on IRC --- badwolf.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badwolf.1 b/badwolf.1 index ca02f83..68a39ed 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -5,7 +5,7 @@ .Dt BADWOLF 1 .Sh NAME .Nm badwolf -.Nd minimalist and privacy-oriented WebkitGTK browser +.Nd minimalist and privacy-oriented web browser based on WebKitGTK .Sh SYNOPSIS .Nm .Op Ar webkit/gtk options -- cgit v1.3.1-23-gd82d From e5b4b5db6fcf7db93491d9a30ba6fb16b4146bb4 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 23 Oct 2020 02:25:07 +0200 Subject: badwolf: Fix setting "browser__tabbox__context_label" --- badwolf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badwolf.c b/badwolf.c index 065aeb8..665f144 100644 --- a/badwolf.c +++ b/badwolf.c @@ -146,7 +146,7 @@ badwolf_new_tab_box(const gchar *title, struct Client *browser) GtkWidget *label = gtk_label_new(title); gtk_widget_set_name(label, "browser__tabbox__label"); GtkWidget *context_label = gtk_label_new(context_id_str); - gtk_widget_set_name(label, "browser__tabbox__context_label"); + gtk_widget_set_name(context_label, "browser__tabbox__context_label"); GtkWidget *playing = gtk_image_new_from_icon_name("audio-volume-high-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_widget_set_name(playing, "browser__tabbox__playing"); -- cgit v1.3.1-23-gd82d From 74b19d30081537e052b314acf3752c5ee26a0e2c Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 23 Oct 2020 02:27:33 +0200 Subject: interface.css: Make context_label monospace --- interface.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface.css b/interface.css index d7272bf..170097e 100644 --- a/interface.css +++ b/interface.css @@ -1,2 +1,2 @@ -#browser__location, #browser__statuslabel { font-family: monospace; } +#browser__location, #browser__statuslabel, #browser__tabbox__context_label { font-family: monospace; } button:checked label { font-weight: bold; } -- cgit v1.3.1-23-gd82d From c2b4c8fb07b50c064d8ffe5ce02e84e21b6cffaa Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 26 Oct 2020 07:28:06 +0100 Subject: Use [A..Z] instead of [0..F] for representing the context_id --- badwolf.c | 29 ++++++++++++++++++++++++++--- badwolf.h | 2 +- interface.txt | 2 +- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/badwolf.c b/badwolf.c index 665f144..0d391e1 100644 --- a/badwolf.c +++ b/badwolf.c @@ -21,7 +21,7 @@ const gchar *homepage = "https://hacktivis.me/projects/badwolf"; const gchar *version = VERSION; static gchar *web_extensions_directory; -static int context_id_counter = 0; +static uint64_t context_id_counter = 0; GtkTreeModel *bookmarks_completion_model; static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data); @@ -130,13 +130,36 @@ WebViewCb_notify__uri(WebKitWebView *webView, GParamSpec *pspec, gpointer user_d return TRUE; } +static char * +fmt_context_id(uint64_t num, char *out) +{ + const char alpha_digits[27] = {" ABCDEFGHIJKLMNOPQRSTUVWXYZ"}; + char buf[66] = {'\0'}; + int i, len = 0; + + // Get 0 = 'A' instead of 0 = '' and 1 = 'A' + num++; + + buf[len++] = ' '; + buf[len++] = ':'; + do + { + buf[len++] = alpha_digits[num % 26]; + } while(num /= 26); + + for(i = 0; len > 0; i++) + out[i] = buf[--len]; + + return out; +} + GtkWidget * badwolf_new_tab_box(const gchar *title, struct Client *browser) { (void)browser; - char context_id_str[7]; + char context_id_str[7] = ""; - snprintf(context_id_str, 7, "%4X: ", browser->context_id); + fmt_context_id(browser->context_id, context_id_str); GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(tab_box, "browser__tabbox"); diff --git a/badwolf.h b/badwolf.h index a375be6..8a4edec 100644 --- a/badwolf.h +++ b/badwolf.h @@ -26,7 +26,7 @@ struct Client GtkWidget *auto_load_images; GtkWidget *location; - int context_id; + uint64_t context_id; WebKitWebView *webView; struct Window *window; diff --git a/interface.txt b/interface.txt index f23a149..42f7f5c 100644 --- a/interface.txt +++ b/interface.txt @@ -3,7 +3,7 @@ - Each tab contains a Browser View or the Downloads View ## Tab Labels -- An hexadecimal number identifying the webkit process context +- An A-Z represented number identifying the webkit process context - An icon to indicate if a media is playing - The title of the web view - A close button -- cgit v1.3.1-23-gd82d From d88eca3e85906ca9458a8f0da89c85ddf5e9882d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 25 Oct 2020 02:23:59 +0100 Subject: Makefile: Add hardening cflags --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b988e41..7b24b4d 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ DATADIR ?= $(PREFIX)/share/badwolf APPSDIR ?= $(PREFIX)/share/applications CC ?= cc -CFLAGS ?= -g -Wall -Wextra -Wconversion -Wsign-conversion -O2 +CFLAGS ?= -g -O2 -fPIC -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -Wsign-conversion -O2 -Werror=implicit-function-declaration -Werror=implicit-int -Werror=vla DBG ?= PKGCONFIG ?= pkg-config MSGFMT ?= msgfmt -- cgit v1.3.1-23-gd82d From 506ea6fa32138827a103cf11cc174f4a0f3a25c3 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 25 Oct 2020 02:42:10 +0100 Subject: Add _() to bookmarks.c and update french translation --- bookmarks.c | 15 ++++----- po/fr.po | 95 ++++++++++++++++++++++++++++++++++++++------------------- po/messages.pot | 83 ++++++++++++++++++++++++++++++++++--------------- po/pt_BR.po | 83 ++++++++++++++++++++++++++++++++++--------------- po/tr.po | 87 ++++++++++++++++++++++++++++++++++++---------------- 5 files changed, 249 insertions(+), 114 deletions(-) diff --git a/bookmarks.c b/bookmarks.c index 2eb321d..2a6df22 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -3,6 +3,7 @@ #include "badwolf.h" #include "config.h" +#include /* _() and other internationalization/localization helpers */ #include /* g_fprintf() */ #include #include @@ -55,7 +56,7 @@ load_xpath_results(GtkListStore *list_store, xmlNodeSetPtr nodes) size = (nodes) ? nodes->nodeNr : 0; - g_fprintf(stderr, "Bookmarks: Found %d bookmarks.\n", size); + g_fprintf(stderr, _("Bookmarks: Found %d bookmarks.\n"), size); for(int i = 0; i < size; i++) if(nodes->nodeTab[i]) { @@ -77,15 +78,15 @@ bookmarks_completion_init() if(access(filename, R_OK) != 0) { - g_fprintf(stderr, "Bookmarks: No loadable file found at %s\n", filename); + g_fprintf(stderr, _("Bookmarks: No loadable file found at %s\n"), filename); return NULL; } - g_fprintf(stderr, "Bookmarks: loading at %s\n", filename); + g_fprintf(stderr, _("Bookmarks: loading at %s\n"), filename); doc = xmlParseFile(filename); if(doc == NULL) { - g_fprintf(stderr, "Bookmarks: unable to parse file \"%s\"\n", filename); + g_fprintf(stderr, _("Bookmarks: unable to parse file \"%s\"\n"), filename); location_completion_cleanup(xpathObj, xpathCtx, doc); return NULL; } @@ -95,7 +96,7 @@ bookmarks_completion_init() xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { - g_fprintf(stderr, "Bookmarks: unable to create new XPath context\n"); + g_fprintf(stderr, _("Bookmarks: unable to create new XPath context\n")); location_completion_cleanup(xpathObj, xpathCtx, doc); return NULL; } @@ -103,7 +104,7 @@ bookmarks_completion_init() xpathObj = xmlXPathEvalExpression(xpathExpr, xpathCtx); if(xpathObj == NULL) { - g_fprintf(stderr, "Bookmarks: unable to evaluate xpath expression \"%s\"\n", xpathExpr); + g_fprintf(stderr, _("Bookmarks: unable to evaluate XPath expression \"%s\"\n"), xpathExpr); location_completion_cleanup(xpathObj, xpathCtx, doc); return NULL; } @@ -112,7 +113,7 @@ bookmarks_completion_init() location_completion_cleanup(xpathObj, xpathCtx, doc); - g_fprintf(stderr, "Bookmarks: Done.\n"); + g_fprintf(stderr, _("Bookmarks: Done.\n")); return GTK_TREE_MODEL(list_store); } diff --git a/po/fr.po b/po/fr.po index d41f044..d938819 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-05-15 06:00+0200\n" +"POT-Creation-Date: 2020-10-25 02:35+0100\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -37,20 +37,53 @@ msgstr "%02i:%02i:%02i Téléchargement finit" msgid "%02i:%02i:%02i Downloading…" msgstr "%02i:%02i:%02i Téléchargement en cours…" -#: downloads.c:195 downloads.c:212 downloads.c:215 +#: downloads.c:199 downloads.c:216 downloads.c:219 msgid "Badwolf Downloads" msgstr "Téléchargements Badwolf" -#: badwolf.c:861 +#: bookmarks.c:116 +msgid "Bookmarks: Done.\n" +msgstr "Marque-Pages: Terminé.\n" + +#: bookmarks.c:59 +#, c-format +msgid "Bookmarks: Found %d bookmarks.\n" +msgstr "Marque-Pages: %d marque-pages trouvés.\n" + +#: bookmarks.c:81 +#, c-format +msgid "Bookmarks: No loadable file found at %s\n" +msgstr "Marques-Pages: Aucun fichier chargeable trouvé à %s\n" + +#: bookmarks.c:85 +#, c-format +msgid "Bookmarks: loading at %s\n" +msgstr "Marques-Pages: chargement à %s\n" + +#: bookmarks.c:99 +msgid "Bookmarks: unable to create new XPath context\n" +msgstr "Marques-Pages: Échec à la création du contexte XPath\n" + +#: bookmarks.c:107 +#, c-format +msgid "Bookmarks: unable to evaluate XPath expression \"%s\"\n" +msgstr "Marques-Pages: Échec à l'évaluation de l'expression XPath « %s »\n" + +#: bookmarks.c:89 +#, c-format +msgid "Bookmarks: unable to parse file \"%s\"\n" +msgstr "Marques-Pages: Ëchec au parsage du fichier « %s »\n" + +#: badwolf.c:954 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit à la compilation: %d.%d.%d\n" -#: badwolf.c:391 +#: badwolf.c:439 msgid "Continue" msgstr "Continuer" -#: badwolf.c:341 +#: badwolf.c:389 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" @@ -61,7 +94,7 @@ msgstr "" "et son réseau.\n" "\n" -#: badwolf.c:98 +#: badwolf.c:99 msgid "Crashed" msgstr "Crash" @@ -69,33 +102,33 @@ msgstr "Crash" msgid "Download starting…" msgstr "Démarrage du téléchargement" -#: badwolf.c:364 +#: badwolf.c:412 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:345 +#: badwolf.c:393 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Erreur : L'autorité de certification (CA X509) est inconnue.\n" -#: badwolf.c:358 +#: badwolf.c:406 msgid "Error: The certificate has been revoked.\n" msgstr "Erreur : Le certificat à été révoqué.\n" -#: badwolf.c:355 +#: badwolf.c:403 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "Erreur : Le certificat a expiré.\n" -#: badwolf.c:361 +#: badwolf.c:409 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Erreur : Le certificat est considéré comme non-sécurisé.\n" -#: badwolf.c:352 +#: badwolf.c:400 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:348 +#: badwolf.c:396 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erreur : L'identité ne correspond pas à celle attendue.\n" @@ -108,80 +141,80 @@ msgstr "" "Navigateur WebKitGTK+ minimaliste et orienté vie privée\n" "Version WebKit au lancement: %d.%d.%d" -#: badwolf.c:790 +#: badwolf.c:889 msgid "New tab" msgstr "Nouvel onglet" -#: badwolf.c:910 +#: badwolf.c:1006 msgid "Open new tab" msgstr "Ouvrir un nouvel onglet" -#: badwolf.c:102 +#: badwolf.c:103 msgid "Out of Memory" msgstr "Dépassement Mémoire" -#: badwolf.c:859 +#: badwolf.c:952 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Version de Badwolf: %s\n" -#: badwolf.c:866 +#: badwolf.c:959 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit au lancement: %d.%d.%d\n" -#: badwolf.c:388 +#: badwolf.c:436 #, c-format msgid "TLS Error for %s." msgstr "Erreur TLS pour %s." -#: badwolf.c:391 +#: badwolf.c:439 #, fuzzy msgid "Temporarily Add Exception" msgstr "Ajouter Temporairement une Exception" -#: badwolf.c:588 +#: badwolf.c:647 msgid "Toggle javascript" msgstr "Activer/Désactiver javascript" -#: badwolf.c:593 +#: badwolf.c:652 msgid "Toggle loading images automatically" msgstr "" -#: badwolf.c:106 +#: badwolf.c:107 msgid "Unknown Crash" msgstr "Crash inconnu" -#: badwolf.c:591 +#: badwolf.c:650 msgid "_IMG" msgstr "_IMG" -#: badwolf.c:586 +#: badwolf.c:645 msgid "_JS" msgstr "_JS" -#: badwolf.c:706 +#: badwolf.c:777 msgid "search in current page" msgstr "recherche dans la page courante" -#: badwolf.c:97 +#: badwolf.c:98 msgid "the web process crashed.\n" msgstr "le processus web a cessé de fonctionner.\n" -#: badwolf.c:101 +#: badwolf.c:102 msgid "the web process exceeded the memory limit.\n" msgstr "le processus web a dépassé la limitation de mémoire.\n" -#: badwolf.c:105 +#: badwolf.c:106 msgid "the web process terminated for an unknown reason.\n" msgstr "le processus web s’est interrompu pour une raison inconnue.\n" -#: badwolf.c:873 +#: badwolf.c:966 #, 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:944 +#: badwolf.c:1042 msgid "ø" msgstr "" diff --git a/po/messages.pot b/po/messages.pot index b122acb..dfddb74 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.2+g17b9802.develop\n" +"Project-Id-Version: Badwolf 1.0.3+g0391361.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-07-11 11:35+0200\n" +"POT-Creation-Date: 2020-10-25 02:35+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,16 +41,49 @@ msgstr "" msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:919 +#: bookmarks.c:116 +msgid "Bookmarks: Done.\n" +msgstr "" + +#: bookmarks.c:59 +#, c-format +msgid "Bookmarks: Found %d bookmarks.\n" +msgstr "" + +#: bookmarks.c:81 +#, c-format +msgid "Bookmarks: No loadable file found at %s\n" +msgstr "" + +#: bookmarks.c:85 +#, c-format +msgid "Bookmarks: loading at %s\n" +msgstr "" + +#: bookmarks.c:99 +msgid "Bookmarks: unable to create new XPath context\n" +msgstr "" + +#: bookmarks.c:107 +#, c-format +msgid "Bookmarks: unable to evaluate XPath expression \"%s\"\n" +msgstr "" + +#: bookmarks.c:89 +#, c-format +msgid "Bookmarks: unable to parse file \"%s\"\n" +msgstr "" + +#: badwolf.c:954 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:416 +#: badwolf.c:439 msgid "Continue" msgstr "" -#: badwolf.c:366 +#: badwolf.c:389 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" @@ -65,31 +98,31 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:389 +#: badwolf.c:412 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:370 +#: badwolf.c:393 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:383 +#: badwolf.c:406 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:380 +#: badwolf.c:403 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:386 +#: badwolf.c:409 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:377 +#: badwolf.c:400 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:373 +#: badwolf.c:396 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" @@ -100,11 +133,11 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:854 +#: badwolf.c:889 msgid "New tab" msgstr "" -#: badwolf.c:968 +#: badwolf.c:1006 msgid "Open new tab" msgstr "" @@ -112,30 +145,30 @@ msgstr "" msgid "Out of Memory" msgstr "" -#: badwolf.c:917 +#: badwolf.c:952 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:924 +#: badwolf.c:959 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:413 +#: badwolf.c:436 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:416 +#: badwolf.c:439 msgid "Temporarily Add Exception" msgstr "" -#: badwolf.c:624 +#: badwolf.c:647 msgid "Toggle javascript" msgstr "" -#: badwolf.c:629 +#: badwolf.c:652 msgid "Toggle loading images automatically" msgstr "" @@ -143,15 +176,15 @@ msgstr "" msgid "Unknown Crash" msgstr "" -#: badwolf.c:627 +#: badwolf.c:650 msgid "_IMG" msgstr "" -#: badwolf.c:622 +#: badwolf.c:645 msgid "_JS" msgstr "" -#: badwolf.c:742 +#: badwolf.c:777 msgid "search in current page" msgstr "" @@ -167,12 +200,12 @@ msgstr "" msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:931 +#: badwolf.c:966 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:1002 +#: badwolf.c:1042 msgid "ø" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 9f54980..56f5ea0 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-05-18 03:06+0200\n" +"POT-Creation-Date: 2020-10-25 02:35+0100\n" "PO-Revision-Date: 2020-05-17 20:18-0300\n" "Last-Translator: Pedro Lucas Porcellis \n" "Language-Team: Brazilian Portuguese\n" @@ -36,20 +36,53 @@ msgstr "%02i:%02i:%02i Transferência Concluída" msgid "%02i:%02i:%02i Downloading…" msgstr "%02i:%02i:%02i Baixando…" -#: downloads.c:195 downloads.c:212 downloads.c:215 +#: downloads.c:199 downloads.c:216 downloads.c:219 msgid "Badwolf Downloads" msgstr "Transferências do Badwolf" -#: badwolf.c:874 +#: bookmarks.c:116 +msgid "Bookmarks: Done.\n" +msgstr "" + +#: bookmarks.c:59 +#, c-format +msgid "Bookmarks: Found %d bookmarks.\n" +msgstr "" + +#: bookmarks.c:81 +#, c-format +msgid "Bookmarks: No loadable file found at %s\n" +msgstr "" + +#: bookmarks.c:85 +#, c-format +msgid "Bookmarks: loading at %s\n" +msgstr "" + +#: bookmarks.c:99 +msgid "Bookmarks: unable to create new XPath context\n" +msgstr "" + +#: bookmarks.c:107 +#, c-format +msgid "Bookmarks: unable to evaluate XPath expression \"%s\"\n" +msgstr "" + +#: bookmarks.c:89 +#, c-format +msgid "Bookmarks: unable to parse file \"%s\"\n" +msgstr "" + +#: badwolf.c:954 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit %d.%d.%d\n" -#: badwolf.c:403 +#: badwolf.c:439 msgid "Continue" msgstr "Continuar" -#: badwolf.c:353 +#: badwolf.c:389 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" @@ -67,34 +100,34 @@ msgstr "Erro" msgid "Download starting…" msgstr "Transferência Iniciada…" -#: badwolf.c:376 +#: badwolf.c:412 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" "Erro: Algum erro desconhecido ocorreu enquanto validava o certificado.\n" -#: badwolf.c:357 +#: badwolf.c:393 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Erro: A Autoridade de Certificados X509 é desconhecida.\n" -#: badwolf.c:370 +#: badwolf.c:406 msgid "Error: The certificate has been revoked.\n" msgstr "Erro: O certificado foi revogado.\n" -#: badwolf.c:367 +#: badwolf.c:403 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:373 +#: badwolf.c:409 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Erro: O certificado é considerado inseguro.\n" -#: badwolf.c:364 +#: badwolf.c:400 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:360 +#: badwolf.c:396 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erro: A identidade não confere com a esperada.\n" @@ -107,11 +140,11 @@ msgstr "" "Navegador orientado pela privacidade e minimalismo\n" "Versão do WebKit: %d.%d.%d" -#: badwolf.c:803 +#: badwolf.c:889 msgid "New tab" msgstr "Nova aba" -#: badwolf.c:923 +#: badwolf.c:1006 msgid "Open new tab" msgstr "Abrir uma Nova aba" @@ -119,30 +152,30 @@ msgstr "Abrir uma Nova aba" msgid "Out of Memory" msgstr "Sem memória" -#: badwolf.c:872 +#: badwolf.c:952 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Rodando versão %s do Badwolf\n" -#: badwolf.c:879 +#: badwolf.c:959 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit: %d.%d.%d\n" -#: badwolf.c:400 +#: badwolf.c:436 #, c-format msgid "TLS Error for %s." msgstr "Erro TLS para %s." -#: badwolf.c:403 +#: badwolf.c:439 msgid "Temporarily Add Exception" msgstr "Adicionar exceção temporária" -#: badwolf.c:600 +#: badwolf.c:647 msgid "Toggle javascript" msgstr "Habilitar Javascript" -#: badwolf.c:605 +#: badwolf.c:652 msgid "Toggle loading images automatically" msgstr "Habilitar carregamento de imagens automático" @@ -150,15 +183,15 @@ msgstr "Habilitar carregamento de imagens automático" msgid "Unknown Crash" msgstr "Erro desconhecido" -#: badwolf.c:603 +#: badwolf.c:650 msgid "_IMG" msgstr "_IMG" -#: badwolf.c:598 +#: badwolf.c:645 msgid "_JS" msgstr "_JS" -#: badwolf.c:718 +#: badwolf.c:777 msgid "search in current page" msgstr "buscar na página atual" @@ -174,12 +207,12 @@ msgstr "o processo web excedeu o limite de memória.\n" msgid "the web process terminated for an unknown reason.\n" msgstr "o processo web terminou por uma razão desconhecida.\n" -#: badwolf.c:886 +#: badwolf.c:966 #, 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:957 +#: badwolf.c:1042 msgid "ø" msgstr "" diff --git a/po/tr.po b/po/tr.po index 040c48c..5c387ee 100644 --- a/po/tr.po +++ b/po/tr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 1.0.2+g17b9802.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-07-11 11:35+0200\n" +"POT-Creation-Date: 2020-10-25 02:35+0100\n" "PO-Revision-Date: 2020-07-17 23:50+0300\n" "Last-Translator: Oğuz Ersen \n" "Language-Team: Turkish\n" @@ -41,16 +41,49 @@ msgstr "%02i:%02i:%02i İndiriliyor…" msgid "Badwolf Downloads" msgstr "Badwolf İndirmeleri" -#: badwolf.c:919 +#: bookmarks.c:116 +msgid "Bookmarks: Done.\n" +msgstr "" + +#: bookmarks.c:59 +#, c-format +msgid "Bookmarks: Found %d bookmarks.\n" +msgstr "" + +#: bookmarks.c:81 +#, c-format +msgid "Bookmarks: No loadable file found at %s\n" +msgstr "" + +#: bookmarks.c:85 +#, c-format +msgid "Bookmarks: loading at %s\n" +msgstr "" + +#: bookmarks.c:99 +msgid "Bookmarks: unable to create new XPath context\n" +msgstr "" + +#: bookmarks.c:107 +#, c-format +msgid "Bookmarks: unable to evaluate XPath expression \"%s\"\n" +msgstr "" + +#: bookmarks.c:89 +#, c-format +msgid "Bookmarks: unable to parse file \"%s\"\n" +msgstr "" + +#: badwolf.c:954 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Oluşturma zamanı WebKit sürümü: %d.%d.%d\n" -#: badwolf.c:416 +#: badwolf.c:439 msgid "Continue" msgstr "Devam Et" -#: badwolf.c:366 +#: badwolf.c:389 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" @@ -68,31 +101,33 @@ msgstr "Çöktü" msgid "Download starting…" msgstr "İndirme başlatılıyor…" -#: badwolf.c:389 +#: badwolf.c:412 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "Hata: Sertifika doğrulanırken bilinmeyen bir hata oluştu.\n" -#: badwolf.c:370 +#: badwolf.c:393 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Hata: X509 Sertifika Yetkilisi bilinmiyor.\n" -#: badwolf.c:383 +#: badwolf.c:406 msgid "Error: The certificate has been revoked.\n" msgstr "Hata: Sertifika yürürlükten kaldırıldı.\n" -#: badwolf.c:380 +#: badwolf.c:403 msgid "Error: The certificate has expired. Check your system's clock.\n" -msgstr "Hata: Sertifikanın süresi doldu. Sisteminizin saatini gözden geçirin.\n" +msgstr "" +"Hata: Sertifikanın süresi doldu. Sisteminizin saatini gözden geçirin.\n" -#: badwolf.c:386 +#: badwolf.c:409 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Hata: Sertifikanın güvensiz olduğu kabul ediliyor.\n" -#: badwolf.c:377 +#: badwolf.c:400 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" -msgstr "Hata: Sertifika henüz geçerli değil. Sisteminizin saatini gözden geçirin.\n" +msgstr "" +"Hata: Sertifika henüz geçerli değil. Sisteminizin saatini gözden geçirin.\n" -#: badwolf.c:373 +#: badwolf.c:396 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Hata: Verilen kimlik beklenen ile eşleşmiyor.\n" @@ -105,11 +140,11 @@ msgstr "" "Sadelik ve gizlilik odaklı WebKitGTK+ tarayıcısı\n" "Çalışma zamanı WebKit sürümü: %d.%d.%d" -#: badwolf.c:854 +#: badwolf.c:889 msgid "New tab" msgstr "Yeni sekme" -#: badwolf.c:968 +#: badwolf.c:1006 msgid "Open new tab" msgstr "Yeni sekme aç" @@ -117,30 +152,30 @@ msgstr "Yeni sekme aç" msgid "Out of Memory" msgstr "Yetersiz Bellek" -#: badwolf.c:917 +#: badwolf.c:952 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Çalışan Badwolf sürümü: %s\n" -#: badwolf.c:924 +#: badwolf.c:959 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Çalışma zamanı WebKit sürümü: %d.%d.%d\n" -#: badwolf.c:413 +#: badwolf.c:436 #, c-format msgid "TLS Error for %s." msgstr "%s için TLS Hatası." -#: badwolf.c:416 +#: badwolf.c:439 msgid "Temporarily Add Exception" msgstr "Geçici Olarak İstisna Ekle" -#: badwolf.c:624 +#: badwolf.c:647 msgid "Toggle javascript" msgstr "Javascript'i aç/kapat" -#: badwolf.c:629 +#: badwolf.c:652 msgid "Toggle loading images automatically" msgstr "Resimleri otomatik yüklemeyi aç/kapat" @@ -148,15 +183,15 @@ msgstr "Resimleri otomatik yüklemeyi aç/kapat" msgid "Unknown Crash" msgstr "Bilinmeyen Çökme" -#: badwolf.c:627 +#: badwolf.c:650 msgid "_IMG" msgstr "_RSM" -#: badwolf.c:622 +#: badwolf.c:645 msgid "_JS" msgstr "_JS" -#: badwolf.c:742 +#: badwolf.c:777 msgid "search in current page" msgstr "geçerli sayfada ara" @@ -172,12 +207,12 @@ msgstr "web işlemi bellek sınırını aştı.\n" msgid "the web process terminated for an unknown reason.\n" msgstr "web işlemi bilinmeyen bir nedenle sona erdi.\n" -#: badwolf.c:931 +#: badwolf.c:966 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "webkit-web-extension dizini şuna ayarlandı: %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:1002 +#: badwolf.c:1042 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 639fcd202b64af2707208ef92872fce6bc0eafe3 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 25 Oct 2020 03:03:56 +0100 Subject: Update badwolf's description in code as well --- keybindings.c | 2 +- po/fr.po | 11 +++++------ po/messages.pot | 6 +++--- po/pt_BR.po | 6 +++--- po/tr.po | 6 +++--- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/keybindings.c b/keybindings.c index ef33aaa..13f2a48 100644 --- a/keybindings.c +++ b/keybindings.c @@ -29,7 +29,7 @@ badwolf_about_dialog(GtkWindow *main_window, gpointer user_data) char *comments = NULL; - comments = g_strdup_printf(_("Minimalist and privacy-oriented WebKitGTK+ browser\n" + comments = g_strdup_printf(_("Minimalist and privacy-oriented web browser based on WebKitGTK\n" "Runtime WebKit version: %d.%d.%d"), webkit_get_major_version(), webkit_get_minor_version(), diff --git a/po/fr.po b/po/fr.po index d938819..ec8fcc9 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-10-25 02:35+0100\n" +"POT-Creation-Date: 2020-10-25 02:59+0100\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -18,17 +18,17 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: downloads.c:117 -#, fuzzy, c-format +#, c-format msgid "%02i:%02i:%02i Download cancelled" msgstr "%02i:%02i:%02i Téléchargement annulé" #: downloads.c:119 -#, fuzzy, c-format +#, c-format msgid "%02i:%02i:%02i Download error" msgstr "%02i:%02i:%02i Erreur du téléchargement" #: downloads.c:141 -#, fuzzy, c-format +#, c-format msgid "%02i:%02i:%02i Download finished" msgstr "%02i:%02i:%02i Téléchargement finit" @@ -135,7 +135,7 @@ msgstr "Erreur : L'identité ne correspond pas à celle attendue.\n" #: keybindings.c:32 #, c-format msgid "" -"Minimalist and privacy-oriented WebKitGTK+ browser\n" +"Minimalist and privacy-oriented web browser based on WebKitGTK\n" "Runtime WebKit version: %d.%d.%d" msgstr "" "Navigateur WebKitGTK+ minimaliste et orienté vie privée\n" @@ -169,7 +169,6 @@ msgid "TLS Error for %s." msgstr "Erreur TLS pour %s." #: badwolf.c:439 -#, fuzzy msgid "Temporarily Add Exception" msgstr "Ajouter Temporairement une Exception" diff --git a/po/messages.pot b/po/messages.pot index dfddb74..aef9ca2 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.3+g0391361.develop\n" +"Project-Id-Version: Badwolf 1.0.3+g15232cd.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-10-25 02:35+0100\n" +"POT-Creation-Date: 2020-10-25 02:59+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -129,7 +129,7 @@ msgstr "" #: keybindings.c:32 #, c-format msgid "" -"Minimalist and privacy-oriented WebKitGTK+ browser\n" +"Minimalist and privacy-oriented web browser based on WebKitGTK\n" "Runtime WebKit version: %d.%d.%d" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 56f5ea0..5320ec9 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-10-25 02:35+0100\n" +"POT-Creation-Date: 2020-10-25 02:59+0100\n" "PO-Revision-Date: 2020-05-17 20:18-0300\n" "Last-Translator: Pedro Lucas Porcellis \n" "Language-Team: Brazilian Portuguese\n" @@ -132,9 +132,9 @@ 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:32 -#, c-format +#, fuzzy, c-format msgid "" -"Minimalist and privacy-oriented WebKitGTK+ browser\n" +"Minimalist and privacy-oriented web browser based on WebKitGTK\n" "Runtime WebKit version: %d.%d.%d" msgstr "" "Navegador orientado pela privacidade e minimalismo\n" diff --git a/po/tr.po b/po/tr.po index 5c387ee..b7dbda9 100644 --- a/po/tr.po +++ b/po/tr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 1.0.2+g17b9802.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-10-25 02:35+0100\n" +"POT-Creation-Date: 2020-10-25 02:59+0100\n" "PO-Revision-Date: 2020-07-17 23:50+0300\n" "Last-Translator: Oğuz Ersen \n" "Language-Team: Turkish\n" @@ -132,9 +132,9 @@ msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Hata: Verilen kimlik beklenen ile eşleşmiyor.\n" #: keybindings.c:32 -#, c-format +#, fuzzy, c-format msgid "" -"Minimalist and privacy-oriented WebKitGTK+ browser\n" +"Minimalist and privacy-oriented web browser based on WebKitGTK\n" "Runtime WebKit version: %d.%d.%d" msgstr "" "Sadelik ve gizlilik odaklı WebKitGTK+ tarayıcısı\n" -- cgit v1.3.1-23-gd82d From af32582914ca06ff422ea4f7bad0f593447fd8da Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 28 Oct 2020 06:48:50 +0100 Subject: badwolf.h: Have uint64_t defined, explain context_id decision --- badwolf.h | 1 + decisions.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/badwolf.h b/badwolf.h index 8a4edec..fc3328f 100644 --- a/badwolf.h +++ b/badwolf.h @@ -3,6 +3,7 @@ #include #include +#include /* uint64_t */ extern const gchar *homepage; extern const gchar *version; diff --git a/decisions.md b/decisions.md index 7d0712e..7e254ad 100644 --- a/decisions.md +++ b/decisions.md @@ -5,6 +5,9 @@ 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-10-22 : Mark the context_id as A-Z instead of Hex +The way I did it at first was to use the hexadecimal representation, but as it starts from 0 there could be confusions with a shortcut hint for alt-n, there could still be confusion with some kind of tab numbering but with a bit of usage it's hopefully going to be obvious. + ## 2020-07-04 : Automatically switch to a user-created tab / Breaking the UI I got pointed out that when creating a new tab the user has to needlessly switch to it while it could be done when they request it. I also decided to still release it in a point release, so without bump of Major because while it does changes the behavior it doesn't break the associated meaning, while this would be a breaking change for an API I could take it as a minor adjustment in a user-interface. -- cgit v1.3.1-23-gd82d From 983c730b810db766662416282e7413311e5a33b7 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 31 Oct 2020 09:45:50 +0100 Subject: tab label: playing icon between the context_id and title --- badwolf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badwolf.c b/badwolf.c index 0d391e1..7394c00 100644 --- a/badwolf.c +++ b/badwolf.c @@ -186,8 +186,8 @@ badwolf_new_tab_box(const gchar *title, struct Client *browser) gtk_label_set_single_line_mode(GTK_LABEL(label), TRUE); gtk_label_set_single_line_mode(GTK_LABEL(context_label), TRUE); - gtk_box_pack_start(GTK_BOX(tab_box), playing, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(tab_box), context_label, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(tab_box), playing, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(tab_box), label, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(tab_box), close, FALSE, FALSE, 0); -- cgit v1.3.1-23-gd82d From 13b89829812598a1d2612d8304491afbcf01cf55 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 1 Nov 2020 23:56:49 +0100 Subject: Makefile: Fix PIE/PIC flags --- Makefile | 2 +- badwolf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7b24b4d..a7409ab 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ DATADIR ?= $(PREFIX)/share/badwolf APPSDIR ?= $(PREFIX)/share/applications CC ?= cc -CFLAGS ?= -g -O2 -fPIC -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -Wsign-conversion -O2 -Werror=implicit-function-declaration -Werror=implicit-int -Werror=vla +CFLAGS ?= -g -O2 -pie -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -Wsign-conversion -O2 -Werror=implicit-function-declaration -Werror=implicit-int -Werror=vla DBG ?= PKGCONFIG ?= pkg-config MSGFMT ?= msgfmt diff --git a/badwolf.h b/badwolf.h index fc3328f..e5b33f0 100644 --- a/badwolf.h +++ b/badwolf.h @@ -2,8 +2,8 @@ #define BADWOLF_H_INCLUDED #include -#include #include /* uint64_t */ +#include extern const gchar *homepage; extern const gchar *version; -- cgit v1.3.1-23-gd82d From fadd68541d5b6a2a251abd2e31e9c6197cd5d770 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 9 Dec 2020 12:17:54 +0100 Subject: badwolf.c: Fix `struct Download` allocation Found by Clang Static Analyzer (scan-build) --- badwolf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badwolf.c b/badwolf.c index 7394c00..977f214 100644 --- a/badwolf.c +++ b/badwolf.c @@ -463,7 +463,7 @@ web_contextCb_download_started(WebKitWebContext *web_context, { (void)web_context; struct Client *browser = (struct Client *)user_data; - struct Download *download = malloc(sizeof(struct Client)); + struct Download *download = malloc(sizeof(struct Download)); if(download != NULL) { -- cgit v1.3.1-23-gd82d From 1b10b3399825822fe288a38e17ae652161f202ae Mon Sep 17 00:00:00 2001 From: Oğuz Ersen Date: Thu, 5 Nov 2020 23:29:29 +0300 Subject: po/tr.po: Update translations --- po/tr.po | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/po/tr.po b/po/tr.po index b7dbda9..40a7861 100644 --- a/po/tr.po +++ b/po/tr.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Badwolf 1.0.2+g17b9802.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" "POT-Creation-Date: 2020-10-25 02:59+0100\n" -"PO-Revision-Date: 2020-07-17 23:50+0300\n" +"PO-Revision-Date: 2020-11-05 23:00+0300\n" "Last-Translator: Oğuz Ersen \n" "Language-Team: Turkish\n" "Language: tr\n" @@ -43,45 +43,45 @@ msgstr "Badwolf İndirmeleri" #: bookmarks.c:116 msgid "Bookmarks: Done.\n" -msgstr "" +msgstr "Yer imleri: Bitti.\n" #: bookmarks.c:59 #, c-format msgid "Bookmarks: Found %d bookmarks.\n" -msgstr "" +msgstr "Yer imleri: %d yer imi bulundu.\n" #: bookmarks.c:81 #, c-format msgid "Bookmarks: No loadable file found at %s\n" -msgstr "" +msgstr "Yer imleri: %s konumunda yüklenebilir dosya bulunamadı\n" #: bookmarks.c:85 #, c-format msgid "Bookmarks: loading at %s\n" -msgstr "" +msgstr "Yer imleri: %s konumunda yükleniyor\n" #: bookmarks.c:99 msgid "Bookmarks: unable to create new XPath context\n" -msgstr "" +msgstr "Yer imleri: yeni XPath içeriği oluşturulamadı\n" #: bookmarks.c:107 #, c-format msgid "Bookmarks: unable to evaluate XPath expression \"%s\"\n" -msgstr "" +msgstr "Yer imleri: \"%s\" XPath ifadesi değerlendirilemedi\n" #: bookmarks.c:89 #, c-format msgid "Bookmarks: unable to parse file \"%s\"\n" -msgstr "" +msgstr "Yer imleri: \"%s\" dosyası ayrıştırılamadı\n" #: badwolf.c:954 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" -msgstr "Oluşturma zamanı WebKit sürümü: %d.%d.%d\n" +msgstr "Derleme zamanı WebKit sürümü: %d.%d.%d\n" #: badwolf.c:439 msgid "Continue" -msgstr "Devam Et" +msgstr "Devam et" #: badwolf.c:389 msgid "" @@ -137,7 +137,7 @@ msgid "" "Minimalist and privacy-oriented web browser based on WebKitGTK\n" "Runtime WebKit version: %d.%d.%d" msgstr "" -"Sadelik ve gizlilik odaklı WebKitGTK+ tarayıcısı\n" +"WebKitGTK tabanlı sadelik ve gizlilik odaklı web tarayıcısı\n" "Çalışma zamanı WebKit sürümü: %d.%d.%d" #: badwolf.c:889 -- cgit v1.3.1-23-gd82d From 2ab35014d69f116253468d683b0cd45785373aa6 Mon Sep 17 00:00:00 2001 From: Ben K Date: Tue, 30 Mar 2021 14:29:14 +0200 Subject: Add german translation --- Makefile | 2 +- po/de.po | 234 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ po/messages.pot | 4 +- 3 files changed, 237 insertions(+), 3 deletions(-) create mode 100644 po/de.po diff --git a/Makefile b/Makefile index a7409ab..5496f25 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ OBJS = bookmarks.o uri.o keybindings.o downloads.o badwolf.o OBJS_test = uri_test.o EXE = badwolf EXE_test = uri_test -TRANS = fr.mo pt_BR.mo tr.mo +TRANS = fr.mo pt_BR.mo tr.mo de.mo DOCS = usr.bin.badwolf README.md KnowledgeBase.md interface.txt CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" diff --git a/po/de.po b/po/de.po new file mode 100644 index 0000000..0afd563 --- /dev/null +++ b/po/de.po @@ -0,0 +1,234 @@ +# German translations for Badwolf package. +# Copyright (C) 2021 Badwolf Authors +# This file is distributed under the same license as the Badwolf package. +# Ben K. , 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: Badwolf 1.0.3+g1b10b33.develop\n" +"Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" +"POT-Creation-Date: 2021-03-23 18:10+0100\n" +"PO-Revision-Date: 2021-03-25 15:40+0100\n" +"Last-Translator: Ben K. \n" +"Language-Team: German\n" +"Language: de\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" +"X-Generator: Poedit 2.2.1\n" + +#: downloads.c:117 +#, c-format +msgid "%02i:%02i:%02i Download cancelled" +msgstr "%02i:%02i:%02i Herunterladen abgebrochen" + +#: downloads.c:119 +#, c-format +msgid "%02i:%02i:%02i Download error" +msgstr "%02i:%02i:%02i Herunterladen fehlgeschlagen" + +#: downloads.c:141 +#, c-format +msgid "%02i:%02i:%02i Download finished" +msgstr "%02i:%02i:%02i Fertig Heruntergeladen" + +#: downloads.c:167 +#, c-format +msgid "%02i:%02i:%02i Downloading…" +msgstr "%02i:%02i:%02i Lade herunter…" + +#: downloads.c:199 downloads.c:216 downloads.c:219 +msgid "Badwolf Downloads" +msgstr "Heruntergeladene Dateien" + +#: bookmarks.c:116 +msgid "Bookmarks: Done.\n" +msgstr "Lesezeichen: Erledigt. \n" + +#: bookmarks.c:59 +#, c-format +msgid "Bookmarks: Found %d bookmarks.\n" +msgstr "Lesezeichen: %d Lesezeichen gefunden. \n" + +#: bookmarks.c:81 +#, c-format +msgid "Bookmarks: No loadable file found at %s\n" +msgstr "Lesezeichen: Keine ladbare Datei unter %s gefunden\n" + +#: bookmarks.c:85 +#, c-format +msgid "Bookmarks: loading at %s\n" +msgstr "Lesezeichen: %s geladen\n" + +#: bookmarks.c:99 +#, fuzzy +msgid "Bookmarks: unable to create new XPath context\n" +msgstr "Lesezeichen: Kein neuer XPath-Kontext konnte erstellen werden\n" + +#: bookmarks.c:107 +#, fuzzy, c-format +msgid "Bookmarks: unable to evaluate XPath expression \"%s\"\n" +msgstr "" +"Leisezeichen: Der XPath-Ausdruck \"%s\" konnte nicht ausgewertet " +"werden\n" + +#: bookmarks.c:89 +#, c-format +msgid "Bookmarks: unable to parse file \"%s\"\n" +msgstr "Lesezeichen: Die Datei \"%s\" konnte nicht geparst werden\n" + +#: badwolf.c:954 +#, fuzzy, c-format +msgid "Buildtime WebKit version: %d.%d.%d\n" +msgstr "Buildtime WebKit version: %d.%d.%d\n" + +#: badwolf.c:439 +msgid "Continue" +msgstr "Weiter" + +#: badwolf.c:389 +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 "" +"Das TLS-Zertifikat konnte nicht verifiziert werden, um eine bessere " +"Sicherheit der Verbindung sicherzustellen. Sie möchten vielleicht ihr " +"Gerät und ihr Netzwerk überprüfen. \n" + +#: badwolf.c:99 +msgid "Crashed" +msgstr "Abgestürtzt" + +#: downloads.c:39 +msgid "Download starting…" +msgstr "Download startet…" + +#: badwolf.c:412 +msgid "Error: Some unknown error occurred validating the certificate.\n" +msgstr "" +"Fehler: Es ist ein unbekannter Fehler beim überprüfen des Zertifikats " +"aufgetreten.\n" + +#: badwolf.c:393 +#, fuzzy +msgid "Error: The X509 Certificate Authority is unknown.\n" +msgstr "Fehler: Die X509 Zertifikatsautorität ist unbekannt.\n" + +#: badwolf.c:406 +#, fuzzy +msgid "Error: The certificate has been revoked.\n" +msgstr "Fehler: Das Zertifikat wurde widerrufen.\n" + +#: badwolf.c:403 +msgid "Error: The certificate has expired. Check your system's clock.\n" +msgstr "" +"Fehler: Das Zertifikat ist abgelaufen. Bitte überprüfen Sie, ob die " +"Uhr ihres Systems richtig eingestellt ist.\n" + +#: badwolf.c:409 +msgid "Error: The certificate is considered to be insecure.\n" +msgstr "Fehler: Das Zertifikat wird als unsicher angesehen.\n" + +#: badwolf.c:400 +msgid "" +"Error: The certificate isn't valid yet. Check your system's clock.\n" +msgstr "" +"Fehler: Das Zertifikat ist noch nicht gültig. Bitte überprüfen Sie, ob " +"die Uhr ihres Systems richtig eingestellt ist.\n" + +#: badwolf.c:396 +msgid "Error: The given identity doesn't match the expected one.\n" +msgstr "" +"Fehler: Die gegebene Identität passt nicht mit der Erwarteten " +"zusammen.\n" + +#: keybindings.c:32 +#, c-format +msgid "" +"Minimalist and privacy-oriented web browser based on WebKitGTK\n" +"Runtime WebKit version: %d.%d.%d" +msgstr "" +"Minimalistischer und Privatsphäre-orientierter Internetbrowser " +"basierend of WebKitGTK\n" +"Runtime WebKit version: %d.%d.%d" + +#: badwolf.c:889 +msgid "New tab" +msgstr "Neuer Reiter" + +#: badwolf.c:1006 +msgid "Open new tab" +msgstr "Neuen Reiter öffnen" + +#: badwolf.c:103 +msgid "Out of Memory" +msgstr "" +"Ihnen scheint der Arbeitsspeicher ausgegangen zu sein! (Out of Memory)" + +#: badwolf.c:952 +#, c-format +msgid "Running Badwolf version: %s\n" +msgstr "Ausführende Badwolf-Version: %s\n" + +#: badwolf.c:959 +#, c-format +msgid "Runtime WebKit version: %d.%d.%d\n" +msgstr "Ausführende WebKit-Version: %d.%d.%d\n" + +#: badwolf.c:436 +#, c-format +msgid "TLS Error for %s." +msgstr "TLS-Fehler für %s." + +#: badwolf.c:439 +#, fuzzy +msgid "Temporarily Add Exception" +msgstr "Eine Ausnahme machen" + +#: badwolf.c:647 +msgid "Toggle javascript" +msgstr "JavaScript ein-/ausschalten" + +#: badwolf.c:652 +msgid "Toggle loading images automatically" +msgstr "Das automatische Laden von Bildern ein-/ausschalten" + +#: badwolf.c:107 +msgid "Unknown Crash" +msgstr "Unbekannter Absturz" + +#: badwolf.c:650 +msgid "_IMG" +msgstr "_IMG" + +#: badwolf.c:645 +msgid "_JS" +msgstr "_JS" + +#: badwolf.c:777 +msgid "search in current page" +msgstr "Die aktuelle Seite durchsuchen" + +#: badwolf.c:98 +msgid "the web process crashed.\n" +msgstr "Der Webprozess ist abgestürzt.\n" + +#: badwolf.c:102 +msgid "the web process exceeded the memory limit.\n" +msgstr "Der Webprozess hat das Arbeitsspeicherlimit überschritten.\n" + +#: badwolf.c:106 +msgid "the web process terminated for an unknown reason.\n" +msgstr "Der Webprozess wurde aus unbekannten Gründen beendet.\n" + +#: badwolf.c:966 +#, fuzzy, c-format +msgid "webkit-web-extension directory set to: %s\n" +msgstr "Das WebKit-Web-Erweiterungs-Verzeichnis wurde gesetzt auf: %s\n" + +#. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. +#: badwolf.c:1042 +msgid "ø" +msgstr "ø" diff --git a/po/messages.pot b/po/messages.pot index aef9ca2..c5a821c 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.3+g15232cd.develop\n" +"Project-Id-Version: Badwolf 1.0.3+g1b10b339.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-10-25 02:59+0100\n" +"POT-Creation-Date: 2021-03-30 14:25+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -- cgit v1.3.1-23-gd82d From 014062a71c624fdfed80606bc3668af1b1f1c4e9 Mon Sep 17 00:00:00 2001 From: Pedro Lucas Porcellis Date: Mon, 30 Nov 2020 15:19:40 -0300 Subject: Update pt_BR translation --- po/pt_BR.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 5320ec9..a3df8f5 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -42,36 +42,36 @@ msgstr "Transferências do Badwolf" #: bookmarks.c:116 msgid "Bookmarks: Done.\n" -msgstr "" +msgstr "Favoritos: Feito.\n" #: bookmarks.c:59 #, c-format msgid "Bookmarks: Found %d bookmarks.\n" -msgstr "" +msgstr "Favoritos: Encontrado %d favoritos.\n" #: bookmarks.c:81 #, c-format msgid "Bookmarks: No loadable file found at %s\n" -msgstr "" +msgstr "Favoritos: Nenhum arquivo carregável encontrado em %s\n" #: bookmarks.c:85 #, c-format msgid "Bookmarks: loading at %s\n" -msgstr "" +msgstr "Favoritos: carregando em %s\n" #: bookmarks.c:99 msgid "Bookmarks: unable to create new XPath context\n" -msgstr "" +msgstr "Favoritos: não foi possível criar um novo contexto do XPath\n" #: bookmarks.c:107 #, c-format msgid "Bookmarks: unable to evaluate XPath expression \"%s\"\n" -msgstr "" +msgstr "Favoritos: não foi possivel compreender a expressão do XPath \"%s\"\n" #: bookmarks.c:89 #, c-format msgid "Bookmarks: unable to parse file \"%s\"\n" -msgstr "" +msgstr "Favoritos: não foi possível ler o arquivo \"%s\"\n" #: badwolf.c:954 #, c-format -- cgit v1.3.1-23-gd82d From 784fd85a291d98e5dca5d8fbcc7c7a0688707f03 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 30 Mar 2021 14:53:27 +0200 Subject: Update french translation --- po/fr.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/po/fr.po b/po/fr.po index ec8fcc9..ba42e68 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1,5 +1,5 @@ # BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -# Copyright (C) 2019-2020 Badwolf Authors +# Copyright (C) 2019-2021 Badwolf Authors # This file is distributed under the same license as the Badwolf package. # Haelwenn (lanodan) Monnier , 2019 # @@ -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: 2020-10-25 02:59+0100\n" -"PO-Revision-Date: 2019-12-22 00:57+0100\n" +"POT-Creation-Date: 2021-03-30 14:25+0200\n" +"PO-Revision-Date: 2021-03-30 14:52+0200\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" "Language: fr\n" @@ -174,11 +174,11 @@ msgstr "Ajouter Temporairement une Exception" #: badwolf.c:647 msgid "Toggle javascript" -msgstr "Activer/Désactiver javascript" +msgstr "(Dés)activer javascript" #: badwolf.c:652 msgid "Toggle loading images automatically" -msgstr "" +msgstr "(Dés)activer le chargement automatique des images" #: badwolf.c:107 msgid "Unknown Crash" -- cgit v1.3.1-23-gd82d From 51119dfa4421858111ff85292c29f994b803bc9e Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 7 Apr 2021 04:25:08 +0200 Subject: badwolf: unref website_data_manager once hooked --- badwolf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/badwolf.c b/badwolf.c index 977f214..1476868 100644 --- a/badwolf.c +++ b/badwolf.c @@ -671,6 +671,7 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b WebKitWebContext *web_context = webkit_web_context_new_with_website_data_manager(website_data_manager); + g_object_unref(website_data_manager); webkit_web_context_set_sandbox_enabled(web_context, TRUE); webkit_web_context_set_process_model(web_context, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); -- cgit v1.3.1-23-gd82d From 5e1c0583650a45ce07b1efb73502cdaef62030ec Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 7 Apr 2021 04:26:04 +0200 Subject: print: Fix wrong pointer to main_window --- badwolf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badwolf.c b/badwolf.c index 1476868..eeaedb2 100644 --- a/badwolf.c +++ b/badwolf.c @@ -555,7 +555,7 @@ printCb_clicked(GtkButton *print, gpointer user_data) WebKitPrintOperation *print_operation = webkit_print_operation_new(browser->webView); - webkit_print_operation_run_dialog(print_operation, GTK_WINDOW(browser->window)); + webkit_print_operation_run_dialog(print_operation, GTK_WINDOW(browser->window->main_window)); } static gboolean -- cgit v1.3.1-23-gd82d From 27cf275730730674367efdd4c0f84524282b7c3d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 7 Apr 2021 04:37:27 +0200 Subject: KnowledgeBase: Add GObject reference counting notes --- KnowledgeBase.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/KnowledgeBase.md b/KnowledgeBase.md index af59415..7916732 100644 --- a/KnowledgeBase.md +++ b/KnowledgeBase.md @@ -3,6 +3,15 @@ - https://trac.torproject.org/projects/tor/wiki/doc/ImportantGoogleChromeBugs / https://trac.torproject.org/projects/tor/ticket/1925 - https://webkit.org/blog/3476/content-blockers-first-look/ +# GObject Reference counting +- `GOBJECT_DEBUG=instance-count GTK_DEBUG=interactive %command%` +- Switch to the Statistics tab +- Press record (top-left) +- Do a bunch of actions, specially reversible ones +- Stop recording + +Tiling window manager tip for WebKitGTK: Put the application and it's debugger on floating, leaving WebKitWebProcess ones in the back + # Bookmark formats The different plain-text formats used by web browsers found in the wild, done in Augmented Backus–Naur Form (ABNF). -- cgit v1.3.1-23-gd82d From 4df40cf5a802aca6f986c3669212b3c6b072ba5b Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 7 Apr 2021 16:48:28 +0200 Subject: badwolf: Inherit the WebContext when old_browser is present --- badwolf.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/badwolf.c b/badwolf.c index eeaedb2..9e8bbc6 100644 --- a/badwolf.c +++ b/badwolf.c @@ -623,6 +623,8 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b target_url = badwolf_ensure_uri_scheme(target_url, (old_browser == NULL)); char *badwolf_l10n = NULL; + WebKitWebContext *web_context; + if(browser == NULL) return NULL; browser->window = window; @@ -666,16 +668,19 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b browser->statuslabel = gtk_label_new(NULL); gtk_widget_set_name(browser->statuslabel, "browser__statuslabel"); - WebKitWebsiteDataManager *website_data_manager = webkit_website_data_manager_new_ephemeral(); - webkit_website_data_manager_set_itp_enabled(website_data_manager, TRUE); - - WebKitWebContext *web_context = - webkit_web_context_new_with_website_data_manager(website_data_manager); - g_object_unref(website_data_manager); - webkit_web_context_set_sandbox_enabled(web_context, TRUE); - webkit_web_context_set_process_model(web_context, - WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); - webkit_web_context_set_web_extensions_directory(web_context, web_extensions_directory); + if(old_browser == NULL) { + WebKitWebsiteDataManager *website_data_manager = webkit_website_data_manager_new_ephemeral(); + webkit_website_data_manager_set_itp_enabled(website_data_manager, TRUE); + + web_context = webkit_web_context_new_with_website_data_manager(website_data_manager); + g_object_unref(website_data_manager); + webkit_web_context_set_sandbox_enabled(web_context, TRUE); + webkit_web_context_set_process_model(web_context, + WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); + webkit_web_context_set_web_extensions_directory(web_context, web_extensions_directory); + } else { + web_context = webkit_web_view_get_context(old_browser->webView); + } badwolf_l10n = getenv("BADWOLF_L10N"); @@ -704,7 +709,9 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b settings, NULL)); gtk_widget_set_name(GTK_WIDGET(browser->webView), "browser__webView"); - g_object_unref(web_context); + if(old_browser == NULL) { + g_object_unref(web_context); + } g_object_unref(settings); gtk_box_pack_start( -- cgit v1.3.1-23-gd82d From 01237f5229147431a26c86675657e2fe588928fb Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 9 Apr 2021 04:13:41 +0200 Subject: Fix formatting --- badwolf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/badwolf.c b/badwolf.c index 9e8bbc6..23c444c 100644 --- a/badwolf.c +++ b/badwolf.c @@ -668,7 +668,8 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b browser->statuslabel = gtk_label_new(NULL); gtk_widget_set_name(browser->statuslabel, "browser__statuslabel"); - if(old_browser == NULL) { + if(old_browser == NULL) + { WebKitWebsiteDataManager *website_data_manager = webkit_website_data_manager_new_ephemeral(); webkit_website_data_manager_set_itp_enabled(website_data_manager, TRUE); @@ -678,7 +679,9 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b webkit_web_context_set_process_model(web_context, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); webkit_web_context_set_web_extensions_directory(web_context, web_extensions_directory); - } else { + } + else + { web_context = webkit_web_view_get_context(old_browser->webView); } @@ -709,7 +712,8 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b settings, NULL)); gtk_widget_set_name(GTK_WIDGET(browser->webView), "browser__webView"); - if(old_browser == NULL) { + if(old_browser == NULL) + { g_object_unref(web_context); } g_object_unref(settings); -- cgit v1.3.1-23-gd82d From 5547d3a708e75a62553b19c81e1afc66ef668a5c Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 15 Mar 2019 10:26:31 +0100 Subject: Handle WebKit content-filter --- badwolf.1 | 19 +++++++++---- badwolf.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- badwolf.h | 2 ++ po/messages.pot | 87 +++++++++++++++++++++++++++++++++++++-------------------- 4 files changed, 156 insertions(+), 39 deletions(-) diff --git a/badwolf.1 b/badwolf.1 index 68a39ed..ae2dfa1 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -1,6 +1,6 @@ -./" BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -./" Copyright © 2019-2020 Badwolf Authors -./" SPDX-License-Identifier: BSD-3-Clause +.\" BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser +.\" Copyright © 2019-2021 Badwolf Authors +.\" SPDX-License-Identifier: BSD-3-Clause .Dd 2019-10-31 .Dt BADWOLF 1 .Sh NAME @@ -75,6 +75,16 @@ A more generic variable name is also intended to be used in the future. .El .Sh FILES .Bl -tag -width Ds -compact +.It Pa ${XDG_CONFIG_HOME:-$HOME/.config}/badwolf/content-filters.json +WebKit-specific content-filter file, this allows to block unwanted content (ads, nagware, ...). +For some introductory information about the format see: +.Lk https://webkit.org/blog/3476/content-blockers-first-look/ +.Pp +For a converter using AblockPlus-style filters, try: +.Lk https://gitlab.com/eyeo/adblockplus/abp2blocklist +.Pp +For a ready-to-use file (that you should update periodically), try: +.Lk https://easylist-downloads.adblockplus.org/easylist_min_content_blocker.json .It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/bookmarks.xbel XBEL (XML Bookmark Exchange Language) file, known to be currently supported by: .Xr elinks 1 , @@ -90,10 +100,7 @@ to be loaded into .Nm . Note: They aren't the JavaScript-based Web-Extensions supported by Firefox or Chrome, but native code in shared objects using the WebKitGTK API. .Pp Examples of useful extensions may be found at: -.Bl -item -compact .Lk https://hacktivis.me/git/badwolf-extensions -.Lk https://github.com/jun7/wyebadblock -.El .It Pa ${DATADIR:-/usr/local/share}/badwolf/interface.css .It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/interface.css CSS files (respectively system and user-level) for styling badwolf interface. diff --git a/badwolf.c b/badwolf.c index 23c444c..ec2a691 100644 --- a/badwolf.c +++ b/badwolf.c @@ -70,6 +70,7 @@ static void new_tabCb_clicked(GtkButton *new_tab, gpointer user_data); static void closeCb_clicked(GtkButton *close, gpointer user_data); static void notebookCb_switch__page(GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data); +void content_managerCb_ready(GObject *store, GAsyncResult *result, gpointer user_data); static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data) @@ -710,6 +711,8 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b old_browser == NULL ? NULL : old_browser->webView, "settings", settings, + "user-content-manager", + window->content_manager, NULL)); gtk_widget_set_name(GTK_WIDGET(browser->webView), "browser__webView"); if(old_browser == NULL) @@ -950,10 +953,73 @@ notebookCb_switch__page(GtkNotebook *notebook, GtkWidget *page, guint page_num, gtk_window_set_title(GTK_WINDOW(window->main_window), gtk_widget_get_tooltip_text(label)); } +void +content_managerCb_ready(GObject *store, GAsyncResult *result, gpointer user_data) +{ + struct Window *window = (struct Window *)user_data; + GError *err = NULL; + + WebKitUserContentFilter *filter = + webkit_user_content_filter_store_load_finish(window->content_store, result, &err); + + if(filter == NULL) + { + if(err == NULL) + { + fprintf(stderr, _("badwolf: failed to load content-filter, err: [%d] %s\n"), -1, "unknown"); + } + else + { + fprintf(stderr, + _("badwolf: failed to load content-filter, err: [%d] %s\n"), + err->code, + err->message); + } + } + else + { + fprintf(stderr, _("badwolf: content-filter loaded, adding to content-manager…\n")); + webkit_user_content_manager_add_filter(window->content_manager, filter); + } +} + +static void +storeCb_finish(WebKitUserContentFilterStore *store, GAsyncResult *result, gpointer user_data) +{ + struct Window *window = (struct Window *)user_data; + GError *err = NULL; + + WebKitUserContentFilter *filter = + webkit_user_content_filter_store_save_finish(window->content_store, result, &err); + + if(filter == NULL) + { + if(err == NULL) + { + fprintf(stderr, + _("badwolf: failed to compile content-filters.json, err: [%d] %s\n"), + -1, + "unknown"); + } + else + { + fprintf(stderr, + _("badwolf: failed to compile content-filters.json, err: [%d] %s\n"), + err->code, + err->message); + } + } + else + { + webkit_user_content_filter_store_load( + window->content_store, "a", NULL, content_managerCb_ready, window); + } +} + int main(int argc, char *argv[]) { - struct Window *window = &(struct Window){NULL, NULL, NULL, NULL}; + struct Window *window = &(struct Window){NULL, NULL, NULL, NULL, NULL, NULL}; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, DATADIR "/locale"); bind_textdomain_codeset(PACKAGE, "UTF-8"); @@ -983,7 +1049,24 @@ main(int argc, char *argv[]) window->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); window->notebook = gtk_notebook_new(); window->new_tab = gtk_button_new_from_icon_name("tab-new-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); - window->downloads_tab = badwolf_downloads_tab_new(); + window->downloads_tab = badwolf_downloads_tab_new(); + window->content_manager = webkit_user_content_manager_new(); + + gchar *contentFilterPath = + g_build_filename(g_get_user_config_dir(), g_get_prgname(), "content-filters.json", NULL); + GFile *contentFilterFile = g_file_new_for_path(contentFilterPath); + fprintf(stderr, _("content-filters file set to: %s\n"), contentFilterPath); + + gchar *filtersPath = g_build_filename(g_get_user_cache_dir(), g_get_prgname(), "filters", NULL); + fprintf(stderr, _("content-filters directory set to: %s\n"), filtersPath); + window->content_store = webkit_user_content_filter_store_new(filtersPath); + + webkit_user_content_filter_store_save_from_file(window->content_store, + "a", + contentFilterFile, + NULL, + (GAsyncReadyCallback)storeCb_finish, + window); gtk_window_set_default_size( GTK_WINDOW(window->main_window), BADWOLF_DEFAULT_WIDTH, BADWOLF_DEFAULT_HEIGHT); diff --git a/badwolf.h b/badwolf.h index e5b33f0..7919be8 100644 --- a/badwolf.h +++ b/badwolf.h @@ -14,6 +14,8 @@ struct Window GtkWidget *notebook; GtkWidget *new_tab; GtkWidget *downloads_tab; + WebKitUserContentManager *content_manager; + WebKitUserContentFilterStore *content_store; }; struct Client diff --git a/po/messages.pot b/po/messages.pot index c5a821c..093ddf2 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.3+g1b10b339.develop\n" +"Project-Id-Version: Badwolf 1.0.3+gdf1e25f.content-blockers\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2021-03-30 14:25+0200\n" +"POT-Creation-Date: 2021-04-09 06:17+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -74,23 +74,23 @@ msgstr "" msgid "Bookmarks: unable to parse file \"%s\"\n" msgstr "" -#: badwolf.c:954 +#: badwolf.c:1030 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:439 +#: badwolf.c:440 msgid "Continue" msgstr "" -#: badwolf.c:389 +#: badwolf.c:390 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:99 +#: badwolf.c:100 msgid "Crashed" msgstr "" @@ -98,31 +98,31 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:412 +#: badwolf.c:413 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:393 +#: badwolf.c:394 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:406 +#: badwolf.c:407 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:403 +#: badwolf.c:404 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:409 +#: badwolf.c:410 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:400 +#: badwolf.c:401 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:396 +#: badwolf.c:397 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" @@ -133,79 +133,104 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:889 +#: badwolf.c:904 msgid "New tab" msgstr "" -#: badwolf.c:1006 +#: badwolf.c:1099 msgid "Open new tab" msgstr "" -#: badwolf.c:103 +#: badwolf.c:104 msgid "Out of Memory" msgstr "" -#: badwolf.c:952 +#: badwolf.c:1028 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:959 +#: badwolf.c:1035 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:436 +#: badwolf.c:437 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:439 +#: badwolf.c:440 msgid "Temporarily Add Exception" msgstr "" -#: badwolf.c:647 +#: badwolf.c:650 msgid "Toggle javascript" msgstr "" -#: badwolf.c:652 +#: badwolf.c:655 msgid "Toggle loading images automatically" msgstr "" -#: badwolf.c:107 +#: badwolf.c:108 msgid "Unknown Crash" msgstr "" -#: badwolf.c:650 +#: badwolf.c:653 msgid "_IMG" msgstr "" -#: badwolf.c:645 +#: badwolf.c:648 msgid "_JS" msgstr "" -#: badwolf.c:777 +#: badwolf.c:981 +#, c-format +msgid "badwolf: content-filter loaded, adding to content-manager…\n" +msgstr "" + +#: badwolf.c:999 badwolf.c:1004 +#, c-format +msgid "badwolf: failed to compile content-filters.json, err: [%d] %s\n" +msgstr "" + +#: badwolf.c:969 badwolf.c:974 +#, c-format +msgid "badwolf: failed to load content-filter, err: [%d] %s\n" +msgstr "" + +#: badwolf.c:1059 +#, c-format +msgid "content-filters directory set to: %s\n" +msgstr "" + +#: badwolf.c:1056 +#, c-format +msgid "content-filters file set to: %s\n" +msgstr "" + +#: badwolf.c:792 msgid "search in current page" msgstr "" -#: badwolf.c:98 +#: badwolf.c:99 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:102 +#: badwolf.c:103 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:106 +#: badwolf.c:107 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:966 +#: badwolf.c:1042 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:1042 +#: badwolf.c:1135 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 0521e91dbc6cf31ac7d2961ab87ff4c1787184fa Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 9 Apr 2021 07:11:30 +0200 Subject: badwolf.1: Add "Targeting Domains with Content Blockers" --- badwolf.1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/badwolf.1 b/badwolf.1 index ae2dfa1..52638f0 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -78,7 +78,10 @@ A more generic variable name is also intended to be used in the future. .It Pa ${XDG_CONFIG_HOME:-$HOME/.config}/badwolf/content-filters.json WebKit-specific content-filter file, this allows to block unwanted content (ads, nagware, ...). For some introductory information about the format see: +.Bl -compact .Lk https://webkit.org/blog/3476/content-blockers-first-look/ +.Lk https://webkit.org/blog/4062/targeting-domains-with-content-blockers/ +.El .Pp For a converter using AblockPlus-style filters, try: .Lk https://gitlab.com/eyeo/adblockplus/abp2blocklist -- cgit v1.3.1-23-gd82d From 972a5337be4b687388dd12a72343f0593d39a2ce Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 9 Apr 2021 07:13:02 +0200 Subject: badwolf.1: Add "Creating a Content Blocker" --- badwolf.1 | 1 + 1 file changed, 1 insertion(+) diff --git a/badwolf.1 b/badwolf.1 index 52638f0..502d07e 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -81,6 +81,7 @@ For some introductory information about the format see: .Bl -compact .Lk https://webkit.org/blog/3476/content-blockers-first-look/ .Lk https://webkit.org/blog/4062/targeting-domains-with-content-blockers/ +.Lk https://developer.apple.com/documentation/safariservices/creating_a_content_blocker .El .Pp For a converter using AblockPlus-style filters, try: -- cgit v1.3.1-23-gd82d From 9be9423c9b7ba45fad205daaf818c8c653721538 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 9 Apr 2021 07:15:28 +0200 Subject: Fix unused parameter warnings --- badwolf.c | 2 ++ po/messages.pot | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/badwolf.c b/badwolf.c index ec2a691..bad849d 100644 --- a/badwolf.c +++ b/badwolf.c @@ -956,6 +956,7 @@ notebookCb_switch__page(GtkNotebook *notebook, GtkWidget *page, guint page_num, void content_managerCb_ready(GObject *store, GAsyncResult *result, gpointer user_data) { + (void)store; struct Window *window = (struct Window *)user_data; GError *err = NULL; @@ -986,6 +987,7 @@ content_managerCb_ready(GObject *store, GAsyncResult *result, gpointer user_data static void storeCb_finish(WebKitUserContentFilterStore *store, GAsyncResult *result, gpointer user_data) { + (void)store; struct Window *window = (struct Window *)user_data; GError *err = NULL; diff --git a/po/messages.pot b/po/messages.pot index 093ddf2..c608db5 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.3+gdf1e25f.content-blockers\n" +"Project-Id-Version: Badwolf 1.0.3+g972a533.content-blockers\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2021-04-09 06:17+0200\n" +"POT-Creation-Date: 2021-04-09 07:15+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -74,7 +74,7 @@ msgstr "" msgid "Bookmarks: unable to parse file \"%s\"\n" msgstr "" -#: badwolf.c:1030 +#: badwolf.c:1034 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" @@ -137,7 +137,7 @@ msgstr "" msgid "New tab" msgstr "" -#: badwolf.c:1099 +#: badwolf.c:1103 msgid "Open new tab" msgstr "" @@ -145,12 +145,12 @@ msgstr "" msgid "Out of Memory" msgstr "" -#: badwolf.c:1028 +#: badwolf.c:1032 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:1035 +#: badwolf.c:1039 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" @@ -184,27 +184,27 @@ msgstr "" msgid "_JS" msgstr "" -#: badwolf.c:981 +#: badwolf.c:982 #, c-format msgid "badwolf: content-filter loaded, adding to content-manager…\n" msgstr "" -#: badwolf.c:999 badwolf.c:1004 +#: badwolf.c:1002 badwolf.c:1009 #, c-format msgid "badwolf: failed to compile content-filters.json, err: [%d] %s\n" msgstr "" -#: badwolf.c:969 badwolf.c:974 +#: badwolf.c:970 badwolf.c:975 #, c-format msgid "badwolf: failed to load content-filter, err: [%d] %s\n" msgstr "" -#: badwolf.c:1059 +#: badwolf.c:1063 #, c-format msgid "content-filters directory set to: %s\n" msgstr "" -#: badwolf.c:1056 +#: badwolf.c:1060 #, c-format msgid "content-filters file set to: %s\n" msgstr "" @@ -225,12 +225,12 @@ msgstr "" msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:1042 +#: badwolf.c:1046 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:1135 +#: badwolf.c:1139 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 325e55ec58ea51543e2ece3133f2e8d429a5d6ae Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 9 Apr 2021 07:40:50 +0200 Subject: README: Fix signify link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b83d134..8dd6cf2 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ You need to have gettext installed. If you want a GUI, poedit exists and Weblate - `*.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) +- `*.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: -- cgit v1.3.1-23-gd82d From 46ce59c9d63a8ab20117b5eb85afb52c0d6390a1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 9 Apr 2021 07:44:41 +0200 Subject: Update copyright year --- COPYING | 2 +- README.md | 2 +- badwolf.c | 2 +- keybindings.c | 4 ++-- uri.c | 2 +- uri_test.c | 2 +- usr.bin.badwolf | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/COPYING b/COPYING index 6ba3f5f..ff830e0 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Copyright (c) 2019-2020, Badwolf Authors +Copyright (c) 2019-2021, Badwolf Authors All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 8dd6cf2..d2f194b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Minimalist and privacy-oriented WebKitGTK+ browser. Homepage: ``` -Copyright © 2019-2020 Badwolf Authors +Copyright © 2019-2021 Badwolf Authors SPDX-License-Identifier: BSD-3-Clause ``` diff --git a/badwolf.c b/badwolf.c index bad849d..bf5d183 100644 --- a/badwolf.c +++ b/badwolf.c @@ -1,5 +1,5 @@ // BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -// Copyright © 2019-2020 Badwolf Authors +// Copyright © 2019-2021 Badwolf Authors // SPDX-License-Identifier: BSD-3-Clause #include "badwolf.h" diff --git a/keybindings.c b/keybindings.c index 13f2a48..bfc8f7a 100644 --- a/keybindings.c +++ b/keybindings.c @@ -1,5 +1,5 @@ // BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -// Copyright © 2019-2020 Badwolf Authors +// Copyright © 2019-2021 Badwolf Authors // SPDX-License-Identifier: BSD-3-Clause #include "keybindings.h" @@ -42,7 +42,7 @@ badwolf_about_dialog(GtkWindow *main_window, gpointer user_data) "SPDX-License-Identifier: BSD-3-Clause"); gtk_about_dialog_set_copyright( GTK_ABOUT_DIALOG(about_dialog), - "2019-2020 Badwolf Authors "); + "2019-2021 Badwolf Authors "); gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about_dialog), homepage); gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about_dialog), comments); gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about_dialog), version); diff --git a/uri.c b/uri.c index 912bf86..3cbc1d6 100644 --- a/uri.c +++ b/uri.c @@ -1,5 +1,5 @@ // BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -// Copyright © 2019-2020 Badwolf Authors +// Copyright © 2019-2021 Badwolf Authors // SPDX-License-Identifier: BSD-3-Clause #include "uri.h" diff --git a/uri_test.c b/uri_test.c index a153817..28bdde9 100644 --- a/uri_test.c +++ b/uri_test.c @@ -1,5 +1,5 @@ // BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -// Copyright © 2019-2020 Badwolf Authors +// Copyright © 2019-2021 Badwolf Authors // SPDX-License-Identifier: BSD-3-Clause #include "uri.h" diff --git a/usr.bin.badwolf b/usr.bin.badwolf index 0ebce5d..861ee9f 100644 --- a/usr.bin.badwolf +++ b/usr.bin.badwolf @@ -1,5 +1,5 @@ # BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser -# Copyright © 2019-2020 Badwolf Authors +# Copyright © 2019-2021 Badwolf Authors # SPDX-License-Identifier: BSD-3-Clause # # Made on Gentoo Linux with PREFIX=/usr -- cgit v1.3.1-23-gd82d From edbbb27736db50534c9f0e029bc04f3f462596d3 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 9 Apr 2021 08:47:01 +0200 Subject: Move filter directory information to manpage --- badwolf.1 | 2 ++ badwolf.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/badwolf.1 b/badwolf.1 index 502d07e..111c0cc 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -89,6 +89,8 @@ For a converter using AblockPlus-style filters, try: .Pp For a ready-to-use file (that you should update periodically), try: .Lk https://easylist-downloads.adblockplus.org/easylist_min_content_blocker.json +.It Pa ${XDG_CACHE_HOME:-$HOME/.cache}/badwolf/filters +This is where the compiled filters are stored, the file(s) in it are automatically generated and so shouldn't be edited. .It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/bookmarks.xbel XBEL (XML Bookmark Exchange Language) file, known to be currently supported by: .Xr elinks 1 , diff --git a/badwolf.c b/badwolf.c index bf5d183..84f4104 100644 --- a/badwolf.c +++ b/badwolf.c @@ -1060,7 +1060,6 @@ main(int argc, char *argv[]) fprintf(stderr, _("content-filters file set to: %s\n"), contentFilterPath); gchar *filtersPath = g_build_filename(g_get_user_cache_dir(), g_get_prgname(), "filters", NULL); - fprintf(stderr, _("content-filters directory set to: %s\n"), filtersPath); window->content_store = webkit_user_content_filter_store_new(filtersPath); webkit_user_content_filter_store_save_from_file(window->content_store, -- cgit v1.3.1-23-gd82d From 231a7c45fac1d1811650ba9ae714de6975fc1da8 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 9 Apr 2021 08:47:01 +0200 Subject: po/messages.pot: Bump --- po/messages.pot | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/po/messages.pot b/po/messages.pot index c608db5..e4fbe56 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.3+g972a533.content-blockers\n" +"Project-Id-Version: Badwolf 1.0.3+gedbbb27.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2021-04-09 07:15+0200\n" +"POT-Creation-Date: 2021-04-09 08:48+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -137,7 +137,7 @@ msgstr "" msgid "New tab" msgstr "" -#: badwolf.c:1103 +#: badwolf.c:1102 msgid "Open new tab" msgstr "" @@ -199,11 +199,6 @@ msgstr "" msgid "badwolf: failed to load content-filter, err: [%d] %s\n" msgstr "" -#: badwolf.c:1063 -#, c-format -msgid "content-filters directory set to: %s\n" -msgstr "" - #: badwolf.c:1060 #, c-format msgid "content-filters file set to: %s\n" @@ -231,6 +226,6 @@ msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:1139 +#: badwolf.c:1138 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 5145eae758d3817c7bcc1a589514624bb62819e1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 10 Apr 2021 17:39:05 +0200 Subject: assert webkit_download before using it --- badwolf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/badwolf.c b/badwolf.c index 84f4104..af2fe78 100644 --- a/badwolf.c +++ b/badwolf.c @@ -10,6 +10,7 @@ #include "keybindings.h" #include "uri.h" +#include #include /* _() and other internationalization/localization helpers */ #include /* soup* */ #include /* LC_* */ @@ -466,6 +467,8 @@ web_contextCb_download_started(WebKitWebContext *web_context, struct Client *browser = (struct Client *)user_data; struct Download *download = malloc(sizeof(struct Download)); + assert(webkit_download); + if(download != NULL) { download->window = browser->window; -- cgit v1.3.1-23-gd82d From 52a75160abed353df818f26929e3bbf99382a660 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 10 Apr 2021 18:12:09 +0200 Subject: badwolf: Connect to WebContext only when created --- badwolf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/badwolf.c b/badwolf.c index af2fe78..93523e1 100644 --- a/badwolf.c +++ b/badwolf.c @@ -683,6 +683,12 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b webkit_web_context_set_process_model(web_context, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); webkit_web_context_set_web_extensions_directory(web_context, web_extensions_directory); + + g_signal_connect(G_OBJECT(web_context), + "download-started", + G_CALLBACK(web_contextCb_download_started), + browser); + } else { @@ -870,12 +876,6 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b browser); g_signal_connect(browser->webView, "load-changed", G_CALLBACK(WebViewCb_load_changed), browser); - /* signals for WebView's WebContext */ - g_signal_connect(G_OBJECT(web_context), - "download-started", - G_CALLBACK(web_contextCb_download_started), - browser); - /* signals for search widget */ g_signal_connect(browser->search, "next-match", G_CALLBACK(SearchEntryCb_next__match), browser); g_signal_connect( -- cgit v1.3.1-23-gd82d From 05361157c8daff3c75ec2a78c4f074149c4e8581 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 10 Apr 2021 18:48:06 +0200 Subject: fr: Update translation --- badwolf.c | 1 - po/fr.po | 82 +++++++++++++++++++++++++++++++++++++++------------------------ 2 files changed, 51 insertions(+), 32 deletions(-) diff --git a/badwolf.c b/badwolf.c index 93523e1..aea2bbc 100644 --- a/badwolf.c +++ b/badwolf.c @@ -688,7 +688,6 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b "download-started", G_CALLBACK(web_contextCb_download_started), browser); - } else { diff --git a/po/fr.po b/po/fr.po index ba42e68..58d386a 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: 2021-03-30 14:25+0200\n" -"PO-Revision-Date: 2021-03-30 14:52+0200\n" +"POT-Creation-Date: 2021-04-10 18:43+0200\n" +"PO-Revision-Date: 2021-04-10 18:43+0200\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" "Language: fr\n" @@ -74,16 +74,16 @@ msgstr "Marques-Pages: Échec à l'évaluation de l'expression XPath « %s »\ msgid "Bookmarks: unable to parse file \"%s\"\n" msgstr "Marques-Pages: Ëchec au parsage du fichier « %s »\n" -#: badwolf.c:954 +#: badwolf.c:1036 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit à la compilation: %d.%d.%d\n" -#: badwolf.c:439 +#: badwolf.c:441 msgid "Continue" msgstr "Continuer" -#: badwolf.c:389 +#: badwolf.c:391 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" @@ -94,7 +94,7 @@ msgstr "" "et son réseau.\n" "\n" -#: badwolf.c:99 +#: badwolf.c:101 msgid "Crashed" msgstr "Crash" @@ -102,33 +102,33 @@ msgstr "Crash" msgid "Download starting…" msgstr "Démarrage du téléchargement" -#: badwolf.c:412 +#: badwolf.c:414 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:393 +#: badwolf.c:395 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Erreur : L'autorité de certification (CA X509) est inconnue.\n" -#: badwolf.c:406 +#: badwolf.c:408 msgid "Error: The certificate has been revoked.\n" msgstr "Erreur : Le certificat à été révoqué.\n" -#: badwolf.c:403 +#: badwolf.c:405 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "Erreur : Le certificat a expiré.\n" -#: badwolf.c:409 +#: badwolf.c:411 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Erreur : Le certificat est considéré comme non-sécurisé.\n" -#: badwolf.c:400 +#: badwolf.c:402 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:396 +#: badwolf.c:398 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erreur : L'identité ne correspond pas à celle attendue.\n" @@ -141,79 +141,99 @@ msgstr "" "Navigateur WebKitGTK+ minimaliste et orienté vie privée\n" "Version WebKit au lancement: %d.%d.%d" -#: badwolf.c:889 +#: badwolf.c:906 msgid "New tab" msgstr "Nouvel onglet" -#: badwolf.c:1006 +#: badwolf.c:1104 msgid "Open new tab" msgstr "Ouvrir un nouvel onglet" -#: badwolf.c:103 +#: badwolf.c:105 msgid "Out of Memory" msgstr "Dépassement Mémoire" -#: badwolf.c:952 +#: badwolf.c:1034 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Version de Badwolf: %s\n" -#: badwolf.c:959 +#: badwolf.c:1041 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit au lancement: %d.%d.%d\n" -#: badwolf.c:436 +#: badwolf.c:438 #, c-format msgid "TLS Error for %s." msgstr "Erreur TLS pour %s." -#: badwolf.c:439 +#: badwolf.c:441 msgid "Temporarily Add Exception" msgstr "Ajouter Temporairement une Exception" -#: badwolf.c:647 +#: badwolf.c:653 msgid "Toggle javascript" msgstr "(Dés)activer javascript" -#: badwolf.c:652 +#: badwolf.c:658 msgid "Toggle loading images automatically" msgstr "(Dés)activer le chargement automatique des images" -#: badwolf.c:107 +#: badwolf.c:109 msgid "Unknown Crash" msgstr "Crash inconnu" -#: badwolf.c:650 +#: badwolf.c:656 msgid "_IMG" msgstr "_IMG" -#: badwolf.c:645 +#: badwolf.c:651 msgid "_JS" msgstr "_JS" -#: badwolf.c:777 +#: badwolf.c:984 +#, c-format +msgid "badwolf: content-filter loaded, adding to content-manager…\n" +msgstr "badwolf: content-filter chargé, ajout à content-manager…\n" + +#: badwolf.c:1004 badwolf.c:1011 +#, c-format +msgid "badwolf: failed to compile content-filters.json, err: [%d] %s\n" +msgstr "badwolf: échec de compilation de content-filters.json, err: [%d] %s\n" + +#: badwolf.c:972 badwolf.c:977 +#, c-format +msgid "badwolf: failed to load content-filter, err: [%d] %s\n" +msgstr "badwolf: échec de chargement de content-filter, err: [%d] %s\n" + +#: badwolf.c:1062 +#, c-format +msgid "content-filters file set to: %s\n" +msgstr "Fichier content-filters configuré à: %s\n" + +#: badwolf.c:800 msgid "search in current page" msgstr "recherche dans la page courante" -#: badwolf.c:98 +#: badwolf.c:100 msgid "the web process crashed.\n" msgstr "le processus web a cessé de fonctionner.\n" -#: badwolf.c:102 +#: badwolf.c:104 msgid "the web process exceeded the memory limit.\n" msgstr "le processus web a dépassé la limitation de mémoire.\n" -#: badwolf.c:106 +#: badwolf.c:108 msgid "the web process terminated for an unknown reason.\n" msgstr "le processus web s’est interrompu pour une raison inconnue.\n" -#: badwolf.c:966 +#: badwolf.c:1048 #, 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:1042 +#: badwolf.c:1140 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From e80608ea7d4382fa47ecc33f7a39776ab75ff868 Mon Sep 17 00:00:00 2001 From: Oğuz Ersen Date: Sat, 10 Apr 2021 20:45:07 +0300 Subject: tr: Update translation Closes: https://gitlab.com/lanodan/badWolf/-/merge_requests/9 --- po/tr.po | 86 +++++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 33 deletions(-) diff --git a/po/tr.po b/po/tr.po index 40a7861..2ce7fde 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1,14 +1,14 @@ # Turkish translations for Badwolf package. # Copyright (C) 2020 Badwolf Authors # This file is distributed under the same license as the Badwolf package. -# Oğuz Ersen , 2020. +# Oğuz Ersen , 2020, 2021. # msgid "" msgstr "" "Project-Id-Version: Badwolf 1.0.2+g17b9802.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-10-25 02:59+0100\n" -"PO-Revision-Date: 2020-11-05 23:00+0300\n" +"POT-Creation-Date: 2021-04-10 20:38+0300\n" +"PO-Revision-Date: 2021-04-10 20:38+0300\n" "Last-Translator: Oğuz Ersen \n" "Language-Team: Turkish\n" "Language: tr\n" @@ -74,16 +74,16 @@ msgstr "Yer imleri: \"%s\" XPath ifadesi değerlendirilemedi\n" msgid "Bookmarks: unable to parse file \"%s\"\n" msgstr "Yer imleri: \"%s\" dosyası ayrıştırılamadı\n" -#: badwolf.c:954 +#: badwolf.c:1036 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Derleme zamanı WebKit sürümü: %d.%d.%d\n" -#: badwolf.c:439 +#: badwolf.c:441 msgid "Continue" msgstr "Devam et" -#: badwolf.c:389 +#: badwolf.c:391 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" @@ -93,7 +93,7 @@ msgstr "" "doğrulanamadı. Makinenizi ve ağınızı doğrulamak isteyebilirsiniz.\n" "\n" -#: badwolf.c:99 +#: badwolf.c:101 msgid "Crashed" msgstr "Çöktü" @@ -101,38 +101,38 @@ msgstr "Çöktü" msgid "Download starting…" msgstr "İndirme başlatılıyor…" -#: badwolf.c:412 +#: badwolf.c:414 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "Hata: Sertifika doğrulanırken bilinmeyen bir hata oluştu.\n" -#: badwolf.c:393 +#: badwolf.c:395 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Hata: X509 Sertifika Yetkilisi bilinmiyor.\n" -#: badwolf.c:406 +#: badwolf.c:408 msgid "Error: The certificate has been revoked.\n" msgstr "Hata: Sertifika yürürlükten kaldırıldı.\n" -#: badwolf.c:403 +#: badwolf.c:405 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" "Hata: Sertifikanın süresi doldu. Sisteminizin saatini gözden geçirin.\n" -#: badwolf.c:409 +#: badwolf.c:411 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Hata: Sertifikanın güvensiz olduğu kabul ediliyor.\n" -#: badwolf.c:400 +#: badwolf.c:402 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" "Hata: Sertifika henüz geçerli değil. Sisteminizin saatini gözden geçirin.\n" -#: badwolf.c:396 +#: badwolf.c:398 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Hata: Verilen kimlik beklenen ile eşleşmiyor.\n" #: keybindings.c:32 -#, fuzzy, c-format +#, c-format msgid "" "Minimalist and privacy-oriented web browser based on WebKitGTK\n" "Runtime WebKit version: %d.%d.%d" @@ -140,79 +140,99 @@ msgstr "" "WebKitGTK tabanlı sadelik ve gizlilik odaklı web tarayıcısı\n" "Çalışma zamanı WebKit sürümü: %d.%d.%d" -#: badwolf.c:889 +#: badwolf.c:906 msgid "New tab" msgstr "Yeni sekme" -#: badwolf.c:1006 +#: badwolf.c:1104 msgid "Open new tab" msgstr "Yeni sekme aç" -#: badwolf.c:103 +#: badwolf.c:105 msgid "Out of Memory" msgstr "Yetersiz Bellek" -#: badwolf.c:952 +#: badwolf.c:1034 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Çalışan Badwolf sürümü: %s\n" -#: badwolf.c:959 +#: badwolf.c:1041 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Çalışma zamanı WebKit sürümü: %d.%d.%d\n" -#: badwolf.c:436 +#: badwolf.c:438 #, c-format msgid "TLS Error for %s." msgstr "%s için TLS Hatası." -#: badwolf.c:439 +#: badwolf.c:441 msgid "Temporarily Add Exception" msgstr "Geçici Olarak İstisna Ekle" -#: badwolf.c:647 +#: badwolf.c:653 msgid "Toggle javascript" msgstr "Javascript'i aç/kapat" -#: badwolf.c:652 +#: badwolf.c:658 msgid "Toggle loading images automatically" msgstr "Resimleri otomatik yüklemeyi aç/kapat" -#: badwolf.c:107 +#: badwolf.c:109 msgid "Unknown Crash" msgstr "Bilinmeyen Çökme" -#: badwolf.c:650 +#: badwolf.c:656 msgid "_IMG" msgstr "_RSM" -#: badwolf.c:645 +#: badwolf.c:651 msgid "_JS" msgstr "_JS" -#: badwolf.c:777 +#: badwolf.c:984 +#, c-format +msgid "badwolf: content-filter loaded, adding to content-manager…\n" +msgstr "badwolf: content-filter yüklendi, content-manager'e ekleniyor…\n" + +#: badwolf.c:1004 badwolf.c:1011 +#, c-format +msgid "badwolf: failed to compile content-filters.json, err: [%d] %s\n" +msgstr "badwolf: content-filters.json derlenemedi, hata: [%d] %s\n" + +#: badwolf.c:972 badwolf.c:977 +#, c-format +msgid "badwolf: failed to load content-filter, err: [%d] %s\n" +msgstr "badwolf: content-filter yüklenemedi, hata: [%d] %s\n" + +#: badwolf.c:1062 +#, c-format +msgid "content-filters file set to: %s\n" +msgstr "content-filters dosyası şuna ayarlandı: %s\n" + +#: badwolf.c:800 msgid "search in current page" msgstr "geçerli sayfada ara" -#: badwolf.c:98 +#: badwolf.c:100 msgid "the web process crashed.\n" msgstr "web işlemi çöktü.\n" -#: badwolf.c:102 +#: badwolf.c:104 msgid "the web process exceeded the memory limit.\n" msgstr "web işlemi bellek sınırını aştı.\n" -#: badwolf.c:106 +#: badwolf.c:108 msgid "the web process terminated for an unknown reason.\n" msgstr "web işlemi bilinmeyen bir nedenle sona erdi.\n" -#: badwolf.c:966 +#: badwolf.c:1048 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "webkit-web-extension dizini şuna ayarlandı: %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:1042 +#: badwolf.c:1140 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From ad0c46dcbac4607cd0b048c0e66e0865bb7b4983 Mon Sep 17 00:00:00 2001 From: Ben K Date: Sun, 11 Apr 2021 14:33:15 +0200 Subject: de: Update translation --- po/de.po | 114 ++++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 65 insertions(+), 49 deletions(-) diff --git a/po/de.po b/po/de.po index 0afd563..9660b70 100644 --- a/po/de.po +++ b/po/de.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 1.0.3+g1b10b33.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2021-03-23 18:10+0100\n" -"PO-Revision-Date: 2021-03-25 15:40+0100\n" +"POT-Creation-Date: 2021-04-11 14:10+0200\n" +"PO-Revision-Date: 2021-04-11 14:32+0200\n" "Last-Translator: Ben K. \n" "Language-Team: German\n" "Language: de\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 2.2.1\n" +"X-Generator: Poedit 2.4.2\n" #: downloads.c:117 #, c-format @@ -70,34 +70,33 @@ msgstr "Lesezeichen: Kein neuer XPath-Kontext konnte erstellen werden\n" #, fuzzy, c-format msgid "Bookmarks: unable to evaluate XPath expression \"%s\"\n" msgstr "" -"Leisezeichen: Der XPath-Ausdruck \"%s\" konnte nicht ausgewertet " -"werden\n" +"Leisezeichen: Der XPath-Ausdruck \"%s\" konnte nicht ausgewertet werden\n" #: bookmarks.c:89 #, c-format msgid "Bookmarks: unable to parse file \"%s\"\n" msgstr "Lesezeichen: Die Datei \"%s\" konnte nicht geparst werden\n" -#: badwolf.c:954 +#: badwolf.c:1036 #, fuzzy, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Buildtime WebKit version: %d.%d.%d\n" -#: badwolf.c:439 +#: badwolf.c:441 msgid "Continue" msgstr "Weiter" -#: badwolf.c:389 +#: badwolf.c:391 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 "" "Das TLS-Zertifikat konnte nicht verifiziert werden, um eine bessere " -"Sicherheit der Verbindung sicherzustellen. Sie möchten vielleicht ihr " -"Gerät und ihr Netzwerk überprüfen. \n" +"Sicherheit der Verbindung sicherzustellen. Sie möchten vielleicht ihr Gerät " +"und ihr Netzwerk überprüfen. \n" -#: badwolf.c:99 +#: badwolf.c:101 msgid "Crashed" msgstr "Abgestürtzt" @@ -105,44 +104,42 @@ msgstr "Abgestürtzt" msgid "Download starting…" msgstr "Download startet…" -#: badwolf.c:412 +#: badwolf.c:414 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" "Fehler: Es ist ein unbekannter Fehler beim überprüfen des Zertifikats " "aufgetreten.\n" -#: badwolf.c:393 +#: badwolf.c:395 #, fuzzy msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Fehler: Die X509 Zertifikatsautorität ist unbekannt.\n" -#: badwolf.c:406 +#: badwolf.c:408 #, fuzzy msgid "Error: The certificate has been revoked.\n" msgstr "Fehler: Das Zertifikat wurde widerrufen.\n" -#: badwolf.c:403 +#: badwolf.c:405 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -"Fehler: Das Zertifikat ist abgelaufen. Bitte überprüfen Sie, ob die " -"Uhr ihres Systems richtig eingestellt ist.\n" +"Fehler: Das Zertifikat ist abgelaufen. Bitte überprüfen Sie, ob die Uhr " +"ihres Systems richtig eingestellt ist.\n" -#: badwolf.c:409 +#: badwolf.c:411 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Fehler: Das Zertifikat wird als unsicher angesehen.\n" -#: badwolf.c:400 -msgid "" -"Error: The certificate isn't valid yet. Check your system's clock.\n" +#: badwolf.c:402 +msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -"Fehler: Das Zertifikat ist noch nicht gültig. Bitte überprüfen Sie, ob " -"die Uhr ihres Systems richtig eingestellt ist.\n" +"Fehler: Das Zertifikat ist noch nicht gültig. Bitte überprüfen Sie, ob die " +"Uhr ihres Systems richtig eingestellt ist.\n" -#: badwolf.c:396 +#: badwolf.c:398 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" -"Fehler: Die gegebene Identität passt nicht mit der Erwarteten " -"zusammen.\n" +"Fehler: Die gegebene Identität passt nicht mit der Erwarteten zusammen.\n" #: keybindings.c:32 #, c-format @@ -150,85 +147,104 @@ msgid "" "Minimalist and privacy-oriented web browser based on WebKitGTK\n" "Runtime WebKit version: %d.%d.%d" msgstr "" -"Minimalistischer und Privatsphäre-orientierter Internetbrowser " -"basierend of WebKitGTK\n" +"Minimalistischer und Privatsphäre-orientierter Internetbrowser basierend of " +"WebKitGTK\n" "Runtime WebKit version: %d.%d.%d" -#: badwolf.c:889 +#: badwolf.c:906 msgid "New tab" msgstr "Neuer Reiter" -#: badwolf.c:1006 +#: badwolf.c:1104 msgid "Open new tab" msgstr "Neuen Reiter öffnen" -#: badwolf.c:103 +#: badwolf.c:105 msgid "Out of Memory" -msgstr "" -"Ihnen scheint der Arbeitsspeicher ausgegangen zu sein! (Out of Memory)" +msgstr "Ihnen scheint der Arbeitsspeicher ausgegangen zu sein! (Out of Memory)" -#: badwolf.c:952 +#: badwolf.c:1034 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Ausführende Badwolf-Version: %s\n" -#: badwolf.c:959 +#: badwolf.c:1041 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Ausführende WebKit-Version: %d.%d.%d\n" -#: badwolf.c:436 +#: badwolf.c:438 #, c-format msgid "TLS Error for %s." msgstr "TLS-Fehler für %s." -#: badwolf.c:439 -#, fuzzy +#: badwolf.c:441 msgid "Temporarily Add Exception" msgstr "Eine Ausnahme machen" -#: badwolf.c:647 +#: badwolf.c:653 msgid "Toggle javascript" msgstr "JavaScript ein-/ausschalten" -#: badwolf.c:652 +#: badwolf.c:658 msgid "Toggle loading images automatically" msgstr "Das automatische Laden von Bildern ein-/ausschalten" -#: badwolf.c:107 +#: badwolf.c:109 msgid "Unknown Crash" msgstr "Unbekannter Absturz" -#: badwolf.c:650 +#: badwolf.c:656 msgid "_IMG" msgstr "_IMG" -#: badwolf.c:645 +#: badwolf.c:651 msgid "_JS" msgstr "_JS" -#: badwolf.c:777 +#: badwolf.c:984 +#, fuzzy, c-format +msgid "badwolf: content-filter loaded, adding to content-manager…\n" +msgstr "badwolf: Inhaltsfilter wurde geladen, füge zum Inhaltsmanager hinzu…\n" + +#: badwolf.c:1004 badwolf.c:1011 +#, c-format +msgid "badwolf: failed to compile content-filters.json, err: [%d] %s\n" +msgstr "" +"badwolf: kompilieren von content-filters.json fehlgeschlagen, err: [%d] %s\n" + +#: badwolf.c:972 badwolf.c:977 +#, fuzzy, c-format +msgid "badwolf: failed to load content-filter, err: [%d] %s\n" +msgstr "badwolf: konnte Inhaltsfilter nicht laden, err: [%d] %s\n" + +#: badwolf.c:1062 +#, c-format +msgid "content-filters file set to: %s\n" +msgstr "Inhaltsfilter-Datei wurde gesetzt auf: %s\n" + +#: badwolf.c:800 msgid "search in current page" msgstr "Die aktuelle Seite durchsuchen" -#: badwolf.c:98 +#: badwolf.c:100 msgid "the web process crashed.\n" msgstr "Der Webprozess ist abgestürzt.\n" -#: badwolf.c:102 +#: badwolf.c:104 msgid "the web process exceeded the memory limit.\n" msgstr "Der Webprozess hat das Arbeitsspeicherlimit überschritten.\n" -#: badwolf.c:106 +#: badwolf.c:108 msgid "the web process terminated for an unknown reason.\n" msgstr "Der Webprozess wurde aus unbekannten Gründen beendet.\n" -#: badwolf.c:966 +#: badwolf.c:1048 #, fuzzy, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "Das WebKit-Web-Erweiterungs-Verzeichnis wurde gesetzt auf: %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:1042 +#: badwolf.c:1140 msgid "ø" msgstr "ø" -- cgit v1.3.1-23-gd82d From e4fd27eea70d47cabbb0f24fbadb992e03ba926c Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 12 Apr 2021 23:08:39 +0200 Subject: .gitignore: *.o and *.mo --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 0f3b962..fba98ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /badwolf /locale +*.o +*.mo -- cgit v1.3.1-23-gd82d From 96157d37a0bf67d7fa82f0891eeae72b77da2b8c Mon Sep 17 00:00:00 2001 From: Pedro Lucas Porcellis Date: Wed, 14 Apr 2021 19:33:33 -0300 Subject: i18n: Update pt_BR translation --- po/pt_BR.po | 100 ++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 64 insertions(+), 36 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index a3df8f5..61b5c5b 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -6,8 +6,8 @@ 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-10-25 02:59+0100\n" -"PO-Revision-Date: 2020-05-17 20:18-0300\n" +"POT-Creation-Date: 2021-04-14 18:24-0300\n" +"PO-Revision-Date: 2021-04-14 19:31-0300\n" "Last-Translator: Pedro Lucas Porcellis \n" "Language-Team: Brazilian Portuguese\n" "Language: pt_BR\n" @@ -15,6 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 2.4.1\n" #: downloads.c:117 #, c-format @@ -66,33 +67,35 @@ msgstr "Favoritos: não foi possível criar um novo contexto do XPath\n" #: bookmarks.c:107 #, c-format msgid "Bookmarks: unable to evaluate XPath expression \"%s\"\n" -msgstr "Favoritos: não foi possivel compreender a expressão do XPath \"%s\"\n" +msgstr "" +"Favoritos: não foi possivel compreender a expressão do XPath \"%s\"\n" #: bookmarks.c:89 #, c-format msgid "Bookmarks: unable to parse file \"%s\"\n" msgstr "Favoritos: não foi possível ler o arquivo \"%s\"\n" -#: badwolf.c:954 +#: badwolf.c:1036 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit %d.%d.%d\n" -#: badwolf.c:439 +#: badwolf.c:441 msgid "Continue" msgstr "Continuar" -#: badwolf.c:389 +#: badwolf.c:391 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:99 +#: badwolf.c:101 msgid "Crashed" msgstr "Erro" @@ -100,34 +103,37 @@ msgstr "Erro" msgid "Download starting…" msgstr "Transferência Iniciada…" -#: badwolf.c:412 +#: badwolf.c:414 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:393 +#: badwolf.c:395 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Erro: A Autoridade de Certificados X509 é desconhecida.\n" -#: badwolf.c:406 +#: badwolf.c:408 msgid "Error: The certificate has been revoked.\n" msgstr "Erro: O certificado foi revogado.\n" -#: badwolf.c:403 +#: badwolf.c:405 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:409 +#: badwolf.c:411 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Erro: O certificado é considerado inseguro.\n" -#: badwolf.c:400 -msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" +#: badwolf.c:402 +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:396 +#: badwolf.c:398 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erro: A identidade não confere com a esperada.\n" @@ -140,79 +146,101 @@ msgstr "" "Navegador orientado pela privacidade e minimalismo\n" "Versão do WebKit: %d.%d.%d" -#: badwolf.c:889 +#: badwolf.c:906 msgid "New tab" msgstr "Nova aba" -#: badwolf.c:1006 +#: badwolf.c:1104 msgid "Open new tab" msgstr "Abrir uma Nova aba" -#: badwolf.c:103 +#: badwolf.c:105 msgid "Out of Memory" msgstr "Sem memória" -#: badwolf.c:952 +#: badwolf.c:1034 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Rodando versão %s do Badwolf\n" -#: badwolf.c:959 +#: badwolf.c:1041 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit: %d.%d.%d\n" -#: badwolf.c:436 +#: badwolf.c:438 #, c-format msgid "TLS Error for %s." msgstr "Erro TLS para %s." -#: badwolf.c:439 +#: badwolf.c:441 msgid "Temporarily Add Exception" msgstr "Adicionar exceção temporária" -#: badwolf.c:647 +#: badwolf.c:653 msgid "Toggle javascript" msgstr "Habilitar Javascript" -#: badwolf.c:652 +#: badwolf.c:658 msgid "Toggle loading images automatically" msgstr "Habilitar carregamento de imagens automático" -#: badwolf.c:107 +#: badwolf.c:109 msgid "Unknown Crash" msgstr "Erro desconhecido" -#: badwolf.c:650 +#: badwolf.c:656 msgid "_IMG" msgstr "_IMG" -#: badwolf.c:645 +#: badwolf.c:651 msgid "_JS" msgstr "_JS" -#: badwolf.c:777 +#: badwolf.c:984 +#, c-format +msgid "badwolf: content-filter loaded, adding to content-manager…\n" +msgstr "" +"badwolf: carregado content-filter, adicionando ao content-manager...\n" + +#: badwolf.c:1004 badwolf.c:1011 +#, c-format +msgid "badwolf: failed to compile content-filters.json, err: [%d] %s\n" +msgstr "" +"badwolf: falha ao compilar 'content-filters.json', erro: [%d] %s\n" + +#: badwolf.c:972 badwolf.c:977 +#, c-format +msgid "badwolf: failed to load content-filter, err: [%d] %s\n" +msgstr "badwolf: falha ao carregar content-filter, erro: [%d] %s\n" + +#: badwolf.c:1062 +#, c-format +msgid "content-filters file set to: %s\n" +msgstr "arquivo de content-filters configurado para: %s\n" + +#: badwolf.c:800 msgid "search in current page" msgstr "buscar na página atual" -#: badwolf.c:98 +#: badwolf.c:100 msgid "the web process crashed.\n" msgstr "o processo web travou.\n" -#: badwolf.c:102 +#: badwolf.c:104 msgid "the web process exceeded the memory limit.\n" msgstr "o processo web excedeu o limite de memória.\n" -#: badwolf.c:106 +#: badwolf.c:108 msgid "the web process terminated for an unknown reason.\n" msgstr "o processo web terminou por uma razão desconhecida.\n" -#: badwolf.c:966 +#: badwolf.c:1048 #, 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:1042 +#: badwolf.c:1140 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 4abd7044fda92b4d3dcb4774ff8d5f7772987b6a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 19 Apr 2021 22:31:00 +0200 Subject: Makefile: Bump to 1.1.0 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5496f25..2ec3a80 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # - Usage of += for appending to a variable PACKAGE = Badwolf -VERSION = 1.0.3 +VERSION = 1.1.0 VERSION_FULL = $(VERSION)`./version.sh` PREFIX ?= /usr/local -- cgit v1.3.1-23-gd82d