diff options
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 8640e7ae..59f5a92c 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -2004,9 +2004,10 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e | |||
2004 | iArray items; | 2004 | iArray items; |
2005 | init_Array(&items, sizeof(iMenuItem)); | 2005 | init_Array(&items, sizeof(iMenuItem)); |
2006 | if (d->contextLink) { | 2006 | if (d->contextLink) { |
2007 | const iString *linkUrl = linkUrl_GmDocument(d->doc, d->contextLink->linkId); | 2007 | const iString *linkUrl = linkUrl_GmDocument(d->doc, d->contextLink->linkId); |
2008 | const iRangecc scheme = urlScheme_String(linkUrl); | 2008 | const iRangecc scheme = urlScheme_String(linkUrl); |
2009 | if (willUseProxy_App(scheme) || equalCase_Rangecc(scheme, "gemini") || | 2009 | const iBool isGemini = equalCase_Rangecc(scheme, "gemini"); |
2010 | if (willUseProxy_App(scheme) || isGemini || | ||
2010 | equalCase_Rangecc(scheme, "gopher")) { | 2011 | equalCase_Rangecc(scheme, "gopher")) { |
2011 | /* Regular links that we can open. */ | 2012 | /* Regular links that we can open. */ |
2012 | pushBackN_Array( | 2013 | pushBackN_Array( |
@@ -2031,14 +2032,15 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e | |||
2031 | format_CStr("!open url:%s", cstr_String(linkUrl)) }); | 2032 | format_CStr("!open url:%s", cstr_String(linkUrl)) }); |
2032 | } | 2033 | } |
2033 | if (willUseProxy_App(scheme)) { | 2034 | if (willUseProxy_App(scheme)) { |
2034 | pushBackN_Array(&items, | 2035 | pushBackN_Array( |
2035 | (iMenuItem[]){ { "---", 0, 0, NULL }, | 2036 | &items, |
2036 | { "Open Link in Default Browser", | 2037 | (iMenuItem[]){ |
2037 | 0, | 2038 | { "---", 0, 0, NULL }, |
2038 | 0, | 2039 | { isGemini ? "Open without Proxy" : "Open Link in Default Browser", |
2039 | format_CStr("!open noproxy:1 url:%s", | 2040 | 0, |
2040 | cstr_String(linkUrl)) } }, | 2041 | 0, |
2041 | 2); | 2042 | format_CStr("!open noproxy:1 url:%s", cstr_String(linkUrl)) } }, |
2043 | 2); | ||
2042 | } | 2044 | } |
2043 | pushBackN_Array(&items, | 2045 | pushBackN_Array(&items, |
2044 | (iMenuItem[]){ { "---", 0, 0, NULL }, | 2046 | (iMenuItem[]){ { "---", 0, 0, NULL }, |