diff options
author | Milkey Mouse <milkeymouse@meme.institute> | 2019-02-20 11:12:45 -0800 |
---|---|---|
committer | Milkey Mouse <milkeymouse@meme.institute> | 2019-02-20 11:12:45 -0800 |
commit | 7ea2bd138998bba21fd1ce0f6abbf753d77121ec (patch) | |
tree | 4872f77ce9a4a302e329106fa64d41e626c2b1f4 | |
parent | 091bd2bd79d6f3ac66ac6f3ed48ed96b2976570a (diff) |
Only modify window.location when redirecting (fixes #4133)
window.location.pathname = window.location.pathname can trigger a redirect,
which created a refresh loop in usage.html.
-rw-r--r-- | docs/usage.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/usage.rst b/docs/usage.rst index 6f457b2b9..f6e0113ee 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -17,7 +17,10 @@ Usage // Redirect to general docs if(hash == "") { - window.location.pathname = window.location.pathname.replace("usage.html", "usage/general.html"); + var replaced = window.location.pathname.replace("usage.html", "usage/general.html"); + if (replaced != window.location.pathname) { + window.location.pathname = replaced; + } } // Fixup anchored links from when usage.html contained all the commands else if(hash.startsWith("borg-key") || hash == "borg-change-passphrase") { |