fix: WASM import path respects __WZP_BASE_URL for cross-origin loading

When variant JS is loaded from featherChat (different origin), WASM
imports need to resolve via the /audio/ Caddy path, not root /.
All 4 variant files now use: (window.__WZP_BASE_URL || '') + '/wasm/...'

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-30 16:12:35 +04:00
parent 2de6e19956
commit 1d33f3ed4e
4 changed files with 4 additions and 4 deletions

View File

@@ -15,7 +15,7 @@
'use strict'; 'use strict';
const WZP_WASM_PATH = '/wasm/wzp_wasm.js'; const WZP_WASM_PATH = (window.__WZP_BASE_URL || '') + '/wasm/wzp_wasm.js';
// 12-byte MediaHeader size (matches wzp-proto MediaHeader::WIRE_SIZE). // 12-byte MediaHeader size (matches wzp-proto MediaHeader::WIRE_SIZE).
const MEDIA_HEADER_SIZE = 12; const MEDIA_HEADER_SIZE = 12;

View File

@@ -10,7 +10,7 @@
'use strict'; 'use strict';
// WASM module path (served from /wasm/ by the wzp-web bridge). // WASM module path (served from /wasm/ by the wzp-web bridge).
const WZP_WASM_PATH = '/wasm/wzp_wasm.js'; const WZP_WASM_PATH = (window.__WZP_BASE_URL || '') + '/wasm/wzp_wasm.js';
class WZPHybridClient { class WZPHybridClient {
/** /**

View File

@@ -7,7 +7,7 @@
'use strict'; 'use strict';
// WASM module path (served from /wasm/ by the wzp-web bridge). // WASM module path (served from /wasm/ by the wzp-web bridge).
const WZP_WS_FEC_WASM_PATH = '/wasm/wzp_wasm.js'; const WZP_WS_FEC_WASM_PATH = (window.__WZP_BASE_URL || '') + '/wasm/wzp_wasm.js';
// 12-byte MediaHeader size (matches wzp-proto MediaHeader::WIRE_SIZE). // 12-byte MediaHeader size (matches wzp-proto MediaHeader::WIRE_SIZE).
const WZP_WS_FEC_HEADER_SIZE = 12; const WZP_WS_FEC_HEADER_SIZE = 12;

View File

@@ -7,7 +7,7 @@
'use strict'; 'use strict';
// WASM module path (served from /wasm/ by the wzp-web bridge). // WASM module path (served from /wasm/ by the wzp-web bridge).
const WZP_WS_FULL_WASM_PATH = '/wasm/wzp_wasm.js'; const WZP_WS_FULL_WASM_PATH = (window.__WZP_BASE_URL || '') + '/wasm/wzp_wasm.js';
// 12-byte MediaHeader size (matches wzp-proto MediaHeader::WIRE_SIZE). // 12-byte MediaHeader size (matches wzp-proto MediaHeader::WIRE_SIZE).
const WZP_WS_FULL_HEADER_SIZE = 12; const WZP_WS_FULL_HEADER_SIZE = 12;