Custom URI scheme support
Author: fairkingCreated Nov 19, 2022Updated Aug 18, 2026
Labelstype: feature request
Hi guys? Does webview support custom URIs? As far as I can see it is not: webview. Do you have any plans to add it? The problem is we cannot serve local spa applications without it. localhost is not an option for me.
Ref:
- https://webkitgtk.org/reference/webkit2gtk/2.5.1/WebKitWebContext.html#webkit-web-context-register-uri-scheme
- https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2customschemeregistration?view=webview2-dotnet-1.0.1466-prerelease
Eg.:
fn void register_uri_scheme(string scheme_name, fn callback) {
}webview.register_uri_scheme("my_scheme", uri_handler);
fn bytes_stream uri_handler(string uri) {
return strict_assets_folder.get_file_bytes(uri)
}<!DOCTYPE html>
<html>
<head>
<title>My App</title>
<base href="my_scheme://">
<link rel="icon" type="image/ico" href="/favicon.ico">
<script src="/js/index.b1465023.js"></script>
<link rel="stylesheet" href="/css/index.e607f6df.css">
</head>
<body>
<div id="my-app"><img src="/images/logo.png" /></div>
</body>
</html>Source: webview/webview