B0_web_browser
Web browser interaction.
B0_web_browser
shows URLs 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 URL or are, if requested, prefixed by the URL.
module Env : sig ... end
Environment variables.
val find :
?search:B0_std.Cmd.tool_search ->
?cmd:B0_std.Cmd.t ->
unit ->
(t, string) Stdlib.result
find ~search ~cmd
tries to find a browser in a rather complex and platform dependent way.
val show :
background:bool ->
prefix:bool ->
t ->
string ->
(unit, string) Stdlib.result
show ~background ~prefix browser url
shows URL using browser browser
. 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:
url
(or is prefixed by url
when prefix
is true
), reload this tab.url
(or is prefixed by url
when prefix
is true
), pick the left most one, make it current in the window and reload it.url
otherwise create a new tab with url
and make it current for the window.val browser :
?docs:string ->
?opts:string list ->
unit ->
B0_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 ["b"; "browser"]
.
prefix
are options to use the with prefix
argument of show
. This defines these options:
--prefix
to specify true
and if default
is false
-p
aswell.--exact
to specify false
.The default value of the option is default
.
background
is an option to use with the background
argument of !show
. opts
are the cli options and default to ["g"; "background"]