summaryrefslogtreecommitdiff
path: root/help3xsl/help.html
diff options
context:
space:
mode:
authorHenrik Karlsson <hk.henrik@gmail.com>2020-11-23 17:41:37 +0100
committerOlivier Hallot <olivier.hallot@libreoffice.org>2020-11-26 12:03:03 +0100
commite95e2a6d94ac5c08d3821f3da198a7982b7d0af8 (patch)
treef3f70fad0c6d09c80368b3bd9f7f208805b1737f /help3xsl/help.html
parent51923f0e54c44e9fa8a3d35092938f5a228256fd (diff)
Update redirects to replace the url rather than navigate to a new one
Current links from outside (like the wiki) will cause excess history entries when clicking the https://help.libreoffice.org/ link, breaking the back button. See the example of the visited pages below. Ideally only the referring page and the final page should be in the history, allowing the user to navigate back. 1. https://help.libreoffice.org/Main_Page 2. https://help.libreoffice.org/ - 302 redirect 3. https://help.libreoffice.org/help.html - window.location.href 4. https://help.libreoffice.org/latest/index.html - window.location.href 5. https://help.libreoffice.org/latest/en-US/text/shared/05/new_help.html?&DbPAR=WRITER&System=UNIX The second 302 redirect is fine as it simply replaces the history. The two window.location.href assigments however should be replaced with window.location.replace. Change-Id: I6fbe7141de87c939aa816fdfc2fe5255e9792e0b Reviewed-on: https://gerrit.libreoffice.org/c/help/+/106429 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl/help.html')
-rw-r--r--help3xsl/help.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/help3xsl/help.html b/help3xsl/help.html
index df4885a674..8ee3510cf6 100644
--- a/help3xsl/help.html
+++ b/help3xsl/help.html
@@ -36,9 +36,9 @@
var version = getParameterByName("Version", url);
var query = url.substr(n + 1, url.length);
var newURL = version + '/index.html?' + query;
- window.location.href = newURL;
+ window.location.replace(newURL);
} else {
- window.location.href = 'latest/index.html';
+ window.location.replace('latest/index.html');
}
</script>
</body>