use device browser instead of webview

This commit is contained in:
2025-11-24 07:47:13 +00:00
parent 180f88e448
commit 2312c48f67

13
main.go
View File

@@ -15,10 +15,11 @@ import (
"github.com/kirsle/configdir"
"github.com/mattn/go-mastodon"
"github.com/k3a/html2text"
webview "github.com/webview/webview_go"
/*webview "github.com/webview/webview_go"*/
"encoding/json"
"path/filepath"
"net/url"
_ "net/http"
"context"
@@ -169,17 +170,27 @@ func ProfileLaunch() {
app, err := mastodon.RegisterApp(context.Background(), AppConfig)
if err != nil {
dialog.ShowError(err, AddProfileWindow)
return
}
fmt.Println("App successfully created:\n", app)
// Step two: the user now needs to log in
/*
Webview := webview.New(false)
defer Webview.Destroy()
Webview.SetTitle("Authenticate - copy the authorisation code when logged in.")
Webview.SetSize(480, 320, webview.HintNone)
Webview.Navigate(app.AuthURI)
Webview.Run()
*/
u, err := url.Parse(app.AuthURI)
if err != nil {
dialog.ShowError(err, AddProfileWindow)
return
}
App.OpenURL(u)
AddProfileWindow.Resize(fyne.NewSize(500, 500))