From aec21c71a65e68ac8488271a94fbf23f4f894f0d Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Thu, 3 Aug 2023 14:40:40 +0200 Subject: [PATCH] tweaks: add code to block twitter ads --- plugins/style/style.c | 2 +- plugins/style/style.h | 2 +- plugins/style/style.js | 12 ++++++++++++ rose | Bin 43280 -> 43280 bytes 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/style/style.c b/plugins/style/style.c index 3e907b8..7463376 100644 --- a/plugins/style/style.c +++ b/plugins/style/style.c @@ -1,7 +1,7 @@ #include #include #include -#define STYLE_N 4390 + 100 +#define STYLE_N 4748 + 100 void read_style_js(char* string) { diff --git a/plugins/style/style.h b/plugins/style/style.h index 43f34c7..b4f28af 100644 --- a/plugins/style/style.h +++ b/plugins/style/style.h @@ -1,7 +1,7 @@ #ifndef STYLE #define STYLE -#define STYLE_N 4390 + 100 +#define STYLE_N 4748 + 100 void read_style_js(char* string); diff --git a/plugins/style/style.js b/plugins/style/style.js index 9d9d700..09324ed 100644 --- a/plugins/style/style.js +++ b/plugins/style/style.js @@ -61,9 +61,20 @@ if (document.domain == "search.nunosempere.com" ){ } if (document.domain == "twitter.com" ){ styles = ` + /* hide promoted tweets */ + :has(meta[property="og:site_name"][content="Twitter"]) + [data-testid="cellInnerDiv"]:has(svg + [dir="auto"]) { + display: none; + } [data-testid^="placementTracking"] { display: none; } + + /* hide what's happening section */ + :has(meta[property="og:site_name"][content="Twitter"]) + [aria-label="Timeline: Trending now"] { + display: none !important; + } [data-testid^="sidebarColumn"] { display: none; } @@ -79,6 +90,7 @@ if (document.domain == "reddit.com" || document.domain == "old.reddit.com"){ .infobar-toaster-container, #eu-cookie-policy, .ad-container, + .listingsignupbar, a[href="/premium"], [data-promoted^="true"], a[href^="https://alb.reddit.com"] diff --git a/rose b/rose index b80085ad35af581e3fbadbced68bf9d216aa24e9..83810a0472869f41ce91fddeb85803d18f02ab0c 100755 GIT binary patch delta 78 zcmbPmiD|+mrVSa)B2}@fM{ey5=5Dh5XcHti{~nvO!r{#|%nRL^J_=2i_woW#o3p*H bv4d#mAWK1(oc!#}%?-(QOb`}R8lN)&-RK?H delta 78 zcmbPmiD|+mrVSa)A}3PQzs_(Aj)?xkR9zNy>gNADtudQxm>0S+bqh|G_woW#o3p*H bv4d#mAWK1(qWt`l%?-(QOb`}R8lN)&HR>N9