summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/web-view-schemes/normal.c26
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) \