You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
599 B
17 lines
599 B
'use strict' |
|
|
|
const { contextBridge, ipcRenderer } = require('electron') |
|
|
|
try { |
|
contextBridge.exposeInMainWorld('imwaldElectron', { |
|
isElectron: true, |
|
reloadApp: () => ipcRenderer.invoke('imwald:reload-app'), |
|
/** |
|
* Same-origin translate / LanguageTool from the renderer hits CORS when the shell is loopback. |
|
* Main process performs the HTTP(S) request (allowlisted host + path only). |
|
*/ |
|
backendRequest: (payload) => ipcRenderer.invoke('imwald:backend-request', payload) |
|
}) |
|
} catch (err) { |
|
console.error('[imwald] preload: failed to expose imwaldElectron', err) |
|
}
|
|
|