Documentation ¶
Index ¶
Constants ¶
const ( Brave = "brave" Chrome = "chrome" Firefox = "firefox" Safari = "safari" )
These constants represent an individual browser as a string value. The values themselves represents the accepted value for the `-b/--browser` flag for the command line tool.
Variables ¶
var ErrUnsupportedOS = fmt.Errorf("unsupported operating system: %q", runtime.GOOS)
ErrUnsupportedOS is returned when the current operating system is not supported.
Functions ¶
func Default ¶
Default returns the name of the default browser. The returned string is one of the constants provided by this package (`Brave`, `Chrome`, `Firefox`, `Safari`).
This is determined based on the operating system. For MacOS, the launch services plist file is queried. For Linux, the `xdg-mime` command is used to query the default handler for the HTTP protocol.
Types ¶
type Bookmark ¶
type Bookmark struct { // Name is the name of a bookmark. This name is only the final element of // the path (the base name), not the entire path. // For example, Name would be "baz" and not "foo/bar/baz". Name string `json:"name"` // Path is the full path to a bookmark. In case of nested structure, where // there are folders within folders, this will correspond to the entire // path separated by a forward slash (/). Path string `json:"path"` // Url is the URL of a bookmark. Url string `json:"url"` }
Bookmark contains information regarding an individual browser bookmark.
func GetBraveBookmarks ¶
GetBraveBookmarks returns a list of all the bookmarks collected from the Brave browser.
func GetChromeBookmarks ¶
GetChromeBookmarks returns a list of all the bookmarks collected from the Google Chrome browser.
func GetFirefoxBookmarks ¶
GetFirefoxBookmarks returns a list of all the bookmarks collected from the Firefox browser. The bookmarks are collected for the default user profile.
func GetFirefoxProfileBookmarks ¶
GetFirefoxProfileBookmarks is similar to GetFirefoxBookmarks, but this returns the bookmarks for the given profile name.
func GetSafariBookmarks ¶
GetSafariBookmarks returns a list of all the bookmarks collected from the Safari browser.
type ErrUnsupportedBrowser ¶
type ErrUnsupportedBrowser struct { // Name is the browser name. Name string }
ErrUnsupportedBrowser is returned when user provided browser or the default browser name is not supported.
func (*ErrUnsupportedBrowser) Error ¶
func (e *ErrUnsupportedBrowser) Error() string