From b19444c29d6c205c444cd040c88a289daaedc62a Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 29 Sep 2017 04:33:16 -0400 Subject: MqTabChrome: Rewrite "about:" URIs --- (limited to 'src/tab-chrome.c') diff --git a/src/tab-chrome.c b/src/tab-chrome.c index dac1340..3fc8674 100644 --- a/src/tab-chrome.c +++ b/src/tab-chrome.c @@ -297,8 +297,18 @@ stop_reload_clicked_cb(GtkToolButton __attribute__((unused)) *toolbutton, static void uri_activate_cb(GtkEntry *entry, MqTabChrome *chrome) { - webkit_web_view_load_uri(chrome->web_view, - gtk_entry_get_text(GTK_ENTRY(entry))); + const gchar *uri; + gchar *rw_uri; + + uri = gtk_entry_get_text(GTK_ENTRY(entry)); + + if (g_str_has_prefix(uri, "about:")) { + rw_uri = g_strconcat("mq-about:", uri + strlen("about:"), NULL); + webkit_web_view_load_uri(chrome->web_view, rw_uri); + g_free(rw_uri); + } else { + webkit_web_view_load_uri(chrome->web_view, uri); + } } static void -- cgit v0.9.1