Documentation
¶
Overview ¶
Package schemehost maps URLs of the app's custom schemes to the http://*.localhost URLs that serve them where the webview can't load a custom scheme itself (WebView2), and back.
<scheme>://localhost/… is served at http://<scheme>.localhost/…, and <scheme>://<host>/… at http://<host>.<scheme>.localhost/…. Chromium treats every *.localhost host as a secure origin on the loopback interface, so each host stays its own origin, as with the custom schemes of the other webviews.
Hosts are names of DNS labels (letters, digits and hyphens, at most 63 each, not starting or ending with a hyphen) separated by dots, as Chromium needs them in an http URL. They are lower-cased: hosts are case-insensitive, and the webview reports them in lower case. URLs with another host, a port, user info or no host aren't mapped, so the webview loads them as they are.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppHost ¶
AppHost splits webHost, the host of an http URL, into the scheme and host of the app's URL it serves: <scheme>.localhost is <scheme>://localhost, and <host>.<scheme>.localhost is <scheme>://<host>. The longest scheme that has reports wins.
func AppOrigin ¶
AppOrigin maps origin, the origin of a page that an http URL serving a scheme of the app loaded, back to the origin of that scheme, such as http://abc.myapp.localhost to myapp://abc. Other origins are returned as they are.
Types ¶
This section is empty.