wails/v3/plugins/browser
2023-06-09 00:41:43 +00:00
..
plugin.go Reorder startup sequence 2023-03-24 08:43:00 +11:00
plugin.js Fix Bug with nil parameters. 2023-03-20 20:28:33 +11:00
plugin.toml Fix Bug with nil parameters. 2023-03-20 20:28:33 +11:00
README.md docs: format document 2023-06-09 00:41:43 +00:00

Browser Plugin

This plugin provides the ability to open a URL or local file in the default browser.

Installation

Add the plugin to the Plugins option in the Applications options:

package main

import (
    "github.com/wailsapp/wails/v3/pkg/application"
    "github.com/wailsapp/wails/v3/plugins/browser"
)

func main() {
  browserPlugin := browser.NewPlugin()
  app := application.New(application.Options{
    // ...
    Plugins: map[string]application.Plugin{
        "browser": browserPlugin,
    },
  })

Usage

Go

You can call the methods exported by the plugin directly:

    browserPlugin.OpenURL("https://www.google.com")
    // or
    browserPlugin.OpenFile("/path/to/file")

Javascript

You can call the methods from the frontend using the Plugin method:

wails.Plugin("browser", "OpenURL", "https://www.google.com");
// or
wails.Plugin("browser", "OpenFile", "/path/to/file");

Support

If you find a bug in this plugin, please raise a ticket on the Wails Issue Tracker.