feat(preload): expose architecture detection to renderer process

add multiarch support
This commit is contained in:
Elysia
2026-01-31 10:26:52 +08:00
parent 698c0b5420
commit 5b09dfb3d9
8 changed files with 24 additions and 14 deletions

View File

@@ -23,6 +23,17 @@ contextBridge.exposeInMainWorld('ipcRenderer', {
// ...
})
contextBridge.exposeInMainWorld('apm_store', {
arch: (() => {
const arch = process.arch;
if (arch === 'x64') {
return 'amd64' + '-apm';
} else {
return arch + '-apm';
}
})()
});
// --------- Preload scripts loading ---------
function domReady(condition: DocumentReadyState[] = ['complete', 'interactive']) {
return new Promise((resolve) => {