[epiphany/gnome-3-34] Hide view page source context menu items when required
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-3-34] Hide view page source context menu items when required
- Date: Sun, 12 Jan 2020 02:05:17 +0000 (UTC)
commit 7e4cf2d961f8a01fc1fed1df16df89895bd659de
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sat Jan 11 20:53:33 2020 +0000
Hide view page source context menu items when required
Doesn't make sense to allow view page source when we are already on a
view source page.
Fixes #1046
(cherry picked from commit 8bf31b06dc95d4d44e116bf74c0085b4887d0411)
src/ephy-window.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index c3a4e6c1b..f3557a954 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -53,6 +53,7 @@
#include "ephy-title-box.h"
#include "ephy-title-widget.h"
#include "ephy-type-builtins.h"
+#include "ephy-view-source-handler.h"
#include "ephy-web-app-utils.h"
#include "ephy-web-view.h"
#include "ephy-zoom.h"
@@ -1509,6 +1510,7 @@ populate_context_menu (WebKitWebView *web_view,
gboolean can_search_selection = FALSE;
char *search_selection_action_name = NULL;
const char *selected_text = NULL;
+ const char *uri = NULL;
window_action_group = gtk_widget_get_action_group (GTK_WIDGET (window),
"win");
@@ -1767,8 +1769,12 @@ populate_context_menu (WebKitWebView *web_view,
webkit_context_menu_append (context_menu,
webkit_context_menu_item_new_separator ());
- add_action_to_context_menu (context_menu, window_action_group,
- "page-source", window);
+ uri = webkit_web_view_get_uri (web_view);
+ if (uri && !strstr (uri, EPHY_VIEW_SOURCE_SCHEME)) {
+ add_action_to_context_menu (context_menu, window_action_group,
+ "page-source", window);
+ }
+
webkit_context_menu_append (context_menu,
webkit_context_menu_item_new_from_stock_action
(WEBKIT_CONTEXT_MENU_ACTION_INSPECT_ELEMENT));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]