Add primitive Private Browsing based on Midori web app mode
Essentially it's just an instance of Midori that doesn't load or write any preferences or personal data. The main drawback is that it doesn't load any extensions either.
This commit is contained in:
parent
ff2e042898
commit
18ec1f25cb
2 changed files with 18 additions and 11 deletions
|
@ -2165,6 +2165,15 @@ _action_tab_new_activate (GtkAction* action,
|
||||||
midori_browser_set_current_page (browser, n);
|
midori_browser_set_current_page (browser, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_action_private_browsing_activate (GtkAction* action,
|
||||||
|
MidoriBrowser* browser)
|
||||||
|
{
|
||||||
|
const gchar* uri = midori_browser_get_current_uri (browser);
|
||||||
|
/* FIXME: Use the same binary that is running right now */
|
||||||
|
sokoke_spawn_program ("midori -a", uri, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_action_open_activate (GtkAction* action,
|
_action_open_activate (GtkAction* action,
|
||||||
MidoriBrowser* browser)
|
MidoriBrowser* browser)
|
||||||
|
@ -3033,14 +3042,13 @@ _action_compact_menu_populate_popup (GtkAction* action,
|
||||||
static const GtkActionEntry actions[] = {
|
static const GtkActionEntry actions[] = {
|
||||||
{ "TabNew" },
|
{ "TabNew" },
|
||||||
{ "WindowNew" },
|
{ "WindowNew" },
|
||||||
|
{ "PrivateBrowsing" },
|
||||||
{ "Open" },
|
{ "Open" },
|
||||||
#if HAVE_HILDON
|
#if HAVE_HILDON
|
||||||
{ "Find" },
|
{ "Find" },
|
||||||
#else
|
#else
|
||||||
{ "Print" },
|
{ "Print" },
|
||||||
{ "About" },
|
{ "About" },
|
||||||
{ "PrivateBrowsing" },
|
|
||||||
{ "ManageSearchEngines" },
|
|
||||||
{ NULL },
|
{ NULL },
|
||||||
{ "Menubar" },
|
{ "Menubar" },
|
||||||
{ "Bookmarkbar" },
|
{ "Bookmarkbar" },
|
||||||
|
@ -4888,6 +4896,10 @@ static const GtkActionEntry entries[] = {
|
||||||
{ "TabNew", STOCK_TAB_NEW,
|
{ "TabNew", STOCK_TAB_NEW,
|
||||||
NULL, "<Ctrl>t",
|
NULL, "<Ctrl>t",
|
||||||
N_("Open a new tab"), G_CALLBACK (_action_tab_new_activate) },
|
N_("Open a new tab"), G_CALLBACK (_action_tab_new_activate) },
|
||||||
|
{ "PrivateBrowsing", NULL,
|
||||||
|
N_("P_rivate Browsing"), "<Ctrl><Shift>n",
|
||||||
|
N_("Don't save any private data while browsing"),
|
||||||
|
G_CALLBACK (_action_private_browsing_activate), },
|
||||||
{ "Open", GTK_STOCK_OPEN,
|
{ "Open", GTK_STOCK_OPEN,
|
||||||
NULL, "<Ctrl>o",
|
NULL, "<Ctrl>o",
|
||||||
N_("Open a file"), G_CALLBACK (_action_open_activate) },
|
N_("Open a file"), G_CALLBACK (_action_open_activate) },
|
||||||
|
@ -5058,12 +5070,6 @@ static const GtkActionEntry entries[] = {
|
||||||
static const guint entries_n = G_N_ELEMENTS (entries);
|
static const guint entries_n = G_N_ELEMENTS (entries);
|
||||||
|
|
||||||
static const GtkToggleActionEntry toggle_entries[] = {
|
static const GtkToggleActionEntry toggle_entries[] = {
|
||||||
{ "PrivateBrowsing", NULL,
|
|
||||||
N_("P_rivate Browsing"), "",
|
|
||||||
N_("Don't save any private data while browsing"),
|
|
||||||
NULL/*G_CALLBACK (_action_private_browsing_activate)*/,
|
|
||||||
FALSE },
|
|
||||||
|
|
||||||
{ "Menubar", NULL,
|
{ "Menubar", NULL,
|
||||||
N_("_Menubar"), "",
|
N_("_Menubar"), "",
|
||||||
N_("Show menubar"), G_CALLBACK (_action_menubar_activate),
|
N_("Show menubar"), G_CALLBACK (_action_menubar_activate),
|
||||||
|
@ -5215,6 +5221,7 @@ static const gchar* ui_markup =
|
||||||
"<menu action='File'>"
|
"<menu action='File'>"
|
||||||
"<menuitem action='WindowNew'/>"
|
"<menuitem action='WindowNew'/>"
|
||||||
"<menuitem action='TabNew'/>"
|
"<menuitem action='TabNew'/>"
|
||||||
|
"<menuitem action='PrivateBrowsing'/>"
|
||||||
"<separator/>"
|
"<separator/>"
|
||||||
"<menuitem action='Open'/>"
|
"<menuitem action='Open'/>"
|
||||||
"<separator/>"
|
"<separator/>"
|
||||||
|
@ -5226,7 +5233,6 @@ static const gchar* ui_markup =
|
||||||
"<menuitem action='WindowClose'/>"
|
"<menuitem action='WindowClose'/>"
|
||||||
"<separator/>"
|
"<separator/>"
|
||||||
"<menuitem action='Print'/>"
|
"<menuitem action='Print'/>"
|
||||||
"<menuitem action='PrivateBrowsing'/>"
|
|
||||||
"<separator/>"
|
"<separator/>"
|
||||||
"<menuitem action='Quit'/>"
|
"<menuitem action='Quit'/>"
|
||||||
"</menu>"
|
"</menu>"
|
||||||
|
@ -5856,8 +5862,6 @@ midori_browser_init (MidoriBrowser* browser)
|
||||||
g_signal_connect (forward, "button-press-event",
|
g_signal_connect (forward, "button-press-event",
|
||||||
G_CALLBACK (midori_browser_menu_item_middle_click_event_cb), browser);
|
G_CALLBACK (midori_browser_menu_item_middle_click_event_cb), browser);
|
||||||
|
|
||||||
|
|
||||||
_action_set_visible (browser, "PrivateBrowsing", FALSE);
|
|
||||||
#if HAVE_HILDON
|
#if HAVE_HILDON
|
||||||
_action_set_visible (browser, "Menubar", FALSE);
|
_action_set_visible (browser, "Menubar", FALSE);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2037,6 +2037,9 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view,
|
||||||
menuitem = sokoke_action_create_popup_menu_item (
|
menuitem = sokoke_action_create_popup_menu_item (
|
||||||
gtk_action_group_get_action (actions, "Fullscreen"));
|
gtk_action_group_get_action (actions, "Fullscreen"));
|
||||||
gtk_menu_shell_append (menu_shell, menuitem);
|
gtk_menu_shell_append (menu_shell, menuitem);
|
||||||
|
menuitem = sokoke_action_create_popup_menu_item (
|
||||||
|
gtk_action_group_get_action (actions, "PrivateBrowsing"));
|
||||||
|
gtk_menu_shell_append (menu_shell, menuitem);
|
||||||
#else
|
#else
|
||||||
gtk_menu_shell_append (menu_shell, gtk_separator_menu_item_new ());
|
gtk_menu_shell_append (menu_shell, gtk_separator_menu_item_new ());
|
||||||
menuitem = sokoke_action_create_popup_menu_item (
|
menuitem = sokoke_action_create_popup_menu_item (
|
||||||
|
|
Loading…
Reference in a new issue