aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNunoSempere <nuno.semperelh@protonmail.com>2024-03-23 16:18:00 -0300
committerNunoSempere <nuno.semperelh@protonmail.com>2024-03-23 16:18:00 -0300
commitf2e06785f9305598411cdc9262852decac4bfb63 (patch)
treeaa7bf3ed9b00822cb9fa182532b7b3957949e7f9
parentb4c3e3a0e3195633d574f0080f7f06a31e8f60a5 (diff)
Add https automatically if url contains .com or .org
also delete extraneous shortcut
-rw-r--r--plugins/shortcuts/shortcuts.c1
-rw-r--r--rosenrot.c8
2 files changed, 7 insertions, 2 deletions
diff --git a/plugins/shortcuts/shortcuts.c b/plugins/shortcuts/shortcuts.c
index 32c9cd6..dea48aa 100644
--- a/plugins/shortcuts/shortcuts.c
+++ b/plugins/shortcuts/shortcuts.c
@@ -35,7 +35,6 @@ int shortcut_expand(const char* uri, char* output)
"!blog",
"!fnf",
"!fnc",
- "!h"
"!hn",
"!hnb"
"!x",
diff --git a/rosenrot.c b/rosenrot.c
index b98cb1d..2e528b0 100644
--- a/rosenrot.c
+++ b/rosenrot.c
@@ -37,7 +37,13 @@ void load_uri(WebKitWebView* view, const char* uri)
toggle_bar(notebook);
} else if (g_str_has_prefix(uri, "http://") || g_str_has_prefix(uri, "https://") || g_str_has_prefix(uri, "file://") || g_str_has_prefix(uri, "about:")) {
webkit_web_view_load_uri(view, uri);
- } else {
+ } else if(strstr(uri, ".com") || strstr(uri, ".org")){
+ char tmp[strlen("https://") + strlen(uri)];
+ snprintf(tmp, sizeof(tmp), "https://%s", uri);
+ webkit_web_view_load_uri(view, tmp);
+
+ }
+ else{
// Check for shortcuts
int l = SHORTCUT_N + strlen(uri) + 1;
char uri_expanded[l];