aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/urlState.js
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2017-08-22 00:59:51 +0200
committerGitHub <noreply@github.com>2017-08-22 00:59:51 +0200
commit721f7cc92ecdeb03b3f507077e7ef29d48d833ca (patch)
tree612d332d0ef2aac63cde2b00b5bef73d3696f61e /web/src/js/urlState.js
parent7e154171bffbe30c990dd4a522bc65a3a72f2975 (diff)
parentbf243244ce3b0c88170484444ce340129b984dee (diff)
downloadmitmproxy-721f7cc92ecdeb03b3f507077e7ef29d48d833ca.tar.gz
mitmproxy-721f7cc92ecdeb03b3f507077e7ef29d48d833ca.tar.bz2
mitmproxy-721f7cc92ecdeb03b3f507077e7ef29d48d833ca.zip
Merge pull request #2540 from mhils/relatively-static
Make it possible to run static viewer in subdirectories
Diffstat (limited to 'web/src/js/urlState.js')
-rw-r--r--web/src/js/urlState.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/web/src/js/urlState.js b/web/src/js/urlState.js
index 7802bdb8..d9c50c03 100644
--- a/web/src/js/urlState.js
+++ b/web/src/js/urlState.js
@@ -72,8 +72,12 @@ export function updateUrlFromStore(store) {
if (queryStr) {
url += "?" + queryStr
}
+ let pathname = window.location.pathname
+ if(pathname === "blank") {
+ pathname = "/" // this happens in tests...
+ }
if (window.location.hash.substr(1) !== url) {
- history.replaceState(undefined, "", `/#${url}`)
+ history.replaceState(undefined, "", `${pathname}#${url}`)
}
}