diff options
author | NunoSempere <nuno.sempere@protonmail.com> | 2023-02-15 03:24:47 +0100 |
---|---|---|
committer | NunoSempere <nuno.sempere@protonmail.com> | 2023-02-15 03:24:47 +0100 |
commit | 25dedb09e1321ae70fe0598d98a3a6e4d15d1215 (patch) | |
tree | 8894952d15feb6133bdd4c3828de2d817eb33c2e | |
parent | a27b4357af07c0eef7a28afe6dc8e9274e9d7e17 (diff) |
tweaks: around bloomberg webpage
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | plugins/libre_redirect/libre_redirect.c | 4 | ||||
-rw-r--r-- | plugins/stand_in/stand_in.h | 2 | ||||
-rw-r--r-- | plugins/style/style.c | 2 | ||||
-rw-r--r-- | plugins/style/style.h | 2 | ||||
-rw-r--r-- | plugins/style/style.js | 9 | ||||
-rw-r--r-- | rose.c | 8 |
7 files changed, 22 insertions, 7 deletions
@@ -17,6 +17,7 @@ Personal tweaks for [rose](https://github.com/mini-rose/rose), a minimal browser This is my personal version. Contribute upstream to [github.com/mini-rose/rose](https://github.com/mini-rose/) instead. ### To do + - [ ] Document stand_in.c better - [ ] Look at using relative rather than absolute paths - [ ] Figure out if downloading files is doable. @@ -24,6 +25,7 @@ This is my personal version. Contribute upstream to [github.com/mini-rose/rose]( - [ ] Double check newtab/next-tab behavior - [ ] Find out what each of the css elements refers to. - [ ] Use something other than Whatsapp as an example syslink. +- [ ] Mask user agent Done: diff --git a/plugins/libre_redirect/libre_redirect.c b/plugins/libre_redirect/libre_redirect.c index 8650326..4beb400 100644 --- a/plugins/libre_redirect/libre_redirect.c +++ b/plugins/libre_redirect/libre_redirect.c @@ -40,7 +40,7 @@ int libre_redirect(const char* uri, char* output) "https://www.reddit.com", "https://medium.com", "https://translate.google.com", - "https://forum.effectivealtruism.org", + // "https://forum.effectivealtruism.org", "https://www.bloomberg.com", "https://twitter.com" }; @@ -50,7 +50,7 @@ int libre_redirect(const char* uri, char* output) "https://teddit.nunosempere.com", "https://scribe.rip", "https://simplytranslate.org/", - "https://ea.greaterwrong.com", + // "https://ea.greaterwrong.com", "https://archive.is/https://www.bloomberg.com", "https://nitter.net" }; diff --git a/plugins/stand_in/stand_in.h b/plugins/stand_in/stand_in.h index e221734..062acf7 100644 --- a/plugins/stand_in/stand_in.h +++ b/plugins/stand_in/stand_in.h @@ -9,7 +9,7 @@ #define LIBRE_N 0 #define STYLE_N 0 -#define READABILITY_N 0 +#define READABILITY_N 84638 + 1 int libre_redirect(const char* uri, char* uri_filtered); void str_init(char* str, int n); diff --git a/plugins/style/style.c b/plugins/style/style.c index 1605e56..03222fe 100644 --- a/plugins/style/style.c +++ b/plugins/style/style.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> -#define STYLE_N 1358 + 1 +#define STYLE_N 1393 + 1 void read_style_js(char* string){ FILE *fp=fopen("/home/loki/Documents/core/software/fresh/C/rose-browser/rose-browser/plugins/style/style.js", "r"); diff --git a/plugins/style/style.h b/plugins/style/style.h index 73adfdb..5e5d76b 100644 --- a/plugins/style/style.h +++ b/plugins/style/style.h @@ -1,7 +1,7 @@ #ifndef STYLE #define STYLE -#define STYLE_N 1358 + 1 +#define STYLE_N 1393 + 1 void read_style_js(char* string); diff --git a/plugins/style/style.js b/plugins/style/style.js index 600506f..bc0540e 100644 --- a/plugins/style/style.js +++ b/plugins/style/style.js @@ -1,7 +1,9 @@ // Replicates the Stylus app: <https://addons.mozilla.org/en-GB/firefox/addon/styl-us/> +var styles = null; + if (document.domain == "forum.effectivealtruism.org"){ - var styles = ` + styles = ` .Layout-main { margin-left: 100px; } @@ -24,7 +26,7 @@ if (document.domain == "forum.effectivealtruism.org"){ } if (document.domain == "mail.proton.me" ){ - var styles = ` + styles = ` .item-container-row.read, .item-container.read { background-color: white; } @@ -35,6 +37,9 @@ if (document.domain == "mail.proton.me" ){ background-color: var(--selection-background-color) !important; } ` +} + +if(styles != null){ var styleSheet = document.createElement('style') styleSheet.innerText = styles document.head.appendChild(styleSheet) @@ -123,6 +123,14 @@ void load_changed(WebKitWebView *self, WebKitLoadEvent load_event, GtkNotebook * switch (load_event) { /* see <https://webkitgtk.org/reference/webkit2gtk/2.5.1/WebKitWebView.html> */ case WEBKIT_LOAD_STARTED: + if(CUSTOM_STYLE_ENABLED){ + char* style_js = malloc(STYLE_N+1); + read_style_js(style_js); + webkit_web_view_run_javascript(notebook_get_webview(notebook), + style_js, + NULL, NULL, NULL); + free(style_js); + } if(LIBRE_REDIRECT_ENABLED){ redirect_if_annoying(self, webkit_web_view_get_uri(self)); } |