mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 07:40:17 +08:00
22 lines
520 B
Go
22 lines
520 B
Go
package runtime
|
|
|
|
import "github.com/pkg/browser"
|
|
|
|
// Browser exposes browser methods to the runtime
|
|
type Browser struct{}
|
|
|
|
// NewBrowser creates a new runtime Browser struct
|
|
func NewBrowser() *Browser {
|
|
return &Browser{}
|
|
}
|
|
|
|
// OpenURL opens the given url in the system's default browser
|
|
func (r *Browser) OpenURL(url string) error {
|
|
return browser.OpenURL(url)
|
|
}
|
|
|
|
// OpenFile opens the given file in the system's default browser
|
|
func (r *Browser) OpenFile(filePath string) error {
|
|
return browser.OpenFile(filePath)
|
|
}
|