From 9e56d37bae4fde109ff803256a1028698c6dc4b8 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 15 Sep 2024 03:59:04 +0300 Subject: [PATCH] delegate unsupported URI to external application --- .../tab/page/content/text/gemini/reader.cpp | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/app/browser/main/tab/page/content/text/gemini/reader.cpp b/src/app/browser/main/tab/page/content/text/gemini/reader.cpp index c2fc20dc..dd772be8 100644 --- a/src/app/browser/main/tab/page/content/text/gemini/reader.cpp +++ b/src/app/browser/main/tab/page/content/text/gemini/reader.cpp @@ -119,15 +119,21 @@ Reader::Reader( signal_activate_link().connect( [this](const Glib::ustring & URI) -> bool { - // Open link URI - activate_action( - "win.open", - Glib::Variant::create( - URI - ) + const char * SCHEME = g_uri_parse_scheme( + URI.c_str() ); - return false; + if (SCHEME == NULL || SCHEME == Glib::ustring("gemini")) + { + return activate_action( + "win.open", + Glib::Variant::create( + URI + ) + ); + } + + return false; // delegate unsupported URI to external application }, false // after );