Parameters support web wasm scenarios

This commit is contained in:
Tw93
2025-08-23 18:26:42 +08:00
parent 11737dbe68
commit 5c920cbd43
11 changed files with 81 additions and 17 deletions

12
bin/helpers/merge.ts vendored
View File

@@ -60,6 +60,7 @@ export async function mergeConfig(
hideOnClose,
incognito,
title,
wasm,
} = options;
const { platform } = process;
@@ -78,6 +79,7 @@ export async function mergeConfig(
hide_on_close: hideOnClose,
incognito: incognito,
title: title || null,
enable_wasm: wasm,
};
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
@@ -312,6 +314,16 @@ StartupNotify=true
}
tauriConf.pake.proxy_url = proxyUrl || '';
// Configure WASM support with required HTTP headers
if (wasm) {
tauriConf.app.security = {
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp'
}
};
}
// Save config file.
const platformConfigPaths: PlatformMap = {
win32: 'tauri.windows.conf.json',