Bug 1564094 - Follow-up: With history enabled, check that back/forward buttons are there. r=aceman a=jorgk BETA_68_CONTINUATION
authorJorg K <jorgk@jorgk.com>
Sun, 14 Jul 2019 00:09:48 +0200
branchBETA_68_CONTINUATION
changeset 36084 1cae59747a9a62a7bb9609cea72357b06057e821
parent 36083 bbc19c7449026616efc289158a968da7b3e7b390
child 36085 3820464b6b6978ce7e8f49e8dc6d545918ab5e21
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersaceman, jorgk
bugs1564094
Bug 1564094 - Follow-up: With history enabled, check that back/forward buttons are there. r=aceman a=jorgk
common/src/viewSource.js
--- a/common/src/viewSource.js
+++ b/common/src/viewSource.js
@@ -567,25 +567,29 @@ ViewSourceChrome.prototype = {
 
   /**
    * Updates any applicable commands.
    */
   updateCommands() {
     let backCommand = document.getElementById("Browser:Back");
     let forwardCommand = document.getElementById("Browser:Forward");
 
-    if (this.webNav.canGoBack) {
-      backCommand.removeAttribute("disabled");
-    } else {
-      backCommand.setAttribute("disabled", "true");
+    if (backCommand) {
+      if (this.webNav.canGoBack) {
+        backCommand.removeAttribute("disabled");
+      } else {
+        backCommand.setAttribute("disabled", "true");
+      }
     }
-    if (this.webNav.canGoForward) {
-      forwardCommand.removeAttribute("disabled");
-    } else {
-      forwardCommand.setAttribute("disabled", "true");
+    if (forwardCommand) {
+      if (this.webNav.canGoForward) {
+        forwardCommand.removeAttribute("disabled");
+      } else {
+        forwardCommand.setAttribute("disabled", "true");
+      }
     }
   },
 
   /**
    * Reloads the browser, bypassing the network cache.
    */
   reload() {
     this.browser.reloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY |