Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 699 Bytes

File metadata and controls

45 lines (33 loc) · 699 Bytes

Examples:

Open URL in Default Browser

err := browser.OpenURL("https://example.com")
if err != nil {
    fmt.Println("Error opening browser:", err)
} else {
    fmt.Println("Browser opened successfully")
}

Open URL with Path

err := browser.OpenURL("https://example.com/path/to/page")
if err != nil {
    fmt.Println("Error:", err)
}

Open URL with Query Parameters

err := browser.OpenURL("https://example.com/search?q=golang&page=1")
if err != nil {
    fmt.Println("Error:", err)
}

Open Local File

// Open a local HTML file
err := browser.OpenURL("file:///path/to/file.html")
if err != nil {
    fmt.Println("Error:", err)
}