From 25d4d764d8eb7ced54c3ff24a49c089e3e4fb73f Mon Sep 17 00:00:00 2001 From: ccd0 Date: Thu, 27 Oct 2016 10:30:56 -0700 Subject: [PATCH] Update due to 4chan's ad changes. --- src/General/Settings.coffee | 2 +- src/css/style.css | 3 ++- src/main/Main.coffee | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index 9b36de87b..506ac7a71 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -113,7 +113,7 @@ Settings = Enable it on boards.4chan.org in your browser's privacy settings (may be listed as part of "local data" or "cookies"). """ ads: (cb) -> - $.onExists doc, '.ad-cnt', (ad) -> $.onExists ad, 'img', -> + $.onExists doc, '.ad-cnt, .adg-rects', (ad) -> $.onExists ad, 'img, iframe', -> url = Redirect.to 'thread', {boardID: 'qa', threadID: 362590} cb $.el 'li', <%= html( diff --git a/src/css/style.css b/src/css/style.css index 4173ae3e6..3ac37d994 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -119,12 +119,13 @@ body > div[style*=" top: -10000px;"] { :root:not(.ads-loaded) .ad-cnt > * { height: auto; } +:root:not(.ads-loaded) .adg-rects, :root:not(.ads-loaded) .ad-plea, :root:not(.ads-loaded) hr.abovePostForm, :root:not(.ads-loaded) .ad-plea-bottom + hr { display: none; } -hr + div.center:not(.ad-cnt):not(.topad):not(.middlead):not(.bottomad) { +div.center[style] { display: none !important; } diff --git a/src/main/Main.coffee b/src/main/Main.coffee index a825e3bf9..282a43ac8 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -185,7 +185,7 @@ Main = $.addClass doc, 'fourchan-x', 'seaweedchan' $.addClass doc, if g.VIEW is 'thread' then 'thread-view' else g.VIEW $.addClass doc, "ua-#{$.engine}" if $.engine - $.onExists doc, '.ad-cnt', (ad) -> $.onExists ad, 'img', -> $.addClass doc, 'ads-loaded' + $.onExists doc, '.ad-cnt, .adg-rects', (ad) -> $.onExists ad, 'img, iframe', -> $.addClass doc, 'ads-loaded' $.addClass doc, 'autohiding-scrollbar' if Conf['Autohiding Scrollbar'] $.ready -> if d.body.clientHeight > doc.clientHeight and (window.innerWidth is doc.clientWidth) isnt Conf['Autohiding Scrollbar']