From 8d79761a448e8b6391f4b348630017516aa07ab8 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 6 Jul 2019 13:50:28 +0200 Subject: Add toggling of caret browsing on F7 --- badwolf.1 | 2 ++ 1 file changed, 2 insertions(+) (limited to 'badwolf.1') diff --git a/badwolf.1 b/badwolf.1 index 33b86c0..d2014a2 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -36,6 +36,8 @@ Focuses on the search entry Focuses on the location(URL) entry .It browser C-S-r / C-r, browser F5 Reloads the current tab (with/without clearing cache) +.It browser F7 +Toggles caret browsing. .It browser C-[ / C-] Go back/forward in current tab’s history .It any A-Left / A-Right -- cgit v1.3.1-23-gd82d From aa9d7cd7abb1c1bb2afab376194614ef0c5c9b6e Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 6 Jul 2019 14:21:41 +0200 Subject: Bind F12 to opening Web Inspector --- badwolf.1 | 2 ++ badwolf.c | 3 +++ 2 files changed, 5 insertions(+) (limited to 'badwolf.1') diff --git a/badwolf.1 b/badwolf.1 index d2014a2..8f13795 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -38,6 +38,8 @@ Focuses on the location(URL) entry Reloads the current tab (with/without clearing cache) .It browser F7 Toggles caret browsing. +.It browser F12 +Opens the web inspector. .It browser C-[ / C-] Go back/forward in current tab’s history .It any A-Left / A-Right diff --git a/badwolf.c b/badwolf.c index 8b4f289..5ea0e5b 100644 --- a/badwolf.c +++ b/badwolf.c @@ -248,6 +248,9 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client * { case GDK_KEY_F5: webkit_web_view_reload(browser->webView); return TRUE; case GDK_KEY_F7: toggle_caret_browsing(browser->webView); return TRUE; + case GDK_KEY_F12: + webkit_web_inspector_show(webkit_web_view_get_inspector(browser->webView)); + return TRUE; } } else -- cgit v1.3.1-23-gd82d From 1026413b3f2ca3ebb0f2604ef34b0b6094d14c8d Mon Sep 17 00:00:00 2001 From: Jean-Yves Monnier Date: Tue, 9 Jul 2019 05:17:37 +0200 Subject: open multiple URLs Tested and validated on FreeBSD --- badwolf.1 | 2 +- badwolf.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'badwolf.1') diff --git a/badwolf.1 b/badwolf.1 index 8f13795..27cd6b3 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -9,7 +9,7 @@ .Sh SYNOPSIS .Nm .Op Ar webkit/gtk options -.Op Ar url or path +.Op Ar URLs or paths .Sh DESCRIPTION .Nm is a minimalist browser that care about privacy, it is based on WebKitGTK and thus also accepts WebKitGTK (and depdendencies) flags and environment variables, unfortunately there doesn't seems to be manpages for theses. diff --git a/badwolf.c b/badwolf.c index ca1b302..68a9c23 100644 --- a/badwolf.c +++ b/badwolf.c @@ -701,7 +701,6 @@ main(int argc, char *argv[]) { // getting an abort if this one fails to alloc struct Window *window = g_malloc(sizeof(struct Window)); - gchar *target_url = NULL; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, DATADIR "/locale"); @@ -722,8 +721,6 @@ main(int argc, char *argv[]) gtk_init(&argc, &argv); - if(argv[1]) target_url = argv[1]; - 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); @@ -741,7 +738,11 @@ main(int argc, char *argv[]) gtk_container_add(GTK_CONTAINER(window->main_window), window->notebook); - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, target_url, NULL)); + if(argc == 1) + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, NULL, NULL)); + else + for(int i = 1; i < argc; ++i) + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, argv[i], NULL)); g_signal_connect( window->main_window, "key-press-event", G_CALLBACK(main_windowCb_key_press_event), window); -- cgit v1.3.1-23-gd82d From 9c11983fadcb5ce3bcf6fbbdb2e3c7dfff09d653 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 12 Oct 2019 06:54:04 +0200 Subject: Set WebKitWebExtension directory --- badwolf.1 | 12 ++++++++++-- badwolf.c | 15 +++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) (limited to 'badwolf.1') diff --git a/badwolf.1 b/badwolf.1 index 27cd6b3..ccec38e 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -1,7 +1,7 @@ ./" BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser ./" Copyright © 2019 Haelwenn (lanodan) Monnier ./" SPDX-License-Identifier: BSD-3-Clause -.Dd 2019-04-02 +.Dd 2019-10-31 .Dt badwolf 1 .Sh NAME .Nm badwolf @@ -12,7 +12,7 @@ .Op Ar URLs or paths .Sh DESCRIPTION .Nm -is a minimalist browser that care about privacy, it is based on WebKitGTK and thus also accepts WebKitGTK (and depdendencies) flags and environment variables, unfortunately there doesn't seems to be manpages for theses. +is a minimalist browser that cares about privacy, it is based on WebKitGTK and thus also accepts WebKitGTK (and dependencies) flags and environment variables, unfortunately there doesn't seems to be manpages for theses. .Pp Runtime configuration specific to .Nm @@ -66,6 +66,14 @@ A colon-separated list in the form lang_COUNTRY where lang is in ISO-639 and COU .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. .El +.Sh FILES +.Bl -tag -width Ds -compact +.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 +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. +.El .Sh BUGS You can submit contributions or tickets to .Lk https://gitlab.com/lanodan/badwolf diff --git a/badwolf.c b/badwolf.c index b9f9de2..6c6b0c9 100644 --- a/badwolf.c +++ b/badwolf.c @@ -15,6 +15,8 @@ const gchar *homepage = "https://hacktivis.me/projects/badwolf"; const gchar *version = VERSION; +gchar *web_extensions_directory; + static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data); static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView, WebKitWebProcessTerminationReason reason, @@ -42,7 +44,7 @@ static gboolean WebViewCb_decide_policy(WebKitWebView *web_view, WebKitPolicyDecision *decision, WebKitPolicyDecisionType decision_type, gpointer user_data); -static void web_contextCb_download_started(WebKitWebContext *context, +static void web_contextCb_download_started(WebKitWebContext *web_context, WebKitDownload *download, gpointer user_data); static gboolean downloadCb_decide_destination(WebKitDownload *download, @@ -353,11 +355,11 @@ WebViewCb_decide_policy(WebKitWebView *web_view, } static void -web_contextCb_download_started(WebKitWebContext *context, +web_contextCb_download_started(WebKitWebContext *web_context, WebKitDownload *download, gpointer user_data) { - (void)context; + (void)web_context; g_signal_connect(G_OBJECT(download), "decide-destination", @@ -500,6 +502,8 @@ new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web 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"); if(badwolf_l10n != NULL) @@ -708,6 +712,8 @@ main(int argc, char *argv[]) bind_textdomain_codeset(PACKAGE, "UTF-8"); textdomain(PACKAGE); + gtk_init(&argc, &argv); + g_fprintf(stderr, _("Running Badwolf version: %s\n"), version); g_fprintf(stderr, _("Buildtime WebKit version: %d.%d.%d\n"), @@ -720,7 +726,8 @@ main(int argc, char *argv[]) webkit_get_minor_version(), webkit_get_micro_version()); - gtk_init(&argc, &argv); + web_extensions_directory = g_build_filename(g_get_user_data_dir(), "badwolf", "webkit-web-extension", NULL); + g_fprintf(stderr, _("webkit-web-extension directory set to: %s\n"), web_extensions_directory); window->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); window->notebook = gtk_notebook_new(); -- cgit v1.3.1-23-gd82d From 12f7df5f1450cf533dcb6c6848cb2e8f46d9505a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 31 Oct 2019 18:19:48 +0100 Subject: badwolf.1: mention badwolf-extensions and wyebadblock --- badwolf.1 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'badwolf.1') diff --git a/badwolf.1 b/badwolf.1 index ccec38e..0b044d5 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -73,6 +73,12 @@ Directory containing the .Lk https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebExtension.html WebKitWebExtensions 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 +.Lk https://hacktivis.me/git/badwolf-extensions +.Lk https://github.com/jun7/wyebadblock +.El .El .Sh BUGS You can submit contributions or tickets to -- cgit v1.3.1-23-gd82d