diff options
author | NunoSempere <nuno.sempere@protonmail.com> | 2023-02-05 03:57:29 +0100 |
---|---|---|
committer | NunoSempere <nuno.sempere@protonmail.com> | 2023-02-05 03:57:29 +0100 |
commit | b48c504871c4732895b00ae6c2a87c97a63ad3d8 (patch) | |
tree | a34a0ef56a600758a63f81e67b7e4c4e8af5a0ed /plugins | |
parent | cbaa97a7662fe3693e52c838f0e0c8b60c536f4b (diff) |
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
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/libre_redirect/README.md | 54 | ||||
-rw-r--r-- | plugins/readability/README.md | 68 | ||||
-rw-r--r-- | plugins/style/README.md | 31 |
3 files changed, 3 insertions, 150 deletions
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 <https://libredirect.codeberg.page/>
\ No newline at end of file diff --git a/plugins/readability/README.md b/plugins/readability/README.md index d6c0fe2..2a19a8e 100644 --- a/plugins/readability/README.md +++ b/plugins/readability/README.md @@ -1,68 +1,2 @@ -## Readability +This code reimplements firefox readability mode. Code taken from <https://raw.githubusercontent.com/ushnisha/readability-reader-webextensions/master/content_scripts/tranquilize.js> -Taken from <https://raw.githubusercontent.com/ushnisha/readability-reader-webextensions/master/content_scripts/tranquilize.js> - - -## To enable it - -In `build.sh`, uncomment this line: - -``` -REQS= #./plugins/*/*.c -``` - -In `rose.c` uncomment: - -``` - -// #include "plugins/readability/readability.h" - -/* - case prettify: - { - - char* readability_js = malloc(READABILITY_N+1); - read_readability_js(readability_js); - webkit_web_view_run_javascript(notebook_get_webview(notebook), - readability_js, - NULL, NULL, NULL); - free(readability_js); - - break; - } -*/ - -``` - -In config.h, uncomment: - -``` - -typedef enum { - goback, - goforward, - refresh, - refresh_force, - back_to_home, - toggle_fullscreen, - zoomin, - zoomout, - zoom_reset, - next_tab, - prev_tab, - close_tab, - show_searchbar, - show_finder, - finder_next, - finder_prev, - newtab, - /*prettify,*/ - hidebar -} func; - -... - - // { CTRL, KEY(p), prettify }, - - -``` diff --git a/plugins/style/README.md b/plugins/style/README.md index 0d11c54..e0aad62 100644 --- a/plugins/style/README.md +++ b/plugins/style/README.md @@ -2,33 +2,4 @@ - Replicates: <https://addons.mozilla.org/en-GB/firefox/addon/styl-us/>. - The template is similar to the readability folder. - -## To enable it - -In `build.sh`, uncomment this line: - -``` -REQS= #./plugins/*/*.c -``` - -In `rose.c`, uncomment: - - -``` -// #include "plugins/style/style.h" - -... - - // Add custom style - /* - 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); - */ - -``` - -You will also want to customize the `style.c` file. +- You will also want to customize the `style.c` file. |