From 5b8646ffce5287f56f68c28bf87a219081131528 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 08 Nov 2017 15:05:46 -0500 Subject: mq_web_view_normal_scheme_methods: Don't handle "about"/"mq-about" scheme --- (limited to 'src/web-view-schemes/normal.c') diff --git a/src/web-view-schemes/normal.c b/src/web-view-schemes/normal.c index 3a2313e..fb41ce9 100644 --- a/src/web-view-schemes/normal.c +++ b/src/web-view-schemes/normal.c @@ -1,5 +1,5 @@ /* - * Web view members and methods for normal schemes (http, https, file, about) + * Web view members and methods for normal schemes (http, https, file) * * Copyright (C) 2017 Patrick McDermott * @@ -41,7 +41,9 @@ match_uri(const gchar *uri) { /* This is a catch-all scheme handler, so match any schemes not handled * by another handler. */ - return !uri || !g_str_has_prefix(uri, "view-source:"); + return !uri || (!g_str_has_prefix(uri, "view-source:") && + !g_str_has_prefix(uri, "about:") && + !g_str_has_prefix(uri, "mq-about:")); } static void @@ -76,30 +78,14 @@ static gchar * rewrite_uri(MqWebView G_GNUC_UNUSED *web_view, MqWebViewScheme G_GNUC_UNUSED *scheme, const gchar *uri) { - if (g_str_has_prefix(uri, "about:")) { - return g_strconcat("mq-about:", uri + strlen("about:"), NULL); - } else { - return g_strdup(uri); - } + return g_strdup(uri); } 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:")) { - 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); - } + return g_strdup(uri); } #define WKCMA(ACTION) \ -- cgit v0.9.1