Disable 'Redirect to HTTPS' on platforms where we use localStorage for saving settings.

This commit is contained in:
ccd0 2017-08-10 06:38:34 -07:00
parent 59b64a2a20
commit f18388c20a
3 changed files with 9 additions and 2 deletions

View File

@ -162,8 +162,12 @@ Settings =
addCheckboxes fs, obj
$.add section, fs
addCheckboxes $('div[data-name="JSON Index"] > .suboption-list', section), Config.Index
# Unsupported options
if $.engine isnt 'gecko'
$('div[data-name="Remember QR Size"]', section).hidden = true # XXX not supported
$('div[data-name="Remember QR Size"]', section).hidden = true
if $.perProtocolSettings
$('div[data-name="Redirect to HTTPS"]', section).hidden = true
$.get items, (items) ->
for key, val of items

View File

@ -72,7 +72,7 @@ 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:'
if !$.perProtocolSettings and (items['Redirect to HTTPS'] ? Conf['Redirect to HTTPS']) and location.protocol isnt 'https:'
location.replace('https:' + location.host + location.pathname + location.search + location.hash)
return
$.asap docSet, ->

View File

@ -510,6 +510,9 @@ $.GM_deleteValue = (key) ->
delete $.currentValue[key]
GM_deleteValue key
unless GM_deleteValue?
$.perProtocolSettings = true
if GM_deleteValue?
$.getValue = $.GM_getValue
$.listValues = -> GM_listValues() # error when called if missing