5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 19:31:20 +08:00
wails/v3/plugins/browser/plugin.go
Lea Anthony ba82f27534 Fix Bug with nil parameters.
Added browser and kvstore plugins.
2023-03-20 20:28:33 +11:00

38 lines
845 B
Go

package browser
import (
"github.com/pkg/browser"
"github.com/wailsapp/wails/v3/pkg/application"
)
// ---------------- Plugin Setup ----------------
// This is the main plugin struct. It can be named anything you like.
// It must implement the application.Plugin interface.
// Both the Init() and Shutdown() methods are called synchronously when the app starts and stops.
type Plugin struct{}
func NewPlugin() *Plugin {
return &Plugin{}
}
func (p *Plugin) Shutdown() {}
func (p *Plugin) Name() string {
return "github.com/wailsapp/wails/v3/plugins/browser"
}
func (p *Plugin) Init(_ *application.App) error {
return nil
}
// ---------------- Plugin Methods ----------------
func (p *Plugin) OpenURL(url string) error {
return browser.OpenURL(url)
}
func (p *Plugin) OpenFile(path string) error {
return browser.OpenFile(path)
}