[epiphany] Don't show reader mode on internal pages
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Don't show reader mode on internal pages
- Date: Wed, 19 Sep 2018 01:24:25 +0000 (UTC)
commit 2607b24acdf10de54f49cf10976a9a97f4da8d72
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Tue Sep 18 20:23:39 2018 -0500
Don't show reader mode on internal pages
E.g. the incognito mode welcome screen shouldn't offer reader mode
embed/ephy-web-view.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 6b7fbbc5a..3ffb61e83 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -993,16 +993,19 @@ readability_js_finish_cb (GObject *object,
}
static gboolean
-run_readability_js (gpointer data)
+run_readability_js_if_needed (gpointer data)
{
EphyWebView *web_view = data;
- web_view->reader_js_timeout = 0;
- webkit_web_view_run_javascript_from_gresource (WEBKIT_WEB_VIEW (web_view),
- "/org/gnome/epiphany/readability.js",
- NULL,
- readability_js_finish_cb,
- web_view);
+ /* Internal pages should never receive reader mode. */
+ if (!ephy_embed_utils_is_no_show_address (web_view->address)) {
+ web_view->reader_js_timeout = 0;
+ webkit_web_view_run_javascript_from_gresource (WEBKIT_WEB_VIEW (web_view),
+ "/org/gnome/epiphany/readability.js",
+ NULL,
+ readability_js_finish_cb,
+ web_view);
+ }
return G_SOURCE_REMOVE;
}
@@ -1929,7 +1932,7 @@ load_changed_cb (WebKitWebView *web_view,
view->reader_loading = FALSE;
if (!view->reader_active)
- view->reader_js_timeout = g_idle_add (run_readability_js, web_view);
+ view->reader_js_timeout = g_idle_add (run_readability_js_if_needed, web_view);
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]