use device browser instead of webview
This commit is contained in:
13
main.go
13
main.go
@@ -15,10 +15,11 @@ import (
|
|||||||
"github.com/kirsle/configdir"
|
"github.com/kirsle/configdir"
|
||||||
"github.com/mattn/go-mastodon"
|
"github.com/mattn/go-mastodon"
|
||||||
"github.com/k3a/html2text"
|
"github.com/k3a/html2text"
|
||||||
webview "github.com/webview/webview_go"
|
/*webview "github.com/webview/webview_go"*/
|
||||||
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"net/url"
|
||||||
_ "net/http"
|
_ "net/http"
|
||||||
|
|
||||||
"context"
|
"context"
|
||||||
@@ -169,17 +170,27 @@ func ProfileLaunch() {
|
|||||||
app, err := mastodon.RegisterApp(context.Background(), AppConfig)
|
app, err := mastodon.RegisterApp(context.Background(), AppConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
dialog.ShowError(err, AddProfileWindow)
|
dialog.ShowError(err, AddProfileWindow)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("App successfully created:\n", app)
|
fmt.Println("App successfully created:\n", app)
|
||||||
// Step two: the user now needs to log in
|
// Step two: the user now needs to log in
|
||||||
|
|
||||||
|
/*
|
||||||
Webview := webview.New(false)
|
Webview := webview.New(false)
|
||||||
defer Webview.Destroy()
|
defer Webview.Destroy()
|
||||||
Webview.SetTitle("Authenticate - copy the authorisation code when logged in.")
|
Webview.SetTitle("Authenticate - copy the authorisation code when logged in.")
|
||||||
Webview.SetSize(480, 320, webview.HintNone)
|
Webview.SetSize(480, 320, webview.HintNone)
|
||||||
Webview.Navigate(app.AuthURI)
|
Webview.Navigate(app.AuthURI)
|
||||||
Webview.Run()
|
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))
|
AddProfileWindow.Resize(fyne.NewSize(500, 500))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user