Disable 'Redirect to HTTPS' on platforms where we use localStorage for saving settings.
This commit is contained in:
parent
59b64a2a20
commit
f18388c20a
@ -162,8 +162,12 @@ Settings =
|
|||||||
addCheckboxes fs, obj
|
addCheckboxes fs, obj
|
||||||
$.add section, fs
|
$.add section, fs
|
||||||
addCheckboxes $('div[data-name="JSON Index"] > .suboption-list', section), Config.Index
|
addCheckboxes $('div[data-name="JSON Index"] > .suboption-list', section), Config.Index
|
||||||
|
|
||||||
|
# Unsupported options
|
||||||
if $.engine isnt 'gecko'
|
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) ->
|
$.get items, (items) ->
|
||||||
for key, val of items
|
for key, val of items
|
||||||
|
|||||||
@ -72,7 +72,7 @@ Main =
|
|||||||
items[key] = undefined for key of Conf
|
items[key] = undefined for key of Conf
|
||||||
items['previousversion'] = undefined
|
items['previousversion'] = undefined
|
||||||
($.getSync or $.get) items, (items) ->
|
($.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)
|
location.replace('https:' + location.host + location.pathname + location.search + location.hash)
|
||||||
return
|
return
|
||||||
$.asap docSet, ->
|
$.asap docSet, ->
|
||||||
|
|||||||
@ -510,6 +510,9 @@ $.GM_deleteValue = (key) ->
|
|||||||
delete $.currentValue[key]
|
delete $.currentValue[key]
|
||||||
GM_deleteValue key
|
GM_deleteValue key
|
||||||
|
|
||||||
|
unless GM_deleteValue?
|
||||||
|
$.perProtocolSettings = true
|
||||||
|
|
||||||
if GM_deleteValue?
|
if GM_deleteValue?
|
||||||
$.getValue = $.GM_getValue
|
$.getValue = $.GM_getValue
|
||||||
$.listValues = -> GM_listValues() # error when called if missing
|
$.listValues = -> GM_listValues() # error when called if missing
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user