From e08bbdb2820f8223d98dee383f84150de5790d38 Mon Sep 17 00:00:00 2001 From: name Date: Thu, 24 May 2018 17:08:15 -0700 Subject: [PATCH] Disable JS whitelist if 4chan X loads too late for it to be effective. --- src/main/Main.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/Main.coffee b/src/main/Main.coffee index 6e697632e..7ec67988b 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -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()}"