✨ Parameters support web wasm scenarios
This commit is contained in:
12
bin/helpers/merge.ts
vendored
12
bin/helpers/merge.ts
vendored
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user