[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KRF38Q4WSKAYFS56PG87T0":3,"skill-same:01M6KRF38Q4WSKAYFS56PG87T0":79},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":49,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":52,"ownerDescription":53,"updatedAt":54,"install":55,"resources":68},"01M6KRF38Q4WSKAYFS56PG87T0","web-export",null,"Use when shipping a Godot game to the browser — Web export preset options, threads vs no-threads and COOP\u002FCOEP headers, hosting on itch.io or your own server, PWA, JavaScriptBridge, user:\u002F\u002F persistence, audio and input limits, and load size","jame581\u002FGodotPrompter","jame581","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F21112138?v=4","01M6KR3KEQ9Z30WVJRR2E2ZVXE","Jan Mesarč","01M6KR3KJVRMPDSMASQPBCBVK3",964,"MIT","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-export\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"web export","export","web","Coop","when","limits","load","size","threads","headers","input","io","options","hosting","use","pwa","game","Audio","server","browser","shipping","preset","2026-11-10 10:12:30",false,"---\nname: web-export\ndescription: Use when shipping a Godot game to the browser — Web export preset options, threads vs no-threads and COOP\u002FCOEP headers, hosting on itch.io or your own server, PWA, JavaScriptBridge, user:\u002F\u002F persistence, audio and input limits, and load size\n---\n\n# Web Export in Godot 4.3+\n\nShip a Godot 4.x game as HTML5\u002FWebAssembly. This covers what is different from a desktop export: the renderer, threading and server headers, browser interop, persistence, and the input and audio rules browsers enforce. All examples target Godot 4.3+ with no deprecated APIs.\n\n**C# projects cannot export to Web in Godot 4** — the .NET editor refuses the export (still true in 4.7.2). The code in this skill is GDScript only for that reason; a C# game that needs a browser build must be ported to GDScript or stay on Godot 3.\n\n> **Related skills:** **export-pipeline** for presets, CLI export and CI\u002FCD, **web-services** for HTTP and WebSockets from the browser, **rendering-pipeline** for what the Compatibility renderer can and cannot do, **audio-system** for buses and playback, **save-load** for save formats.\n\n---\n\n## 1. What Changes on Web\n\n| Area | On Web |\n|---|---|\n| Renderer | Always **Compatibility** (WebGL 2) — `rendering\u002Frenderer\u002Frendering_method.web` defaults to `gl_compatibility`. No SDFGI, VoxelGI, volumetric fog, SSR, FSR, or screen-space AA |\n| Scripting | GDScript and GDExtension only. No C# |\n| Threads | Optional. Off by default; turning them on needs special server headers (Section 3) |\n| Audio | Sample playback through the Web Audio API by default — `AudioEffect`s on buses do not apply (Section 6) |\n| Files | `user:\u002F\u002F` lives in the browser's IndexedDB; there is no access to the player's disk except downloads and file-picker uploads |\n| Networking | HTTP via the browser's `fetch` (CORS applies), WebSockets and WebRTC only — no raw TCP\u002FUDP, so no ENet |\n| Processes | No `OS.execute()`, `OS.create_process()`, or quitting the tab |\n\nDesign for this from the start if web is a primary target. Porting a Forward+ game late means re-lighting it.\n\n---\n\n## 2. The Export Preset\n\nAdd a **Web** preset in **Project → Export** (export templates must be installed). The options that matter:\n\n| Option | Default | Set it when |\n|---|---|---|\n| `variant\u002Fthread_support` | `false` | You need threads and can serve COOP\u002FCOEP headers (Section 3) |\n| `variant\u002Fextensions_support` | `false` | The project uses GDExtension (needs the extension's web build) |\n| `vram_texture_compression\u002Ffor_desktop` | `true` | S3TC\u002FBPTC textures for desktop browsers |\n| `vram_texture_compression\u002Ffor_mobile` | `false` | Turn on for phone browsers (ETC2\u002FASTC); costs a second texture set in the PCK |\n| `html\u002Fcanvas_resize_policy` | Adaptive | `None` \u002F `Project` when embedding in a fixed-size page element |\n| `html\u002Ffocus_canvas_on_start` | `true` | Keep on so keyboard input works without a first click |\n| `html\u002Fexperimental_virtual_keyboard` | `false` | Mobile browsers need an on-screen keyboard for `LineEdit` |\n| `html\u002Fhead_include` | empty | Extra `\u003Chead>` tags — analytics, meta tags, fonts |\n| `html\u002Fcustom_html_shell` | empty | Replace the whole loading page with your own template |\n| `progressive_web_app\u002Fenabled` | `false` | Installable, offline-capable build (Section 4) |\n| `threads\u002Femscripten_pool_size`, `threads\u002Fgodot_pool_size` (Godot 4.5+) | 8, 4 | Only shown with thread support; lower them to reduce memory |\n\nThe output is an `.html` page plus `.js`, `.wasm`, `.pck`, and audio worklet files — upload all of them together. The default filename for the page should be `index.html` for most hosts.\n\nCLI export works as on desktop: `godot --headless --export-release \"Web\" build\u002Fweb\u002Findex.html`.\n\n---\n\n## 3. Threads or No Threads\n\nThreaded builds use `SharedArrayBuffer`, which browsers only enable on a **cross-origin isolated** page. The server must send both headers on every file of the export (the page, its scripts, and the worker scripts):\n\n```\nCross-Origin-Opener-Policy: same-origin\nCross-Origin-Embedder-Policy: require-corp\n```\n\n| | No threads (default, Godot 4.3+) | Threads |\n|---|---|---|\n| Hosting | Any static host | Needs the two headers above, or the PWA workaround |\n| Audio | Sample playback, low latency | Sample playback by default; stream mode crackles more |\n| Embeds, ads, third-party iframes | Work | Break unless they also send CORP\u002FCORS headers (`require-corp` blocks them) |\n| `WorkerThreadPool` | Tasks run inline on the main thread, so heavy work stalls frames | Real background threads |\n| `Thread` | **`start()` returns `OK` but the function never runs** | Real background threads |\n| Feature tag | `nothreads` | `threads` |\n\n**Default to no threads.** Turn them on only when profiling shows a real need (heavy procedural generation, physics on background threads), and you control the server or use a host that sets the headers. Code that must behave differently can check `OS.has_feature(\"threads\")` — and any `Thread`-based code (level generation, loaders) **must**, or it silently does nothing on the default build. `WorkerThreadPool` is the portable choice.\n\nGodot's own **Remote Debug → Run in Browser** server sends the headers, so a threaded build can work locally and fail once uploaded. Test on the real host.\n\n---\n\n## 4. Hosting\n\n| Host | What to do |\n|---|---|\n| **itch.io** | Upload a ZIP with `index.html` at its root, set the project kind to HTML. For threaded builds tick **SharedArrayBuffer support** in the embed options |\n| **GitHub Pages, plain static hosts** | No custom headers: ship the no-threads build, or enable PWA with `progressive_web_app\u002Fensure_cross_origin_isolation_headers` (default `true`) so a service worker adds the headers after the first load |\n| **Your own server \u002F CDN** | Send COOP\u002FCOEP for threads, serve `.wasm` as `application\u002Fwasm`, and precompress `.wasm` and `.pck` with Brotli or gzip |\n\nServer config snippets (nginx, Apache, Netlify, Cloudflare Pages), compression, and cache headers: [references\u002Fhosting.md](references\u002Fhosting.md).\n\nThe **PWA** option also makes the game installable and playable offline. After you publish an update, `JavaScriptBridge.pwa_needs_update()` turns `true` (and `pwa_update_available` is emitted); call `JavaScriptBridge.pwa_update()` to reload into the new version — it reloads every open tab.\n\n---\n\n## 5. Detecting the Platform and Talking to JavaScript\n\n\u003C!-- csharp-parity: n\u002Fa — C# projects cannot export to Web in Godot 4, so web-only code paths are GDScript only -->\n\nUse feature tags, not `OS.get_name()` string checks:\n\n```gdscript\nfunc _ready() -> void:\n    if OS.has_feature(\"web\"):\n        $QuitButton.hide() # A tab cannot be closed from inside the game.\n        if OS.has_feature(\"web_ios\") or OS.has_feature(\"web_android\"):\n            _use_touch_controls()\n```\n\n`web_android`, `web_ios`, `web_macos`, `web_windows`, and `web_linuxbsd` read the browser's user agent. Use them to pick controls or quality, never as a security check.\n\n`JavaScriptBridge` calls into the page. It exists on every platform but only does something on Web, so guard calls with `OS.has_feature(\"web\")`.\n\n```gdscript\nvar _on_resize_cb: JavaScriptObject # Keep a reference, or the callback is collected and never fires.\n\n\nfunc _ready() -> void:\n    if not OS.has_feature(\"web\"):\n        return\n    var window := JavaScriptBridge.get_interface(\"window\")\n    _on_resize_cb = JavaScriptBridge.create_callback(_on_browser_resize)\n    window.addEventListener(\"resize\", _on_resize_cb)\n    var lang: String = JavaScriptBridge.eval(\"navigator.language\", true)\n    print(\"Browser language: \", lang)\n\n\nfunc _on_browser_resize(args: Array) -> void:\n    print(\"Browser resized: \", args[0].type)\n\n\nfunc export_save_file(data: PackedByteArray) -> void:\n    # Call from an input event (button press): browsers may block downloads that aren't.\n    JavaScriptBridge.download_buffer(data, \"savegame.dat\")\n```\n\nCallbacks receive one `Array` holding the JavaScript arguments. `eval()` runs arbitrary JavaScript — never pass it strings built from player input or network data.\n\nUploads, calling functions defined in your HTML shell, and sending events to the embedding page: [references\u002Fjavascript-bridge.md](references\u002Fjavascript-bridge.md).\n\n---\n\n## 6. Audio\n\n- **Browsers block audio until the player interacts with the page.** Start the game behind a \"Click to play\" screen (or the default loading page's click) so the first sound isn't swallowed.\n- `audio\u002Fgeneral\u002Fdefault_playback_type.web` is **Sample**: sounds are handed to the Web Audio API for low latency. `AudioEffect`s on buses (reverb, filters, `AudioEffectCapture`, `AudioEffectSpectrumAnalyzer`) do not apply in this mode. Forcing **Stream** restores effects at the cost of latency and crackling — test before choosing it.\n- Prefer Ogg Vorbis for music and short WAV for SFX; MP3 also works. See **audio-system** and **assets-pipeline**.\n\n---\n\n## 7. Saving and Persistence\n\n`user:\u002F\u002F` is backed by IndexedDB and synced when a file is closed. `ConfigFile`, `FileAccess`, and `ResourceSaver` work unchanged.\n\n\u003C!-- csharp-parity: n\u002Fa — C# projects cannot export to Web in Godot 4, so web-only code paths are GDScript only -->\n\n```gdscript\nfunc save_settings(cfg: ConfigFile) -> void:\n    cfg.save(\"user:\u002F\u002Fsettings.cfg\") # Flushed to IndexedDB when the file closes.\n    if OS.has_feature(\"web\") and not OS.is_userfs_persistent():\n        $SaveWarning.text = \"Saves won't survive closing this tab (private browsing or storage blocked).\"\n        $SaveWarning.show()\n```\n\n- **Private browsing, storage-blocking settings, and cleared site data wipe `user:\u002F\u002F`.** Check `OS.is_userfs_persistent()` and tell the player.\n- Storage is **per origin**: the same game on another domain (or a new itch.io upload URL) starts with empty saves. Offer export\u002Fimport of save files (Section 5) for anything players would hate to lose.\n- Browsers may evict storage under disk pressure. For accounts and cross-device saves use a backend — see **web-services**.\n\n---\n\n## 8. Input, Window, and Performance Limits\n\n| Behavior | Rule |\n|---|---|\n| Fullscreen, mouse capture, pointer lock, clipboard writes | Only work from inside an input event handler (a click or key press), not from `_ready()` or a timer |\n| Keyboard focus | Lost when the player clicks outside the canvas; keep `html\u002Ffocus_canvas_on_start` on and show a \"click to focus\" hint |\n| Browser shortcuts | `Ctrl+W`, `Ctrl+T`, `F11` and similar may be handled by the browser, not the game — don't bind core actions to them |\n| Frame rate | The browser drives frames with `requestAnimationFrame`; background tabs are throttled or paused, so pause the game on `NOTIFICATION_WM_WINDOW_FOCUS_OUT` |\n| Memory | WebAssembly memory is limited; large levels and uncompressed textures crash low-end and mobile browsers first |\n| Load size | Every megabyte of `.pck` and `.wasm` is downloaded before play — trim unused assets and compress on the server |\n\nLoad-size checklist (export filters, texture formats, custom template builds without unused modules): [references\u002Fhosting.md](references\u002Fhosting.md#reducing-download-size).\n\n---\n\n## 9. Common Pitfalls\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| Blank page, console says `SharedArrayBuffer is not defined` | Threaded build on a server without COOP\u002FCOEP | Export with thread support off, or add the headers |\n| Works locally, fails after upload | The editor's test server sends headers your host doesn't | Test on the real host; ship no-threads |\n| Opening `index.html` from disk fails | Browsers block WebAssembly from `file:\u002F\u002F` | Serve over HTTP, even locally |\n| Game looks flat or dark compared to desktop | Compatibility renderer drops advanced lighting | Bake lightmaps; design for Compatibility (see **rendering-pipeline**) |\n| No sound until the second click | Autoplay policy | Click-to-play screen before the first sound |\n| Reverb\u002Ffilters missing | Sample playback ignores bus effects | Accept it, or use Stream playback for that project |\n| Saves gone next visit | Private window or new origin | Warn via `is_userfs_persistent()`; offer save export |\n| HTTP requests fail only in the browser | CORS or mixed content | Fix server headers; HTTPS\u002FWSS only (see **web-services**) |\n| `request_fullscreen` \u002F mouse capture ignored | Not called from an input event | Trigger it from a button press |\n| Web export fails with \"not supported in Godot 4 when using C#\u002F.NET\" | .NET editor builds cannot target Web | Port to GDScript, or export a GDScript-only project from the standard editor |\n\n---\n\n## 10. Checklist\n\n- [ ] Project designed and lit for the Compatibility renderer\n- [ ] No C# in the project; GDExtension only with `variant\u002Fextensions_support` and web binaries\n- [ ] Thread support off unless needed and the host sends COOP\u002FCOEP (or the PWA service worker handles it)\n- [ ] `vram_texture_compression\u002Ffor_mobile` enabled if phone browsers are a target\n- [ ] Tested on the actual host, not only the editor's Run in Browser server\n- [ ] Click-to-play screen before audio starts; game pauses when the tab loses focus\n- [ ] Fullscreen, mouse capture and downloads triggered from input events\n- [ ] `OS.is_userfs_persistent()` checked; players can export important saves\n- [ ] Quit button hidden on Web; platform checks use `OS.has_feature(\"web\")`\n- [ ] `JavaScriptBridge` callbacks stored in member variables; `eval()` never fed untrusted strings\n- [ ] `.wasm` served as `application\u002Fwasm`; `.wasm` and `.pck` compressed on the server\n- [ ] Download size checked; unused assets excluded from the Web preset\n","# Web Export in Godot 4.3+\n\nShip a Godot 4.x game as HTML5\u002FWebAssembly. This covers what is different from a desktop export: the renderer, threading and server headers, browser interop, persistence, and the input and audio rules browsers enforce. All examples target Godot 4.3+ with no deprecated APIs.\n\n**C# projects cannot export to Web in Godot 4** — the .NET editor refuses the export (still true in 4.7.2). The code in this skill is GDScript only for that reason; a C# game that needs a browser build must be ported to GDScript or stay on Godot 3.\n\n> **Related skills:** **export-pipeline** for presets, CLI export and CI\u002FCD, **web-services** for HTTP and WebSockets from the browser, **rendering-pipeline** for what the Compatibility renderer can and cannot do, **audio-system** for buses and playback, **save-load** for save formats.\n\n---\n\n## 1. What Changes on Web\n\n| Area | On Web |\n|---|---|\n| Renderer | Always **Compatibility** (WebGL 2) — `rendering\u002Frenderer\u002Frendering_method.web` defaults to `gl_compatibility`. No SDFGI, VoxelGI, volumetric fog, SSR, FSR, or screen-space AA |\n| Scripting | GDScript and GDExtension only. No C# |\n| Threads | Optional. Off by default; turning them on needs special server headers (Section 3) |\n| Audio | Sample playback through the Web Audio API by default — `AudioEffect`s on buses do not apply (Section 6) |\n| Files | `user:\u002F\u002F` lives in the browser's IndexedDB; there is no access to the player's disk except downloads and file-picker uploads |\n| Networking | HTTP via the browser's `fetch` (CORS applies), WebSockets and WebRTC only — no raw TCP\u002FUDP, so no ENet |\n| Processes | No `OS.execute()`, `OS.create_process()`, or quitting the tab |\n\nDesign for this from the start if web is a primary target. Porting a Forward+ game late means re-lighting it.\n\n---\n\n## 2. The Export Preset\n\nAdd a **Web** preset in **Project → Export** (export templates must be installed). The options that matter:\n\n| Option | Default | Set it when |\n|---|---|---|\n| `variant\u002Fthread_support` | `false` | You need threads and can serve COOP\u002FCOEP headers (Section 3) |\n| `variant\u002Fextensions_support` | `false` | The project uses GDExtension (needs the extension's web build) |\n| `vram_texture_compression\u002Ffor_desktop` | `true` | S3TC\u002FBPTC textures for desktop browsers |\n| `vram_texture_compression\u002Ffor_mobile` | `false` | Turn on for phone browsers (ETC2\u002FASTC); costs a second texture set in the PCK |\n| `html\u002Fcanvas_resize_policy` | Adaptive | `None` \u002F `Project` when embedding in a fixed-size page element |\n| `html\u002Ffocus_canvas_on_start` | `true` | Keep on so keyboard input works without a first click |\n| `html\u002Fexperimental_virtual_keyboard` | `false` | Mobile browsers need an on-screen keyboard for `LineEdit` |\n| `html\u002Fhead_include` | empty | Extra `\u003Chead>` tags — analytics, meta tags, fonts |\n| `html\u002Fcustom_html_shell` | empty | Replace the whole loading page with your own template |\n| `progressive_web_app\u002Fenabled` | `false` | Installable, offline-capable build (Section 4) |\n| `threads\u002Femscripten_pool_size`, `threads\u002Fgodot_pool_size` (Godot 4.5+) | 8, 4 | Only shown with thread support; lower them to reduce memory |\n\nThe output is an `.html` page plus `.js`, `.wasm`, `.pck`, and audio worklet files — upload all of them together. The default filename for the page should be `index.html` for most hosts.\n\nCLI export works as on desktop: `godot --headless --export-release \"Web\" build\u002Fweb\u002Findex.html`.\n\n---\n\n## 3. Threads or No Threads\n\nThreaded builds use `SharedArrayBuffer`, which browsers only enable on a **cross-origin isolated** page. The server must send both headers on every file of the export (the page, its scripts, and the worker scripts):\n\n```\nCross-Origin-Opener-Policy: same-origin\nCross-Origin-Embedder-Policy: require-corp\n```\n\n| | No threads (default, Godot 4.3+) | Threads |\n|---|---|---|\n| Hosting | Any static host | Needs the two headers above, or the PWA workaround |\n| Audio | Sample playback, low latency | Sample playback by default; stream mode crackles more |\n| Embeds, ads, third-party iframes | Work | Break unless they also send CORP\u002FCORS headers (`require-corp` blocks them) |\n| `WorkerThreadPool` | Tasks run inline on the main thread, so heavy work stalls frames | Real background threads |\n| `Thread` | **`start()` returns `OK` but the function never runs** | Real background threads |\n| Feature tag | `nothreads` | `threads` |\n\n**Default to no threads.** Turn them on only when profiling shows a real need (heavy procedural generation, physics on background threads), and you control the server or use a host that sets the headers. Code that must behave differently can check `OS.has_feature(\"threads\")` — and any `Thread`-based code (level generation, loaders) **must**, or it silently does nothing on the default build. `WorkerThreadPool` is the portable choice.\n\nGodot's own **Remote Debug → Run in Browser** server sends the headers, so a threaded build can work locally and fail once uploaded. Test on the real host.\n\n---\n\n## 4. Hosting\n\n| Host | What to do |\n|---|---|\n| **itch.io** | Upload a ZIP with `index.html` at its root, set the project kind to HTML. For threaded builds tick **SharedArrayBuffer support** in the embed options |\n| **GitHub Pages, plain static hosts** | No custom headers: ship the no-threads build, or enable PWA with `progressive_web_app\u002Fensure_cross_origin_isolation_headers` (default `true`) so a service worker adds the headers after the first load |\n| **Your own server \u002F CDN** | Send COOP\u002FCOEP for threads, serve `.wasm` as `application\u002Fwasm`, and precompress `.wasm` and `.pck` with Brotli or gzip |\n\nServer config snippets (nginx, Apache, Netlify, Cloudflare Pages), compression, and cache headers: [references\u002Fhosting.md](references\u002Fhosting.md).\n\nThe **PWA** option also makes the game installable and playable offline. After you publish an update, `JavaScriptBridge.pwa_needs_update()` turns `true` (and `pwa_update_available` is emitted); call `JavaScriptBridge.pwa_update()` to reload into the new version — it reloads every open tab.\n\n---\n\n## 5. Detecting the Platform and Talking to JavaScript\n\n\u003C!-- csharp-parity: n\u002Fa — C# projects cannot export to Web in Godot 4, so web-only code paths are GDScript only -->\n\nUse feature tags, not `OS.get_name()` string checks:\n\n```gdscript\nfunc _ready() -> void:\n    if OS.has_feature(\"web\"):\n        $QuitButton.hide() # A tab cannot be closed from inside the game.\n        if OS.has_feature(\"web_ios\") or OS.has_feature(\"web_android\"):\n            _use_touch_controls()\n```\n\n`web_android`, `web_ios`, `web_macos`, `web_windows`, and `web_linuxbsd` read the browser's user agent. Use them to pick controls or quality, never as a security check.\n\n`JavaScriptBridge` calls into the page. It exists on every platform but only does something on Web, so guard calls with `OS.has_feature(\"web\")`.\n\n```gdscript\nvar _on_resize_cb: JavaScriptObject # Keep a reference, or the callback is collected and never fires.\n\n\nfunc _ready() -> void:\n    if not OS.has_feature(\"web\"):\n        return\n    var window := JavaScriptBridge.get_interface(\"window\")\n    _on_resize_cb = JavaScriptBridge.create_callback(_on_browser_resize)\n    window.addEventListener(\"resize\", _on_resize_cb)\n    var lang: String = JavaScriptBridge.eval(\"navigator.language\", true)\n    print(\"Browser language: \", lang)\n\n\nfunc _on_browser_resize(args: Array) -> void:\n    print(\"Browser resized: \", args[0].type)\n\n\nfunc export_save_file(data: PackedByteArray) -> void:\n    # Call from an input event (button press): browsers may block downloads that aren't.\n    JavaScriptBridge.download_buffer(data, \"savegame.dat\")\n```\n\nCallbacks receive one `Array` holding the JavaScript arguments. `eval()` runs arbitrary JavaScript — never pass it strings built from player input or network data.\n\nUploads, calling functions defined in your HTML shell, and sending events to the embedding page: [references\u002Fjavascript-bridge.md](references\u002Fjavascript-bridge.md).\n\n---\n\n## 6. Audio\n\n- **Browsers block audio until the player interacts with the page.** Start the game behind a \"Click to play\" screen (or the default loading page's click) so the first sound isn't swallowed.\n- `audio\u002Fgeneral\u002Fdefault_playback_type.web` is **Sample**: sounds are handed to the Web Audio API for low latency. `AudioEffect`s on buses (reverb, filters, `AudioEffectCapture`, `AudioEffectSpectrumAnalyzer`) do not apply in this mode. Forcing **Stream** restores effects at the cost of latency and crackling — test before choosing it.\n- Prefer Ogg Vorbis for music and short WAV for SFX; MP3 also works. See **audio-system** and **assets-pipeline**.\n\n---\n\n## 7. Saving and Persistence\n\n`user:\u002F\u002F` is backed by IndexedDB and synced when a file is closed. `ConfigFile`, `FileAccess`, and `ResourceSaver` work unchanged.\n\n\u003C!-- csharp-parity: n\u002Fa — C# projects cannot export to Web in Godot 4, so web-only code paths are GDScript only -->\n\n```gdscript\nfunc save_settings(cfg: ConfigFile) -> void:\n    cfg.save(\"user:\u002F\u002Fsettings.cfg\") # Flushed to IndexedDB when the file closes.\n    if OS.has_feature(\"web\") and not OS.is_userfs_persistent():\n        $SaveWarning.text = \"Saves won't survive closing this tab (private browsing or storage blocked).\"\n        $SaveWarning.show()\n```\n\n- **Private browsing, storage-blocking settings, and cleared site data wipe `user:\u002F\u002F`.** Check `OS.is_userfs_persistent()` and tell the player.\n- Storage is **per origin**: the same game on another domain (or a new itch.io upload URL) starts with empty saves. Offer export\u002Fimport of save files (Section 5) for anything players would hate to lose.\n- Browsers may evict storage under disk pressure. For accounts and cross-device saves use a backend — see **web-services**.\n\n---\n\n## 8. Input, Window, and Performance Limits\n\n| Behavior | Rule |\n|---|---|\n| Fullscreen, mouse capture, pointer lock, clipboard writes | Only work from inside an input event handler (a click or key press), not from `_ready()` or a timer |\n| Keyboard focus | Lost when the player clicks outside the canvas; keep `html\u002Ffocus_canvas_on_start` on and show a \"click to focus\" hint |\n| Browser shortcuts | `Ctrl+W`, `Ctrl+T`, `F11` and similar may be handled by the browser, not the game — don't bind core actions to them |\n| Frame rate | The browser drives frames with `requestAnimationFrame`; background tabs are throttled or paused, so pause the game on `NOTIFICATION_WM_WINDOW_FOCUS_OUT` |\n| Memory | WebAssembly memory is limited; large levels and uncompressed textures crash low-end and mobile browsers first |\n| Load size | Every megabyte of `.pck` and `.wasm` is downloaded before play — trim unused assets and compress on the server |\n\nLoad-size checklist (export filters, texture formats, custom template builds without unused modules): [references\u002Fhosting.md](references\u002Fhosting.md#reducing-download-size).\n\n---\n\n## 9. Common Pitfalls\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| Blank page, console says `SharedArrayBuffer is not defined` | Threaded build on a server without COOP\u002FCOEP | Export with thread support off, or add the headers |\n| Works locally, fails after upload | The editor's test server sends headers your host doesn't | Test on the real host; ship no-threads |\n| Opening `index.html` from disk fails | Browsers block WebAssembly from `file:\u002F\u002F` | Serve over HTTP, even locally |\n| Game looks flat or dark compared to desktop | Compatibility renderer drops advanced lighting | Bake lightmaps; design for Compatibility (see **rendering-pipeline**) |\n| No sound until the second click | Autoplay policy | Click-to-play screen before the first sound |\n| Reverb\u002Ffilters missing | Sample playback ignores bus effects | Accept it, or use Stream playback for that project |\n| Saves gone next visit | Private window or new origin | Warn via `is_userfs_persistent()`; offer save export |\n| HTTP requests fail only in the browser | CORS or mixed content | Fix server headers; HTTPS\u002FWSS only (see **web-services**) |\n| `request_fullscreen` \u002F mouse capture ignored | Not called from an input event | Trigger it from a button press |\n| Web export fails with \"not supported in Godot 4 when using C#\u002F.NET\" | .NET editor builds cannot target Web | Port to GDScript, or export a GDScript-only project from the standard editor |\n\n---\n\n## 10. Checklist\n\n- [ ] Project designed and lit for the Compatibility renderer\n- [ ] No C# in the project; GDExtension only with `variant\u002Fextensions_support` and web binaries\n- [ ] Thread support off unless needed and the host sends COOP\u002FCOEP (or the PWA service worker handles it)\n- [ ] `vram_texture_compression\u002Ffor_mobile` enabled if phone browsers are a target\n- [ ] Tested on the actual host, not only the editor's Run in Browser server\n- [ ] Click-to-play screen before audio starts; game pauses when the tab loses focus\n- [ ] Fullscreen, mouse capture and downloads triggered from input events\n- [ ] `OS.is_userfs_persistent()` checked; players can export important saves\n- [ ] Quit button hidden on Web; platform checks use `OS.has_feature(\"web\")`\n- [ ] `JavaScriptBridge` callbacks stored in member variables; `eval()` never fed untrusted strings\n- [ ] `.wasm` served as `application\u002Fwasm`; `.wasm` and `.pck` compressed on the server\n- [ ] Download size checked; unused assets excluded from the Web preset\n",{"name":5,"description":7},"master","d7b26cdb5fae14d4ef7b713c5bf259395e75c3c6","skills\u002Fweb-export",63,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter","https:\u002F\u002Fgithub.com\u002Fjame581","https:\u002F\u002Fjanmesarc.online\u002F","Software engineer. My biggest passion is game development.","2026-11-14 20:45:49",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add jame581\u002FGodotPrompter --skill web-export",{"tool":61,"command":62},"bunx","bunx skills add jame581\u002FGodotPrompter --skill web-export",{"tool":64,"command":65},"pnpm","pnpm dlx skills add jame581\u002FGodotPrompter --skill web-export","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-export\u002FSKILL.md",true,[69,75],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fhosting.md","REFERENCE","参考文档",4493,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-export\u002Freferences\u002Fhosting.md",{"path":76,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fjavascript-bridge.md",5453,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-export\u002Freferences\u002Fjavascript-bridge.md",[80,100,119,135,153,169],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":41},"01M6KRFE5BR2PSD08ZKDAS66R7","xr-development","Use when building VR\u002FAR\u002FXR applications — OpenXR setup, XROrigin3D, hand tracking, controllers, passthrough, and Meta Quest deployment in Godot 4.3+","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fxr-development\u002FSKILL.md",[],[87,88,33,23,89,90,91,92,93,94,95,96,97,98,99],"development","xr development","godot","vr","setup","tracking","godot 4","ar","hand","Meta","applications","deployment","quest",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":41},"01M6KRF8GZTG1TAS506MFBSGFC","web-services","Use when a Godot game calls a web server — HTTPRequest, downloads, REST\u002FJSON APIs, auth headers, WebSocketPeer clients, TLS, retries, and keeping secrets out of the build. Not for game networking\u002FRPCs (multiplayer-basics) or browser export (web-export)","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-services\u002FSKILL.md",[],[107,21,108,109,110,111,112,113,33,114,115,116,117,118,28,23,89],"web services","services","calling","secrets","json","build","REST","tls","retries","clients","auth","downloads",{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":41},"01M6KREYFETEBH62ZTN6EZH2X3","using-godot-prompter","Bootstrap skill — establishes how to find and use GodotPrompter skills, with platform-specific tool mapping","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fusing-godot-prompter\u002FSKILL.md",[],[89,126,127,128,129,33,130,131,132,133,134],"using godot prompter","find","with","bootstrap","tool","platform","mapping","how","how to",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":41},"01M6KRER5G7EQWKGAFN8QJKQ69","tween-animation","Use when implementing tweens — property animation, method tweening, chaining, parallel sequences, easing, and common UI\u002Fgameplay motion recipes","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Ftween-animation\u002FSKILL.md",[],[142,143,33,144,23,145,146,147,148,149,150,151,152],"tween animation","Animation","sequences","motion","parallel","gameplay","chaining","ui","recipes","common","implementing",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":41},"01M6KREKGCQMVDV8WX7HWX8BZG","state-machine","Use when building a state machine or refactoring logic into one — enum, node, and resource-based FSM patterns with trade-offs. Not for adding states to an existing one","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fstate-machine\u002FSKILL.md",[],[160,161,162,128,23,89,163,164,165,166,167,33,152,168],"state machine","state","machine","patterns","node","fsm","state machines","trade","trade-offs",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":41},"01M6KREE370Y80QK838PCRBA0S","shader-basics","Use when implementing shaders — Godot shader language, visual shaders, common visual recipes, and post-processing effects","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fshader-basics\u002FSKILL.md",[],[176,177,178,179,152,33,180,151,181,182,150,23,89,183,184,185],"shader","shader basics","basics","processing","post","shaders","post-processing","effects","visual","language"]