summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-29 04:28:58 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-29 04:37:46 (EDT)
commit3bc58cbad6e9ae2ff1a3b762653654572508571f (patch)
treee5e810a8949ec4fcd0d8df2038253083eb886cc1 /src
parentbdbcce6141fdf67a1bd1a9015b683eec8954b11d (diff)
downloadmarquee-3bc58cbad6e9ae2ff1a3b762653654572508571f.zip
marquee-3bc58cbad6e9ae2ff1a3b762653654572508571f.tar.gz
marquee-3bc58cbad6e9ae2ff1a3b762653654572508571f.tar.bz2
MqTabBody: Try again to rewrite "about:" URIs
Diffstat (limited to 'src')
-rw-r--r--src/tab-body.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/tab-body.c b/src/tab-body.c
index 46d655c..04ffcd7 100644
--- a/src/tab-body.c
+++ b/src/tab-body.c
@@ -489,6 +489,25 @@ resource_load_started_cb(WebKitWebView *web_view,
}
}
+static void
+load_changed_cb(WebKitWebView *web_view,
+ WebKitLoadEvent __attribute__((unused)) load_event)
+{
+ const gchar *uri;
+ gchar *rw_uri;
+ WebKitURIRequest *request;
+
+ uri = webkit_web_view_get_uri(web_view);
+ g_print("load-changed, uri = %s\n", uri);
+
+ if (g_str_has_prefix(uri, "about:")) {
+ rw_uri = g_strconcat("mq-about:", uri + strlen("about:"), NULL);
+ request = webkit_uri_request_new(rw_uri);
+ g_free(rw_uri);
+ webkit_web_view_load_request(web_view, request);
+ }
+}
+
MqTabBody *
mq_tab_body_new(MqTab *tab, const gchar *uri)
{
@@ -514,8 +533,10 @@ mq_tab_body_new(MqTab *tab, const gchar *uri)
G_CALLBACK(mouse_target_changed_cb), body);
g_signal_connect(body->web_view, "button-press-event",
G_CALLBACK(button_press_cb), body);
- g_signal_connect(body->web_view, "resource-load-started",
- G_CALLBACK(resource_load_started_cb), NULL);
+ //g_signal_connect(body->web_view, "resource-load-started",
+ // G_CALLBACK(resource_load_started_cb), NULL);
+ g_signal_connect(body->web_view, "load-changed",
+ G_CALLBACK(load_changed_cb), NULL);
return body;
}