File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727( ( ) => {
2828 const pathSegmentsToKeep = 0 ;
2929 let l = new URL ( window . location ) ;
30- if ( ! l . search . startsWith ( '?/' ) && ! l . search . startsWith ( '%3F/' ) ) {
31- const basePath = '/' + l . pathname . split ( '/' ) . slice ( 1 , 1 + pathSegmentsToKeep ) . join ( '/' ) ;
32- const restPath = l . pathname . slice ( 1 ) . split ( '/' ) . slice ( pathSegmentsToKeep ) . join ( '/' ) ;
33- const newPath = basePath + ( basePath . endsWith ( '/' ) ? '' : '/' ) + '?/' + restPath . replace ( / & / g, '~and~' ) ;
34- const newSearch = l . search ? '&' + l . search . slice ( 1 ) . replace ( / & / g, '~and~' ) : '' ;
35- l . pathname = newPath ;
36- l . search = newSearch ;
37- window . location . replace ( l . href ) ;
38- }
30+ l . replace (
31+ l . protocol + '//' + l . hostname + ( l . port ? ':' + l . port : '' ) +
32+ l . pathname . split ( '/' ) . slice ( 0 , 1 + pathSegmentsToKeep ) . join ( '/' ) + '/?/' +
33+ l . pathname . slice ( 1 ) . split ( '/' ) . slice ( pathSegmentsToKeep ) . join ( '/' ) . replace ( / & / g, '~and~' ) +
34+ ( l . search ? '&' + l . search . slice ( 1 ) . replace ( / & / g, '~and~' ) : '' ) +
35+ l . hash
36+ ) ;
3937} ) ( ) ;
4038</ script > </ head > < body > </ body > </ html >
File renamed without changes.
File renamed without changes.
Load diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 2727( ( ) => {
2828 const pathSegmentsToKeep = 0 ;
2929 let l = new URL ( window . location ) ;
30- if ( ! l . search . startsWith ( '?/' ) && ! l . search . startsWith ( '%3F/' ) ) {
31- const basePath = '/' + l . pathname . split ( '/' ) . slice ( 1 , 1 + pathSegmentsToKeep ) . join ( '/' ) ;
32- const restPath = l . pathname . slice ( 1 ) . split ( '/' ) . slice ( pathSegmentsToKeep ) . join ( '/' ) ;
33- const newPath = basePath + ( basePath . endsWith ( '/' ) ? '' : '/' ) + '?/' + restPath . replace ( / & / g, '~and~' ) ;
34- const newSearch = l . search ? '&' + l . search . slice ( 1 ) . replace ( / & / g, '~and~' ) : '' ;
35- l . pathname = newPath ;
36- l . search = newSearch ;
37- window . location . replace ( l . href ) ;
38- }
30+ l . replace (
31+ l . protocol + '//' + l . hostname + ( l . port ? ':' + l . port : '' ) +
32+ l . pathname . split ( '/' ) . slice ( 0 , 1 + pathSegmentsToKeep ) . join ( '/' ) + '/?/' +
33+ l . pathname . slice ( 1 ) . split ( '/' ) . slice ( pathSegmentsToKeep ) . join ( '/' ) . replace ( / & / g, '~and~' ) +
34+ ( l . search ? '&' + l . search . slice ( 1 ) . replace ( / & / g, '~and~' ) : '' ) +
35+ l . hash
36+ ) ;
3937} ) ( ) ;
4038</ script > </ head > < body > </ body > </ html >
You can’t perform that action at this time.
0 commit comments