package b0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0
doc/b0.std/B0_web_browser/index.html
Module B0_web_browser
Source
Web browser interaction.
B0_web_browser
opens and reloads 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.
Environment variables
Open and reload URLs
The type for browsers.
find ~search ~cmd
tries to find a browser in a rather complex and platform dependent way.
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:
- If the window's current tab's URL is
url
(or is prefixed byurl
whenprefix
istrue
), reload this tab. - If the window has one or more tab whose URL is
url
(or is prefixed byurl
whenprefix
istrue
), pick the left most one, make it current in the window and reload it.
- If the window's current tab's URL is
- If no tab was found, get the frontmost window. If the current tab has no URI, use that tab with
url
otherwise create a new tab withurl
and make it current for the window.
Cli interaction
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 specifytrue
and ifdefault
isfalse
-p
aswell.--exact
to specifyfalse
.
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"]
man_best_effort_reload
is a manual fragment explaining best-effort reloading.