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 IsIncognitoMode ¶
func IsIncognitoMode() bool
IsIncognitoMode returns whether incognito mode is enabled.
func OpenURL ¶
OpenURL opens the specified URL in the default web browser. It uses the pkg/browser library which provides robust cross-platform support for Windows, macOS, and Linux. If incognito mode is enabled, it will open in a private/incognito window.
Parameters:
- url: The URL to open.
Returns:
- An error if the URL cannot be opened, otherwise nil.
func SetIncognitoMode ¶
func SetIncognitoMode(enabled bool)
SetIncognitoMode enables or disables incognito/private browsing mode.
Types ¶
This section is empty.