Add 'Redirect to HTTPS' setting and turn it on by default. #885

This commit is contained in:
ccd0 2017-07-15 03:05:26 -07:00
parent 4eb41ad88a
commit fddcb8a7f7
2 changed files with 7 additions and 0 deletions

View File

@ -1,6 +1,10 @@
Config =
main:
'Miscellaneous':
'Redirect to HTTPS': [
true
'Redirect to the HTTPS version of 4chan.'
]
'JSON Index': [
true
'Replace the original board index with one supporting searching, sorting, infinite scrolling, and a catalog mode.'

View File

@ -71,6 +71,9 @@ Main =
items[key] = undefined for key of Conf
items['previousversion'] = undefined
($.getSync or $.get) items, (items) ->
if (items['Redirect to HTTPS'] ? Conf['Redirect to HTTPS']) and location.protocol isnt 'https:'
location.protocol = 'https:'
return
$.asap docSet, ->
# Don't hide the local storage warning behind a settings panel.