Skip to main content

Module link_open

Module link_open 

Source
Expand description

A documentation link handed to the system’s browser: o in the Documentation view.

Catalogs and format specs can come from anyone, so a link’s text is hostile until checked. Only http and https reach the opener: other schemes are where a link-opening bug turns into running code, through whatever handler the system has registered for them. The opener gets the parser’s serialization of the URL, never the text as written, as one argument of a program run without a shell.

Enums§

Platform
The systems whose openers differ.
Refused
Why a link is not opened.

Functions§

checked_url
The URL to hand the browser for raw, as the parser writes it back: a host that is not ASCII in punycode, the path percent-encoded. Refused unless it is an http or https URL with a host and nothing a lenient parse would mend.
local_desktop
Whether a browser opened here would open in front of the user: not over SSH (checked first, since ssh -X sets DISPLAY), and on Linux and the BSDs only with a display. env looks up a variable; blank counts as unset.
open
Start the browser on url, already checked, without waiting for it.
opener_argv
The program and arguments that open url, the URL one argument of its own and no shell anywhere. Windows uses rundll32 url.dll,FileProtocolHandler, not cmd /c start, because cmd reads & and ^ in a URL as its own syntax.