Commit 855ee44
committed
fix(webkitgtk): mark custom URI schemes as CORS-enabled
webkit2gtk 2.46 added a requirement that custom URI schemes registered
via `webkit_web_context_register_uri_scheme()` must ALSO be in the
CORS allow-list (`webkit_security_manager_register_uri_scheme_as_cors_enabled()`)
for the host's handler to be invoked on top-level navigations.
Previously wry only called `register_uri_scheme_as_secure()`. On
webkit2gtk ≤ 2.44 (Ubuntu 22.04 / 24.04) this was sufficient. On
webkit2gtk 2.46+ (Ubuntu 26.04, Fedora 40+, Arch rolling) webkit
silently bypasses the handler and falls through to the default
network loader.
Symptom for Tauri apps: the bundled UI loaded via `tauri://localhost/`
fails to render and the webview shows "Could not connect to localhost:
Connection refused" because the request lands at `http://localhost:80/`
where nothing's listening.
The CORS-enable call is a no-op on older webkit2gtk so the patch is
safe across versions.
Verified end-to-end on Ubuntu 26.04 LTS aarch64 with webkit2gtk
2.52.0: before, custom-scheme load shows the connection-error page;
after, the embedded UI loads correctly.1 parent 0b1e2be commit 855ee44
2 files changed
Lines changed: 30 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
138 | 147 | | |
139 | 148 | | |
140 | 149 | | |
141 | | - | |
142 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
143 | 153 | | |
144 | 154 | | |
145 | 155 | | |
| |||
0 commit comments