diff options
author | NunoSempere <nuno.sempere@protonmail.com> | 2023-02-05 03:02:03 +0100 |
---|---|---|
committer | NunoSempere <nuno.sempere@protonmail.com> | 2023-02-05 03:02:03 +0100 |
commit | 9a533b7e2679c6704aa83f53a82a0b51e86da7d8 (patch) | |
tree | 97b3dd142a30d2fb91f4f2d8b82868fadbb6788d /plugins/libre_redirect | |
parent | 6b3c830c3b6e9337abe8a93fd3704a3b2d3148bb (diff) |
feat: disable plugins code by default and explain how to enable it.
Diffstat (limited to 'plugins/libre_redirect')
-rw-r--r-- | plugins/libre_redirect/README.md | 55 |
1 files changed, 55 insertions, 0 deletions
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 |