Expose __dirname in userland

This commit is contained in:
Jaifroid 2024-01-06 17:23:04 +00:00
parent 988095fde5
commit 8b5763f9f8

View File

@ -39,6 +39,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
ipcRenderer.send('open-external', url); ipcRenderer.send('open-external', url);
}, },
isMicrosoftStoreApp: process.windowsStore && regexpInstalledFromMicrosoftStore.test(__dirname), isMicrosoftStoreApp: process.windowsStore && regexpInstalledFromMicrosoftStore.test(__dirname),
__dirname: __dirname,
on: function (event, callback) { on: function (event, callback) {
ipcRenderer.on(event, function (_, data1, data2) { ipcRenderer.on(event, function (_, data1, data2) {
callback(data1, data2); callback(data1, data2);