From 5ee22c30f62082bd1aa5e34e690e9cd2d2fc2090 Mon Sep 17 00:00:00 2001 From: setnes Date: Sat, 7 Nov 2015 22:14:47 -0600 Subject: [PATCH] If there is no browser history, exit the slideshow by calling stop. --- js/slideshowcontrols.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/slideshowcontrols.js b/js/slideshowcontrols.js index 3dead6e2e9..b0553d3b0b 100644 --- a/js/slideshowcontrols.js +++ b/js/slideshowcontrols.js @@ -347,11 +347,11 @@ _exit: function () { // Only modern browsers can manipulate history - if (history && history.replaceState) { + if (history && history.replaceState && window.history.length > 1) { // We simulate a click on the back button in order to be consistent window.history.back(); } else { - // For ancient browsers supported in core + // There is no history to go back to. this.stop(); } },