Normalize URL feature should remove excess slashes. #499
This commit is contained in:
parent
430302f1de
commit
f00327a70d
@ -133,11 +133,17 @@ Main =
|
|||||||
ImageCommon.addControls video
|
ImageCommon.addControls video
|
||||||
return
|
return
|
||||||
|
|
||||||
if Conf['Normalize URL'] and g.VIEW is 'thread'
|
if Conf['Normalize URL']
|
||||||
pathname = location.pathname.split /\/+/
|
pathname = location.pathname.split /\/+/
|
||||||
if pathname[2] isnt 'thread' or pathname.length > 4
|
switch g.VIEW
|
||||||
pathname[2] = 'thread'
|
when 'thread'
|
||||||
history.replaceState null, '', "#{location.protocol}//#{location.host}#{pathname[0...4].join('/')}#{location.hash}"
|
pathname[2] = 'thread'
|
||||||
|
pathname = pathname[0...4]
|
||||||
|
when 'index'
|
||||||
|
pathname = pathname[0...3]
|
||||||
|
pathname = pathname.join '/'
|
||||||
|
if location.pathname isnt pathname
|
||||||
|
history.replaceState history.state, '', "#{location.protocol}//#{location.host}#{pathname}#{location.hash}"
|
||||||
|
|
||||||
# c.time 'All initializations'
|
# c.time 'All initializations'
|
||||||
for [name, feature] in Main.features
|
for [name, feature] in Main.features
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user