Disable JS whitelist if 4chan X loads too late for it to be effective.
This commit is contained in:
parent
6e2c93e09e
commit
e08bbdb282
@ -78,7 +78,7 @@ Main =
|
|||||||
Conf['Toggleable Thread Watcher'] = true
|
Conf['Toggleable Thread Watcher'] = true
|
||||||
|
|
||||||
# Enforce JS whitelist
|
# 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}) ->
|
($.getSync or $.get) {'jsWhitelist': Conf['jsWhitelist']}, ({jsWhitelist}) ->
|
||||||
$.addCSP "script-src #{jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim()}"
|
$.addCSP "script-src #{jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim()}"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user