browser

package
v6.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package browser provides cross-platform functionality for opening URLs in the default web browser. It abstracts the underlying operating system commands and provides a simple interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPlatformInfo

func GetPlatformInfo() map[string]interface{}

GetPlatformInfo returns a map containing details about the current platform's browser opening capabilities, including the OS, architecture, and available commands.

Returns:

  • A map with platform-specific browser support information.

func IsAvailable

func IsAvailable() bool

IsAvailable checks if the system has a command available to open a web browser. It verifies the presence of necessary commands for the current operating system.

Returns:

  • true if a browser can be opened, false otherwise.

func OpenURL

func OpenURL(url string) error

OpenURL opens the specified URL in the default web browser. It first attempts to use a platform-agnostic library and falls back to platform-specific commands if that fails.

Parameters:

  • url: The URL to open.

Returns:

  • An error if the URL cannot be opened, otherwise nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL