From bab53ac616646ef9cda01377c4516a473c5f6582 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 30 Oct 2017 12:57:58 -0400 Subject: mq_web_view_*_scheme_methods->match_uri(): New methods --- (limited to 'src/web-view-schemes/normal.c') diff --git a/src/web-view-schemes/normal.c b/src/web-view-schemes/normal.c index 4da54cc..0d96fea 100644 --- a/src/web-view-schemes/normal.c +++ b/src/web-view-schemes/normal.c @@ -528,6 +528,14 @@ save_html_replace_cb(GFile *file, GAsyncResult *result, guchar *data) g_free(data); } +static gboolean +match_uri(const gchar *uri) +{ + /* This is a catch-all scheme handler, so match any schemes not handled + * by another handler. */ + return !g_str_has_prefix(uri, "view-source:"); +} + static void save_html_get_data_cb(WebKitWebResource *resource, GAsyncResult *result, MqWebView *web_view) @@ -770,6 +778,7 @@ save_file(MqWebView *web_view, MqWebViewScheme *scheme) } const MqWebViewSchemeMethods mq_web_view_normal_scheme_methods = { + .match_uri = match_uri, .finalize = finalize, .rewrite_uri = rewrite_uri, .display_uri = display_uri, -- cgit v0.9.1