[epiphany] ephy-session: Save the pending API request URL if EphyWebView address is about:blank



commit 1d987830127f42ab6a93fe031f84027606e2b324
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Mon Feb 22 11:44:42 2016 +0100

    ephy-session: Save the pending API request URL if EphyWebView address is about:blank
    
    EphyWebView address is NULL (returned as about:blank) between the
    load_url() and the WEBKIT_LOAD_STARTED event, but WebKitWebView knows
    the pending API request URL. So use that to prevent losing the URL if
    the browser is closed before the WEBKIT_LOAD_STARTED event. This usually
    happens when the UI process crashes early, right after the session is
    loaded but before restored pages have started loading.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747860

 src/ephy-session.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-session.c b/src/ephy-session.c
index f1b5b89..2b1601e 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -595,6 +595,13 @@ session_tab_new (EphyEmbed *embed,
        {
                session_tab->url = g_strconcat ("about", address + EPHY_ABOUT_SCHEME_LEN, NULL);
        }
+       else if (g_str_equal (address, "about:blank"))
+       {
+               /* EphyWebView address is NULL between load_uri() and WEBKIT_LOAD_STARTED,
+                * but WebKitWebView knows the pending API request URL, so use that instead of about:blank.
+                */
+               session_tab->url = g_strdup (webkit_web_view_get_uri (WEBKIT_WEB_VIEW (web_view)));
+       }
        else
        {
                session_tab->url = g_strdup (address);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]