B00_www_browser
Web browser interaction.
Browser
shows URIs in the user's browsers. Up to severe platform and browser application limitations it tries to limit the creation of new tabs, reloading existing one which have the same URI or are, if requested, prefixed by the URI.
module Env : sig ... end
Environment variables.
val find : ?search:B00_std.Fpath.t list -> browser:B00_std.Cmd.t option -> unit -> (t option, string) result
find ~search ~browser
tries to find a browser in a rather complex and platform dependent way.
show ~background ~prefix browser uri
shows URI using browser browser
(if None
an error message is returned mentioning that no browser was found. If background
is true
tries to keep the browser application in the background, if false
brings it in user focus.
The function tries to limit the creation of new tabs using the following strategy:
Repeat from the frontmost browser window to the backmost one until a tab to reload is found:
uri
(or is prefixed by uri
when prefix
is true
), reload this tab.uri
(or is prefixed by uri
when prefix
is true
), pick the left most one, make it current in the window and reload it.uri
otherwise create a new tab with uri
and make it current for the window.val browser : ?docs:string -> ?opts:string list -> unit -> B00_std.Cmd.t option Cmdliner.Term.t
browser
is an option and BROWSER
environment variable to use with the browser
argument of find
. opts
are the cli options and default to ["browser"]
.
val prefix : ?docs:string -> ?opts:string list -> unit -> bool Cmdliner.Term.t
prefix
is option to use the with prefix
argument of show
. opts
are the cli options and default to ["prefix"]
.
val background : ?docs:string -> ?opts:string list -> unit -> bool Cmdliner.Term.t
background
is an option to use with the background
argument of !show
. opts
are the cli options and default to ["background"]