Commit b19930e
fix: load the SDL runtime with the browser's own fetch
On a device, SDL failed with "Failed to connect to localhost/127.0.0.1:443":
on Acode's main page window.fetch can be replaced (e.g. by another plugin
using native HTTP to avoid CORS), and native HTTP cannot reach the
plugin's files at https://localhost, which only exist inside the WebView.
The worker has its own fetch, so it was unaffected.
Requests for the plugin's files and Pyodide packages now go through the
browser's fetch taken from a hidden same-origin iframe; all other
requests still use the page's fetch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 67cd854 commit b19930e
3 files changed
Lines changed: 38 additions & 2 deletions
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
6 | 11 | | |
7 | 12 | | |
8 | 13 | | |
| |||
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
50 | 85 | | |
51 | 86 | | |
52 | 87 | | |
| 88 | + | |
53 | 89 | | |
54 | 90 | | |
55 | 91 | | |
| |||
0 commit comments