Fix native extension being invoked from event handlers.

This commit is contained in:
ccd0 2015-11-08 18:21:51 -08:00
parent 3a11bae514
commit e5f73f812b

View File

@ -21,11 +21,15 @@ Settings =
$.on d, 'AddSettingsSection', Settings.addSection
$.on d, 'OpenSettings', (e) -> Settings.open e.detail
if Conf['Disable Native Extension'] and $.hasStorage
settings = JSON.parse(localStorage.getItem '4chan-settings') or {}
return if settings.disableAll
settings.disableAll = true
localStorage.setItem '4chan-settings', JSON.stringify settings
if Conf['Disable Native Extension']
if $.hasStorage
settings = JSON.parse(localStorage.getItem '4chan-settings') or {}
return if settings.disableAll
settings.disableAll = true
localStorage.setItem '4chan-settings', JSON.stringify settings
else
$.onExists doc, 'body', false, ->
$.global -> window.Config.disableAll = true
open: (openSection) ->
return if Settings.overlay