diff options
Diffstat (limited to 'src/tab-body.c')
-rw-r--r-- | src/tab-body.c | 25 |
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; } |