summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-31 02:03:00 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-31 02:03:00 (EDT)
commitac5cb15280deee617b01daf6455c2c87a28a0fe0 (patch)
tree453c0d09ce5658023babb50982163cc961be8df0
parent3f5f19387218f22c7a0f4c2135d06134ab1d0da8 (diff)
downloadmarquee-ac5cb15280deee617b01daf6455c2c87a28a0fe0.zip
marquee-ac5cb15280deee617b01daf6455c2c87a28a0fe0.tar.gz
marquee-ac5cb15280deee617b01daf6455c2c87a28a0fe0.tar.bz2
view-source: Show origin URI in title
-rw-r--r--src/view-source.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/view-source.c b/src/view-source.c
index 71d3438..3c46127 100644
--- a/src/view-source.c
+++ b/src/view-source.c
@@ -50,7 +50,8 @@ static const gchar *document =
"</html>\n";
static void
-respond(WebKitURISchemeRequest *request, guchar *data, gsize length)
+respond(WebKitURISchemeRequest *request, const gchar *uri, guchar *data,
+ gsize length)
{
gchar *escaped_data;
GInputStream *stream;
@@ -61,7 +62,7 @@ respond(WebKitURISchemeRequest *request, guchar *data, gsize length)
g_strdup_printf(document,
gtk_widget_get_default_direction() ==
GTK_TEXT_DIR_RTL ? "rtl" : "ltr",
- "TODO", escaped_data), -1, g_free);
+ uri, escaped_data), -1, g_free);
webkit_uri_scheme_request_finish(request, stream, -1, "text/html");
g_object_unref(stream);
@@ -75,7 +76,7 @@ data_cb(MqWebView *web_view, GParamSpec G_GNUC_UNUSED *param_spec,
gsize length;
data = mq_web_view_get_data(web_view, &length);
- respond(data_signal_data->request, data, length);
+ respond(data_signal_data->request, data_signal_data->uri, data, length);
g_signal_handler_disconnect(web_view, data_signal_data->handler_id);
g_free(data_signal_data->uri);
g_free(data_signal_data);
@@ -111,7 +112,7 @@ mq_view_source_request(WebKitURISchemeRequest *request,
/* Get origin tab's data. */
data = mq_web_view_get_data(origin_web_view, &length);
if (data) {
- respond(request, data, length);
+ respond(request, uri, data, length);
} else {
data_signal_data = g_new(DataSignalData, 1);
data_signal_data->request = request;