From e5b61891a1d16fdec10ae1982e59188c6bda2278 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 5 May 2018 15:35:05 -0700 Subject: [PATCH] Update workaround for ad breaking 4chan, take two. --- src/main/Main.coffee | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/Main.coffee b/src/main/Main.coffee index 924f285e7..561bd156f 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -49,8 +49,16 @@ Main = # XXX Remove document-breaking ad if location.hostname is 'boards.4chan.org' - $.onExists doc, '#delform > .adg-rects', $.rm - $.onExists doc, '#adg-ol', $.rm + $.global -> + fromCharCode0 = String.fromCharCode + String.fromCharCode = -> + if document.body + String.fromCharCode = fromCharCode0 + else if document.currentScript and not document.currentScript.src + throw Error() + fromCharCode0.apply @, arguments + $.asap docSet, -> + $.onExists doc, 'iframe[srcdoc]', $.rm flatten null, Config