From 7f7c1b872f1181ec0deba520aedd435edaa6e2a8 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 04 Nov 2017 21:45:21 -0400 Subject: mq_web_view_normal_scheme_methods.display_uri(): Hide query of about-scheme URIs --- (limited to 'src') diff --git a/src/web-view-schemes/normal.c b/src/web-view-schemes/normal.c index c4d42b8..3a2313e 100644 --- a/src/web-view-schemes/normal.c +++ b/src/web-view-schemes/normal.c @@ -87,8 +87,16 @@ static gchar * display_uri(MqWebView G_GNUC_UNUSED *web_view, MqWebViewScheme G_GNUC_UNUSED *scheme, const gchar *uri) { + gchar *rw_uri; + gchar *query; + if (g_str_has_prefix(uri, "mq-about:")) { - return g_strconcat("about:", uri + strlen("mq-about:"), NULL); + rw_uri = g_strconcat("about:", uri + strlen("mq-about:"), NULL); + query = strchr(rw_uri, '?'); + if (query) { + query[0] = '\0'; + } + return rw_uri; } else { return g_strdup(uri); } -- cgit v0.9.1