mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 01:10:16 +08:00
feat(preload): expose architecture detection to renderer process
add multiarch support
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user