aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-shell.c
diff options
context:
space:
mode:
authorGustavo Noronha Silva <gns@gnome.org>2013-02-10 02:43:02 +0800
committerGustavo Noronha Silva <gns@gnome.org>2013-02-12 23:55:51 +0800
commitce7ab1e34804d9f7529bed13267f4619c37e32d9 (patch)
tree69f2a2e2dbce017980352b1afd57e1b38c8f278b /src/ephy-shell.c
parent551eb0cec6469ece8e826411d65bf806ec043142 (diff)
downloadgsoc2013-epiphany-ce7ab1e34804d9f7529bed13267f4619c37e32d9.tar
gsoc2013-epiphany-ce7ab1e34804d9f7529bed13267f4619c37e32d9.tar.gz
gsoc2013-epiphany-ce7ab1e34804d9f7529bed13267f4619c37e32d9.tar.bz2
gsoc2013-epiphany-ce7ab1e34804d9f7529bed13267f4619c37e32d9.tar.lz
gsoc2013-epiphany-ce7ab1e34804d9f7529bed13267f4619c37e32d9.tar.xz
gsoc2013-epiphany-ce7ab1e34804d9f7529bed13267f4619c37e32d9.tar.zst
gsoc2013-epiphany-ce7ab1e34804d9f7529bed13267f4619c37e32d9.zip
Only load pages when their tab is switched to upon session restore
Firefox has led the way implementing this behaviour to improve the experience of restoring a session with lots of tabs. By delaying the loading of pages to when the user shows interest in them, the time it takes for the browser to become usable is diminished, and less pages are loaded in parallel, which improves load time for the first pages the user sees. It also has the advante of displaying less HTTP Basic Auth dialogs, when the user has many tabs pointed to the same server. https://bugzilla.gnome.org/show_bug.cgi?id=675302
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r--src/ephy-shell.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 7fd01d7de..ebdd48fd0 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -730,6 +730,7 @@ ephy_shell_new_tab_full (EphyShell *shell,
gboolean fullscreen_lockdown = FALSE;
gboolean in_new_window = TRUE;
gboolean open_page = FALSE;
+ gboolean delayed_open_page = FALSE;
gboolean jump_to = FALSE;
gboolean active_is_blank = FALSE;
gboolean copy_history = TRUE;
@@ -748,6 +749,7 @@ ephy_shell_new_tab_full (EphyShell *shell,
embed_shell = EPHY_EMBED_SHELL (shell);
if (flags & EPHY_NEW_TAB_OPEN_PAGE) open_page = TRUE;
+ if (flags & EPHY_NEW_TAB_DELAYED_OPEN_PAGE) delayed_open_page = TRUE;
if (flags & EPHY_NEW_TAB_IN_NEW_WINDOW) in_new_window = TRUE;
if (flags & EPHY_NEW_TAB_IN_EXISTING_WINDOW) in_new_window = FALSE;
if (flags & EPHY_NEW_TAB_DONT_COPY_HISTORY) copy_history = FALSE;
@@ -756,7 +758,7 @@ ephy_shell_new_tab_full (EphyShell *shell,
fullscreen_lockdown = g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
EPHY_PREFS_LOCKDOWN_FULLSCREEN);
in_new_window = in_new_window && !fullscreen_lockdown;
- g_return_val_if_fail (open_page == (gboolean)(request != NULL), NULL);
+ g_return_val_if_fail ((open_page || delayed_open_page) == (gboolean)(request != NULL), NULL);
LOG ("Opening new tab parent-window %p parent-embed %p in-new-window:%s jump-to:%s",
parent_window, previous_embed, in_new_window ? "t" : "f", jump_to ? "t" : "f");
@@ -822,7 +824,7 @@ ephy_shell_new_tab_full (EphyShell *shell,
ephy_window_activate_location (window);
ephy_web_view_load_homepage (view);
is_empty = TRUE;
- } else if (flags & EPHY_NEW_TAB_OPEN_PAGE) {
+ } else if (open_page) {
ephy_web_view_load_request (ephy_embed_get_web_view (embed),
request);
@@ -831,7 +833,8 @@ ephy_shell_new_tab_full (EphyShell *shell,
#else
is_empty = ephy_embed_utils_url_is_empty (webkit_network_request_get_uri (request));
#endif
- }
+ } else if (delayed_open_page)
+ ephy_embed_set_delayed_load_request (embed, request);
/* Make sure the initial focus is somewhere sensible and not, for
* example, on the reload button.