Revert workaround for #1323 (7b8c2df5e4aae96b47771c0bb90989765d719d5c) which may be contributing for data corruption issues. #1910
This commit is contained in:
parent
b144c967f5
commit
1e277ed2ac
@ -552,25 +552,11 @@ if GM?.deleteValue? and window.BroadcastChannel and not GM_addValueChangeListene
|
||||
|
||||
else
|
||||
|
||||
# workaround for Firefox 53 issue
|
||||
$.currentValue = {}
|
||||
$.GM_getValue = (key) ->
|
||||
try
|
||||
$.currentValue[key] = GM_getValue key
|
||||
catch err
|
||||
$.currentValue[key]
|
||||
$.GM_setValue = (key, val) ->
|
||||
$.currentValue[key] = val
|
||||
GM_setValue key, val
|
||||
$.GM_deleteValue = (key) ->
|
||||
delete $.currentValue[key]
|
||||
GM_deleteValue key
|
||||
|
||||
unless GM_deleteValue?
|
||||
$.perProtocolSettings = true
|
||||
|
||||
if GM_deleteValue?
|
||||
$.getValue = $.GM_getValue
|
||||
$.getValue = GM_getValue
|
||||
$.listValues = -> GM_listValues() # error when called if missing
|
||||
else if $.hasStorage
|
||||
$.getValue = (key) -> localStorage[key]
|
||||
@ -581,17 +567,17 @@ else
|
||||
$.listValues = -> []
|
||||
|
||||
if GM_addValueChangeListener?
|
||||
$.setValue = $.GM_setValue
|
||||
$.deleteValue = $.GM_deleteValue
|
||||
$.setValue = GM_setValue
|
||||
$.deleteValue = GM_deleteValue
|
||||
else if GM_deleteValue?
|
||||
$.oldValue = {}
|
||||
$.setValue = (key, val) ->
|
||||
$.GM_setValue key, val
|
||||
GM_setValue key, val
|
||||
if key of $.syncing
|
||||
$.oldValue[key] = val
|
||||
localStorage[key] = val if $.hasStorage # for `storage` events
|
||||
$.deleteValue = (key) ->
|
||||
$.GM_deleteValue key
|
||||
GM_deleteValue key
|
||||
if key of $.syncing
|
||||
delete $.oldValue[key]
|
||||
localStorage.removeItem key if $.hasStorage # for `storage` events
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user