File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,15 @@ function parseUrl(tab) {
17
17
tab . url = window . location . protocol + "//" + window . location . hostname + tab . url ;
18
18
} else if ( / .* \/ $ / . test ( window . location . href ) ) {
19
19
// else if starts with any other character then if ends in / append to current level
20
- tab . url = window . location . href + "/" + tab . url ;
21
- } else {
22
- // else lose last bit until / and append to current level
20
+ tab . url = window . location . href + tab . url ;
21
+ } else if ( / ^ . * [ ^ / ] + \. [ ^ . / ] + $ / . test ( window . location . href ) ) {
22
+ // else if ends in a file, lose last bit until / and append to current level
23
23
var str = window . location . href . split ( "/" ) ;
24
24
str . pop ( ) ;
25
25
tab . url = str . join ( "/" ) + "/" + tab . url ;
26
+ } else {
27
+ // else doesn't end in / so append / and relative url
28
+ tab . url = window . location . href + "/" + tab . url ;
26
29
}
27
30
}
28
31
You can’t perform that action at this time.
0 commit comments