diff options
author | NunoSempere <nuno.sempere@protonmail.com> | 2023-07-27 14:34:16 +0200 |
---|---|---|
committer | NunoSempere <nuno.sempere@protonmail.com> | 2023-07-27 14:34:16 +0200 |
commit | b87693e4c57f36e528a9d6f46febcac32c90b808 (patch) | |
tree | cf2cd5d52085def93d1c40de5cf79e8b9e05b527 /plugins/style | |
parent | e2c81f25957ea542f430132c9c96033ff77cfede (diff) |
use -O3 -Wall gcc flags, add old.reddit.com css
Diffstat (limited to 'plugins/style')
-rwxr-xr-x | plugins/style/recompute_STYLE_N.sh | 2 | ||||
-rw-r--r-- | plugins/style/style.c | 2 | ||||
-rw-r--r-- | plugins/style/style.h | 2 | ||||
-rw-r--r-- | plugins/style/style.js | 18 |
4 files changed, 21 insertions, 3 deletions
diff --git a/plugins/style/recompute_STYLE_N.sh b/plugins/style/recompute_STYLE_N.sh index 09faed2..9202894 100755 --- a/plugins/style/recompute_STYLE_N.sh +++ b/plugins/style/recompute_STYLE_N.sh @@ -5,5 +5,5 @@ sed_wrapper() } ## e.g., sedr "s/target/replacement/g" STYLE_N=`wc -c style.js | cut -d " " -f 1` -sed_wrapper "s/^#define STYLE_N .*/#define STYLE_N $STYLE_N + 1/g" +sed_wrapper "s/^#define STYLE_N .*/#define STYLE_N $STYLE_N + 100/g" diff --git a/plugins/style/style.c b/plugins/style/style.c index ed7b274..3e907b8 100644 --- a/plugins/style/style.c +++ b/plugins/style/style.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#define STYLE_N 4023 + 1 +#define STYLE_N 4390 + 100 void read_style_js(char* string) { diff --git a/plugins/style/style.h b/plugins/style/style.h index f11f210..43f34c7 100644 --- a/plugins/style/style.h +++ b/plugins/style/style.h @@ -1,7 +1,7 @@ #ifndef STYLE #define STYLE -#define STYLE_N 4023 + 1 +#define STYLE_N 4390 + 100 void read_style_js(char* string); diff --git a/plugins/style/style.js b/plugins/style/style.js index 8d3254c..c142373 100644 --- a/plugins/style/style.js +++ b/plugins/style/style.js @@ -70,6 +70,24 @@ if (document.domain == "twitter.com" ){ ` } +if (document.domain == "reddit.com" || document.domain == "old.reddit.com"){ + styles = ` + /* kill sidebar ads */ + .native-ad-container, + .premium-banner-outer, + .native-sidebar-ad, + .infobar-toaster-container, + #eu-cookie-policy, + .ad-container, + a[href="/premium"], + [data-promoted^="true"], + a[href^="https://alb.reddit.com"] + { + display: none !important; + } + ` +} + if(styles != null){ var styleSheet = document.createElement('style') styleSheet.innerText = styles |