tags 402177 patch thanks Mike Hommey <[EMAIL PROTECTED]> wrote: > It's almost impossible to filter out stuff that is not needed by > epiphany.
Alright, thanks for the explanation. > Use the -n argument to epiphany Which, as ^N, opens a new tab containing the homepage. What I'd like is a way to open a new tab, with a blank page (whereas I've a homepage set). Josselin Mouette <[EMAIL PROTECTED]> wrote: > Furthermore, upstream is not willing to change this behavior: > http://bugzilla.gnome.org/show_bug.cgi?id=312883 I'm posting the attached patch there too, as agreed on IRC. It implements the option through a gconf key: /apps/epiphany/general/load_on_new_tab which is defaulted to 1 (in the schema), so that it doesn't break the default behaviour (upstream/GNOME's goal is to avoid blank pages to be displayed, in short words). One is then able to get the proposed behaviour by running: gconftool-2 -s /apps/epiphany/general/load_on_new_tab 0 --type int Cheers, -- Cyril Brulebois
--- epiphany-browser-2.14.3.orig/src/ephy-shell.c 2006-12-09 18:35:46.000000000 +0100 +++ epiphany-browser-2.14.3/src/ephy-shell.c 2006-12-09 18:51:10.000000000 +0100 @@ -529,14 +529,45 @@ gtk_window_fullscreen (GTK_WINDOW (window)); } - if (flags & EPHY_NEW_TAB_HOME_PAGE || - flags & EPHY_NEW_TAB_NEW_PAGE) + if (flags & EPHY_NEW_TAB_HOME_PAGE) { ephy_tab_set_typed_address (tab, "", EPHY_TAB_ADDRESS_EXPIRE_NEXT); ephy_toolbar_activate_location (toolbar); is_empty = load_homepage (embed); } + else if (flags & EPHY_NEW_TAB_NEW_PAGE) + { + /* Simulate mozilla's browser.tabs.loadOnNewTab option through + * a gconf option. + * + * Documentation at: http://kb.mozillazine.org/About:config_entries + * + * To ensure that no blank page is displayed by default, this key + * is set to 1 by default in the schema (see data/epiphany.schema.in) + */ + int load_on_new_tab = eel_gconf_get_integer (CONF_BROWSER_TABS_LOADONNEWTAB); + + switch (load_on_new_tab) + { + case 0: /* Blank page */ + ephy_embed_load_url (embed, "about:blank"); + is_empty = url_is_empty ("about:blank"); + break; + + case 2: /* Last visited */ + /* NOT IMPLEMENTED */ + + case -1: /* Start-up page */ + case 1: /* Homepage */ + default: + /* Same as in the previous 'if' test */ + ephy_tab_set_typed_address (tab, "", + EPHY_TAB_ADDRESS_EXPIRE_NEXT); + ephy_toolbar_activate_location (toolbar); + is_empty = load_homepage (embed); + } + } else if (flags & EPHY_NEW_TAB_OPEN_PAGE) { g_assert (url != NULL); --- epiphany-browser-2.14.3.orig/lib/ephy-prefs.h 2006-12-09 18:35:46.000000000 +0100 +++ epiphany-browser-2.14.3/lib/ephy-prefs.h 2006-12-09 18:36:37.000000000 +0100 @@ -37,6 +37,7 @@ #define CONF_AUTO_DOWNLOADS "/apps/epiphany/general/automatic_downloads" #define CONF_DESKTOP_IS_HOME_DIR "/apps/nautilus/preferences/desktop_is_home_dir" #define CONF_NETWORK_MANAGED "/apps/epiphany/general/managed_network" +#define CONF_BROWSER_TABS_LOADONNEWTAB "/apps/epiphany/general/load_on_new_tab" /* i18n pref */ #define CONF_GECKO_ENABLE_PANGO "/apps/epiphany/web/enable_pango" --- epiphany-browser-2.14.3.orig/data/epiphany.schemas.in 2006-12-09 18:35:46.000000000 +0100 +++ epiphany-browser-2.14.3/data/epiphany.schemas.in 2006-12-09 18:43:47.000000000 +0100 @@ -168,6 +168,21 @@ </locale> </schema> <schema> + <key>/schemas/apps/epiphany/general/load_on_new_tab</key> + <applyto>/apps/epiphany/general/load_on_new_tab</applyto> + <owner>epiphany</owner> + <type>int</type> + <default>1</default> + <locale name="C"> + <short>Page to open when opening a new tab</short> + <long>Page to open when opening a new tab. Allowed values are -1 + (browser startup page), 0 (blank page), 1 (homepage), 2 (last visited + page), as defined for mozilla's browser.tab.loadOnNewTab about:config + option. Both -1 and 1 are implemented the same way; 2 is not + implemented.</long> + </locale> + </schema> + <schema> <key>/schemas/apps/epiphany/general/show_bookmarks_bar</key> <applyto>/apps/epiphany/general/show_bookmarks_bar</applyto> <owner>epiphany</owner>
pgpy7qPTz4UpU.pgp
Description: PGP signature