File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
templates/default/fulldoc/html Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 55 < title > <%= options . title %> </ title >
66</ head >
77< script type ="text/javascript ">
8- var match = decodeURIComponent ( window . location . hash ) . match ( / ^ # ! ( .+ ) / ) ;
9- var name = match ? match [ 1 ] : '<%= url_for_main %> ' ;
10- name = name . replace ( / ^ ( ( \w * ) : ) ? [ \/ \\ ] * / gm, '' ) . trim ( ) ;
11- window . top . location . replace ( name )
8+ var mainUrl = '<%= url_for_main %> ' ;
9+ try {
10+ var match = decodeURIComponent ( window . location . hash ) . match ( / ^ # ! ( .+ ) / ) ;
11+ var name = match ? match [ 1 ] : mainUrl ;
12+ var url = new URL ( name , location . href ) ;
13+ window . top . location . replace ( url . origin === location . origin ? name : mainUrl ) ;
14+ } catch ( e ) {
15+ window . top . location . replace ( mainUrl ) ;
16+ }
1217</ script >
1318< noscript >
1419 < h1 > Oops!</ h1 >
You can’t perform that action at this time.
0 commit comments