diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-08 15:05:46 (EST) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-08 15:05:46 (EST) |
commit | 5b8646ffce5287f56f68c28bf87a219081131528 (patch) | |
tree | 622883bc3c43c4aae08e3fbe0bcbdbba02a294e8 | |
parent | d3f56aef61925ded910612c402caed2d2794546d (diff) | |
download | marquee-5b8646ffce5287f56f68c28bf87a219081131528.zip marquee-5b8646ffce5287f56f68c28bf87a219081131528.tar.gz marquee-5b8646ffce5287f56f68c28bf87a219081131528.tar.bz2 |
mq_web_view_normal_scheme_methods: Don't handle "about"/"mq-about" scheme
-rw-r--r-- | src/web-view-schemes/normal.c | 26 |
1 files changed, 6 insertions, 20 deletions
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) \ |