Browse Source

delegate unsupported URI to external application

CPP-GTK4
yggverse 2 months ago
parent
commit
9e56d37bae
  1. 20
      src/app/browser/main/tab/page/content/text/gemini/reader.cpp

20
src/app/browser/main/tab/page/content/text/gemini/reader.cpp

@ -119,15 +119,21 @@ Reader::Reader(
signal_activate_link().connect( signal_activate_link().connect(
[this](const Glib::ustring & URI) -> bool [this](const Glib::ustring & URI) -> bool
{ {
// Open link URI const char * SCHEME = g_uri_parse_scheme(
activate_action( URI.c_str()
"win.open",
Glib::Variant<Glib::ustring>::create(
URI
)
); );
return false; if (SCHEME == NULL || SCHEME == Glib::ustring("gemini"))
{
return activate_action(
"win.open",
Glib::Variant<Glib::ustring>::create(
URI
)
);
}
return false; // delegate unsupported URI to external application
}, },
false // after false // after
); );

Loading…
Cancel
Save