logo

badwolf

minimalist and privacy-oriented web browser based on WebKitGTK git clone https://hacktivis.me/git/badwolf.git
commit: 3f0e2f50f21a1968fc3217c3be436f7fb586dca0
parent ffc2fc8762f7f496162e4c2fa0d535a9fe1a27fe
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sun, 19 Sep 2021 07:44:54 +0200

Switch from libsoup-2.4 to glib's GUri

- SoupURI is gone in libsoup-3.0
- GUri got added in glib-2.66
- WebKitGTK 2.32.0 depends on >=glib-2.67

Diffstat:

Mbadwolf.c11++++++++---
Mbadwolf.h2+-
Mconfigure8++++----
3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/badwolf.c b/badwolf.c @@ -439,7 +439,8 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, struct Client *browser = (struct Client *)user_data; gchar *error_details = detail_tls_certificate_flags(errors); gint dialog_response; - SoupURI *failing_uri = soup_uri_new(failing_text); + + GUri *failing_uri = g_uri_parse(failing_text, G_URI_FLAGS_NONE, NULL); GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(browser->window->main_window), GTK_DIALOG_MODAL & GTK_DIALOG_DESTROY_WITH_PARENT, @@ -449,6 +450,10 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, failing_text); gtk_dialog_add_buttons( GTK_DIALOG(dialog), _("Temporarily Add Exception"), 1, _("Continue"), 0, NULL); + if(!failing_uri) + { + gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), 1, FALSE); + } gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0); gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), "%s\n", error_details); @@ -457,11 +462,11 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, if(dialog_response == 1) { webkit_web_context_allow_tls_certificate_for_host( - webkit_web_view_get_context(browser->webView), certificate, failing_uri->host); + webkit_web_view_get_context(browser->webView), certificate, g_uri_get_host(failing_uri)); webkit_web_view_reload(browser->webView); } - soup_uri_free(failing_uri); + g_free(failing_uri); g_free(error_details); gtk_widget_destroy(dialog); diff --git a/badwolf.h b/badwolf.h @@ -5,7 +5,7 @@ #include <inttypes.h> /* uint64_t */ #include <webkit2/webkit2.h> -#if ! WEBKIT_CHECK_VERSION(2,32,0) +#if !WEBKIT_CHECK_VERSION(2, 32, 0) #error WebkitGTK 2.32.0 is the latest supported version for badwolf. #endif diff --git a/configure b/configure @@ -52,20 +52,20 @@ done case "${WITH_WEBKITGTK}n" in 4.1n) pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.1 || exit 1 - DEPS="${DEPS} webkit2gtk-4.1 libsoup-3.0" + DEPS="${DEPS} webkit2gtk-4.1" ;; 4.0n) pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.0 || exit 1 - DEPS="${DEPS} webkit2gtk-4.0 libsoup-2.4" + DEPS="${DEPS} webkit2gtk-4.0" ;; n) echo "warning: Packagers should specify the ABI version (4.0 or 4.1) in WITH_WEBKITGTK" >&2 if pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.1 then - DEPS="${DEPS} webkit2gtk-4.1 libsoup-3.0" + DEPS="${DEPS} webkit2gtk-4.1" else pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.0 || exit 1 - DEPS="${DEPS} webkit2gtk-4.0 libsoup-2.4" + DEPS="${DEPS} webkit2gtk-4.0" fi ;; *)