Fix issue with disabling native extension on Pale Moon with cookies disabled on 4chan. #938
This commit is contained in:
parent
57ed6fdf92
commit
1de2c937ba
@ -23,10 +23,16 @@ Settings =
|
|||||||
|
|
||||||
if Conf['Disable Native Extension']
|
if Conf['Disable Native Extension']
|
||||||
if $.hasStorage
|
if $.hasStorage
|
||||||
settings = JSON.parse(localStorage.getItem '4chan-settings') or {}
|
# Run in page context to handle case where 4chan X has localStorage access but not the page.
|
||||||
return if settings.disableAll
|
# (e.g. Pale Moon 26.2.2, GM 3.8, cookies disabled for 4chan only)
|
||||||
settings.disableAll = true
|
$.global ->
|
||||||
localStorage.setItem '4chan-settings', JSON.stringify settings
|
try
|
||||||
|
settings = JSON.parse(localStorage.getItem '4chan-settings') or {}
|
||||||
|
return if settings.disableAll
|
||||||
|
settings.disableAll = true
|
||||||
|
localStorage.setItem '4chan-settings', JSON.stringify settings
|
||||||
|
catch
|
||||||
|
Object.defineProperty window, 'Config', {value: {disableAll: true}}
|
||||||
else
|
else
|
||||||
$.global ->
|
$.global ->
|
||||||
Object.defineProperty window, 'Config', {value: {disableAll: true}}
|
Object.defineProperty window, 'Config', {value: {disableAll: true}}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user