Browse Source

Fix rare tab restore error

Frank-Rainer Grahl 7 months ago
parent
commit
e7cc6af1e4
2 changed files with 35 additions and 0 deletions
  1. 34 0
      comm-release/patches/1885748-brokentab-25319.patch
  2. 1 0
      comm-release/patches/series

+ 34 - 0
comm-release/patches/1885748-brokentab-25319.patch

@@ -0,0 +1,34 @@
+# HG changeset patch
+# User Nuno Silva <nunojsg@gmail.com>
+# Date 1710615322 -3600
+# Parent  633fb46707fd3683e5512378c887c9b44bfbba50
+Bug 1885748 - Catch webNavigation error during tab restore. r=frg a=frg
+
+diff --git a/suite/browser/tabbrowser.xml b/suite/browser/tabbrowser.xml
+--- a/suite/browser/tabbrowser.xml
++++ b/suite/browser/tabbrowser.xml
+@@ -1944,17 +1944,23 @@
+             var hist = savedData.browserData.history;
+ 
+             this.tabContainer.appendChild(t);
+             if (t.previousSibling.selected)
+               t.setAttribute("afterselected", true);
+ 
+             // navigate back to the proper page from the light page
+             b.stop();
+-            b.webNavigation.gotoIndex(0);
++            try {
++              b.webNavigation.gotoIndex(0);
++            } catch (e) {
++              // Might happen if the to be restored tag contains an invalid
++              // navigation scheme.
++              Cu.reportError(e);
++           }
+ 
+             // reattach the old history
+             b.webNavigation.sessionHistory = hist;
+ 
+             // add back the filters, security first (bug 313335)
+             var secFlags = Ci.nsIWebProgress.NOTIFY_STATE_ALL |
+                            Ci.nsIWebProgress.NOTIFY_LOCATION |
+                            Ci.nsIWebProgress.NOTIFY_SECURITY;

+ 1 - 0
comm-release/patches/series

@@ -2148,3 +2148,4 @@ TOP-1872623-cancelbookmark-25319.patch
 1877001-port1407891-25319.patch
 1879726-port1398229-25319.patch
 1445374-61a1.patch
+1885748-brokentab-25319.patch