Browser
val reload : ?background:bool -> ?prefix:bool -> ?browser:Bos.Cmd.t -> string -> (unit, Rresult.R.msg) Rresult.result
reload ~background ~prefix ~browser uri
tries to reload or open the URI uri
or an URI prefixed by uri
if prefix is true
(defaults to false
) in browser browser
(if unspecified a platform dependent procedure is invoked to determine the user preference).
If background
is true
(defaults to false
), the browser application should be kept in the background, only the reload should occur. If false
the browser application and reloaded window should be brought into focus.
The reload should always lead to the reload of a single browser tab found as follows.
Repeat from the frontmost browser window to the backmost one until a tab to reload is found:
- If the window's current tab's URI is
uri
(or is prefixed byuri
whenprefix
istrue
), reload this tab. - If the window has one or more tab whose URI is
uri
(or is prefixed byuri
whenprefix
istrue
), pick the left most one, make it current in the window and reload it.
- If the window's current tab's URI is
- If no tab was found, get the frontmost window. If the current tab has no URI, use that tab with
uri
otherwise create a new tab withuri
and make it current for the window.