HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleopen-browser-0.4.0.0Haskell2010

Web.Browser

Open a web browser from Haskell. Supported operating systems are Windows, macOS, Linux and BSD.

  • 2 values
valueopenBrowser
  1. :: String

    URL or other item to try to open.

  2. -> IO Bool
#

Seeks to open the given item, silently. If the item is a URL or another item associated with a web browser (for example, it represents a local .html file), seeks to open it in the user's preferred web browser. Returns whether or not the operation succeeded.

No checks are performed on the nature or validity of the given item.

Implemented using:

  • on Windows, the 'open' operation provided by the Win32 API. For an item that represents a file, equivalent double-clicking on the file's icon;

  • on macOS, the 'open' application, if it is on the user's PATH. For an item that represents a file, equivalent to double-clicking on the file's icon; and

  • on Linux, FreeBSD, OpenBSD or NetBSD, the 'xdg-open' script, if it is on the user's PATH.

On other operating systems, the operation always fails.

Utilities

1 declaration