Disable JS whitelist if 4chan X loads too late for it to be effective.

This commit is contained in:
name 2018-05-24 17:08:15 -07:00
parent 6e2c93e09e
commit e08bbdb282

View File

@ -78,7 +78,7 @@ Main =
Conf['Toggleable Thread Watcher'] = true
# Enforce JS whitelist
if /\.4chan\.org$/.test(location.hostname)
if /\.4chan\.org$/.test(location.hostname) and !$$('script:not([src])', d).filter((s) -> /this\[/.test(s.textContent)).length
($.getSync or $.get) {'jsWhitelist': Conf['jsWhitelist']}, ({jsWhitelist}) ->
$.addCSP "script-src #{jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim()}"