Browse Source

b=580282, r=mfinkle, Uncaught exception (nsIWebNavigation.canGoBack) in console

matthew.gertner@gmail.com 14 years ago
parent
commit
c9114f0c2d
1 changed files with 11 additions and 2 deletions
  1. 11 2
      chrome/content/webrunner.js

+ 11 - 2
chrome/content/webrunner.js

@@ -1079,8 +1079,17 @@ var WebRunner = {
     var back = document.getElementById("cmd_back");
     var forward = document.getElementById("cmd_forward");
 
-    back.setAttribute("disabled", !browser.canGoBack);
-    forward.setAttribute("disabled", !browser.canGoForward);
+    try {
+      var canGoBack = browser.canGoBack;
+      var canGoForward = browser.canGoForward;
+    }
+    catch(e) {
+      canGoBack = false;
+      canGoForward = false;
+    }
+
+    back.setAttribute("disabled", !canGoBack);
+    forward.setAttribute("disabled", !canGoForward);
   },
 
   // This method is called to indicate a status changes for the currently