summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2021-03-06 14:31:30 -0600
committerMichael Catanzaro <mcatanzaro@gnome.org>2021-03-06 14:31:30 -0600
commit06ccb1a3d5225e2aa48080b614e324f09d4aca68 (patch)
treef955fa2f13fb80a9def1ce3d362a83c5b71d12e9
parent4121c31037a530a8de129e46a1affa6197368710 (diff)
downloadepiphany-mcatanzaro/pdf.tar.gz
view: avoid adding ephy-pdf URIs to history databasemcatanzaro/pdf
ephy-pdf: is an internal URI scheme and it shouldn't be showing up in the address bar dropdown or the history dialog.
-rw-r--r--embed/ephy-web-view.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 4bf68f174..1dd9ffc18 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -739,6 +739,10 @@ title_changed_cb (WebKitWebView *web_view,
if (!title && uri)
title = title_from_address = ephy_embed_utils_get_title_from_address (uri);
+ /* FIXME: we don't follow the same rules for transforming uri here that we do
+ * when adding it to the history db in load_committed. Should probably try to
+ * use EphyWebView:address instead?
+ */
if (uri && title && *title && !ephy_web_view_is_history_frozen (webview))
ephy_history_service_set_url_title (history, uri, title, NULL, NULL, NULL);
@@ -1560,6 +1564,8 @@ load_changed_cb (WebKitWebView *web_view,
/* TODO: move the normalization down to the history service? */
if (g_str_has_prefix (uri, EPHY_ABOUT_SCHEME))
history_uri = g_strdup_printf ("about:%s", uri + EPHY_ABOUT_SCHEME_LEN + 1);
+ else if (g_str_has_prefix (uri, EPHY_PDF_SCHEME))
+ history_uri = g_strdup (uri + strlen (EPHY_PDF_SCHEME) + 1);
else
history_uri = g_strdup (uri);