Don't allow bad siteProperties value to turn off script on 4chan.
This commit is contained in:
parent
c858eb585d
commit
8e3517735e
@ -67,10 +67,7 @@ Main =
|
||||
Conf['cooldowns'] = {}
|
||||
Conf['Index Sort'] = {}
|
||||
Conf["Last Long Reply Thresholds #{i}"] = {} for i in [0...2]
|
||||
Conf['siteProperties'] =
|
||||
'4chan.org': {software: 'yotsuba'}
|
||||
'4channel.org': {software: 'yotsuba'}
|
||||
'4cdn.org': {software: 'yotsuba'}
|
||||
Conf['siteProperties'] = {}
|
||||
|
||||
# XXX old key names
|
||||
Conf['Except Archives from Encryption'] = false
|
||||
@ -80,11 +77,7 @@ Main =
|
||||
Conf['QR Shortcut'] = true
|
||||
Conf['Bottom QR Link'] = true
|
||||
Conf['Toggleable Thread Watcher'] = true
|
||||
Conf['siteSoftware'] = """
|
||||
4chan.org yotsuba
|
||||
4channel.org yotsuba
|
||||
4cdn.org yotsuba
|
||||
"""
|
||||
Conf['siteSoftware'] = ''
|
||||
|
||||
# Enforce JS whitelist
|
||||
if /\.4chan(?:nel)?\.org$/.test(location.hostname) and !$$('script:not([src])', d).filter((s) -> /this\[/.test(s.textContent)).length
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
Site =
|
||||
defaultProperties:
|
||||
'4chan.org': {software: 'yotsuba'}
|
||||
'4channel.org': {software: 'yotsuba'}
|
||||
'4cdn.org': {software: 'yotsuba'}
|
||||
|
||||
init: (cb) ->
|
||||
$.extend Conf['siteProperties'], Site.defaultProperties
|
||||
{hostname} = location
|
||||
while hostname and hostname not of Conf['siteProperties']
|
||||
hostname = hostname.replace(/^[^.]*\.?/, '')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user