mirror of
https://github.com/taigrr/wails.git
synced 2026-04-16 19:55:05 -07:00
feat: significant overhaul of runtime
This commit is contained in:
21
runtime/browser.go
Normal file
21
runtime/browser.go
Normal file
@@ -0,0 +1,21 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user