browser

package
v0.5.26 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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