From 4e101e240cbb048417f5351082eabb027052d9e2 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 5 May 2014 21:51:54 +0100 Subject: [PATCH] Suppress history when changing the permalink URL --- core/modules/startup/story.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/modules/startup/story.js b/core/modules/startup/story.js index c6d9d8cf5..47102ceac 100644 --- a/core/modules/startup/story.js +++ b/core/modules/startup/story.js @@ -113,7 +113,8 @@ function updateLocationHash() { $tw.locationHash = "#" + encodeURIComponent(targetTiddler) + ":" + encodeURIComponent($tw.utils.stringifyList(storyList)); // Only change the location hash if we must, thus avoiding unnecessary onhashchange events if($tw.utils.getLocationHash() !== $tw.locationHash) { - window.location.hash = $tw.locationHash; + // We use replace so that browser history isn't affected + window.location.replace(window.location.toString().split("#")[0] + $tw.locationHash); } }