diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2024-02-07 15:02:24 -0700 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2024-02-07 15:02:24 -0700 |
commit | 30e80066d426b15e2e3dc4c5ca5370a86bc8126f (patch) | |
tree | a2925d47b56600f7f52a7f5fb4cd7d2e05e3e4e8 /iGopherBrowser/BrowserView.swift | |
parent | a22ff62c83717fb09285dbc66441b8b1c1583c68 (diff) |
handle gopher:// urls
Diffstat (limited to 'iGopherBrowser/BrowserView.swift')
-rw-r--r-- | iGopherBrowser/BrowserView.swift | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/iGopherBrowser/BrowserView.swift b/iGopherBrowser/BrowserView.swift index f745fc8..29c28d0 100644 --- a/iGopherBrowser/BrowserView.swift +++ b/iGopherBrowser/BrowserView.swift @@ -369,11 +369,18 @@ struct BrowserView: View { .autocapitalization(.none) #endif .padding(10) - Spacer() } //.background(Color.white) .cornerRadius(30) - + if (shareThroughProxy) { + ShareLink(item: URL(string: "https://gopher.navan.dev/\(url)")!) { + Label("Share", systemImage: "square.and.arrow.up").labelStyle(.iconOnly) + } + } else { + ShareLink(item: URL(string: "gopher://\(url)")!) { + Label("Share", systemImage: "square.and.arrow.up").labelStyle(.iconOnly) + } + } Button( "Go", action: { @@ -395,6 +402,10 @@ struct BrowserView: View { performGopherRequest(host: node.host, port: node.port, selector: node.selector) } } + .onOpenURL { gopherURL in + self.url = gopherURL.absoluteString + performGopherRequest() + } .sheet( isPresented: $showPreferences, onDismiss: { |