From 9a533b7e2679c6704aa83f53a82a0b51e86da7d8 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sun, 5 Feb 2023 03:02:03 +0100 Subject: feat: disable plugins code by default and explain how to enable it. --- plugins/libre_redirect/README.md | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 plugins/libre_redirect/README.md (limited to 'plugins/libre_redirect') diff --git a/plugins/libre_redirect/README.md b/plugins/libre_redirect/README.md new file mode 100644 index 0000000..01add9c --- /dev/null +++ b/plugins/libre_redirect/README.md @@ -0,0 +1,55 @@ +## About + +This code automatically redirects webpage to their open-source frontends + +To enable it: + +## In build.sh + +Uncomment this line: + +``` +REQS= #./plugins/*/*.c +``` + +or alternatively, write the full paths of `libre_redirect.c` and `str_replace_start.c` + + +### In rose.c + +Uncomment these lines: + +``` +// #include "plugins/libre_redirect/libre_redirect.h" + +... + +/* +void redirect_if_annoying(WebKitWebView *view, const char *uri){ + int l = LIBRE_N + strlen(uri) + 1; + char uri_filtered[l]; + str_init(uri_filtered, l); + + int check = libre_redirect(uri, uri_filtered); + + if (check == 2){ + webkit_web_view_load_uri(view, uri_filtered); + } + +} +*/ + +... + + case WEBKIT_LOAD_STARTED: + // redirect_if_annoying(self, webkit_web_view_get_uri(self)); + break; + case WEBKIT_LOAD_REDIRECTED: + // redirect_if_annoying(self, webkit_web_view_get_uri(self)); + break; + case WEBKIT_LOAD_COMMITTED: + // redirect_if_annoying(self, webkit_web_view_get_uri(self)); + break; + + +``` \ No newline at end of file -- cgit v1.2.3 From 353d0ffad7c1810d2c5a87d73f6649bcbc55aad4 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sun, 5 Feb 2023 03:21:30 +0100 Subject: feat: add plugin to customize css for individual websites... and how to enable it. Also tweak README.mds --- plugins/libre_redirect/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/libre_redirect') diff --git a/plugins/libre_redirect/README.md b/plugins/libre_redirect/README.md index 01add9c..7b32370 100644 --- a/plugins/libre_redirect/README.md +++ b/plugins/libre_redirect/README.md @@ -6,7 +6,7 @@ To enable it: ## In build.sh -Uncomment this line: +In `build.sh`, uncomment this line: ``` REQS= #./plugins/*/*.c @@ -52,4 +52,4 @@ void redirect_if_annoying(WebKitWebView *view, const char *uri){ break; -``` \ No newline at end of file +``` -- cgit v1.2.3 From b48c504871c4732895b00ae6c2a87c97a63ad3d8 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sun, 5 Feb 2023 03:57:29 +0100 Subject: feat: use flags rather than uncommenting code - Significantly simpler - Easier for me to keep up with upstream - Alternatives: - Comments as before - git patches, as in the suckless community: eventually leads to confusion about conflicting patches. - some other option --- plugins/libre_redirect/README.md | 54 +--------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) (limited to 'plugins/libre_redirect') diff --git a/plugins/libre_redirect/README.md b/plugins/libre_redirect/README.md index 7b32370..f3f58c9 100644 --- a/plugins/libre_redirect/README.md +++ b/plugins/libre_redirect/README.md @@ -1,55 +1,3 @@ ## About -This code automatically redirects webpage to their open-source frontends - -To enable it: - -## In build.sh - -In `build.sh`, uncomment this line: - -``` -REQS= #./plugins/*/*.c -``` - -or alternatively, write the full paths of `libre_redirect.c` and `str_replace_start.c` - - -### In rose.c - -Uncomment these lines: - -``` -// #include "plugins/libre_redirect/libre_redirect.h" - -... - -/* -void redirect_if_annoying(WebKitWebView *view, const char *uri){ - int l = LIBRE_N + strlen(uri) + 1; - char uri_filtered[l]; - str_init(uri_filtered, l); - - int check = libre_redirect(uri, uri_filtered); - - if (check == 2){ - webkit_web_view_load_uri(view, uri_filtered); - } - -} -*/ - -... - - case WEBKIT_LOAD_STARTED: - // redirect_if_annoying(self, webkit_web_view_get_uri(self)); - break; - case WEBKIT_LOAD_REDIRECTED: - // redirect_if_annoying(self, webkit_web_view_get_uri(self)); - break; - case WEBKIT_LOAD_COMMITTED: - // redirect_if_annoying(self, webkit_web_view_get_uri(self)); - break; - - -``` +This code automatically redirects webpage to their open-source frontends. It is based on \ No newline at end of file -- cgit v1.2.3