diff --git a/src/config/Config.coffee b/src/config/Config.coffee index df0d794d1..ee3acf987 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -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.' diff --git a/src/main/Main.coffee b/src/main/Main.coffee index bc8037d9e..206581fab 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -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.