Add https automatically if url contains .com or .org
also delete extraneous shortcut
This commit is contained in:
parent
b4c3e3a0e3
commit
f2e06785f9
|
@ -35,7 +35,6 @@ int shortcut_expand(const char* uri, char* output)
|
||||||
"!blog",
|
"!blog",
|
||||||
"!fnf",
|
"!fnf",
|
||||||
"!fnc",
|
"!fnc",
|
||||||
"!h"
|
|
||||||
"!hn",
|
"!hn",
|
||||||
"!hnb"
|
"!hnb"
|
||||||
"!x",
|
"!x",
|
||||||
|
|
|
@ -37,7 +37,13 @@ void load_uri(WebKitWebView* view, const char* uri)
|
||||||
toggle_bar(notebook);
|
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:")) {
|
} 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);
|
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
|
// Check for shortcuts
|
||||||
int l = SHORTCUT_N + strlen(uri) + 1;
|
int l = SHORTCUT_N + strlen(uri) + 1;
|
||||||
char uri_expanded[l];
|
char uri_expanded[l];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user