Repository navigation
app.getPath not working #13228
Replies: 2 comments
|
| I've left the electron-main.js file untouched as it's auto generated. by Quasar? |
|
Why it looks like a bridge problem: Route it through main: // electron-main.js
ipcMain.handle("path:get", (_e, which) => app.getPath(which));// electron-preload.js
contextBridge.exposeInMainWorld("utils", {
getDocsFolder: () => ipcRenderer.invoke("path:get", "documents"),
});// MainLayout.vue - async now, which is the real API change
const docs = await window.utils.getDocsFolder();Notice what did not get exposed: Two smaller things in your file:
If you want the file to keep the shape you wrote (a plain |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Can someone help explain how to get the method working
app.getPath.I created a brand new quasar project and all i simply want to do is call
app.getPath("documents"). I've created a new file and exposed it through the context bridge, however it always printsapp is undefined.utils.js
electron-preload.js
main.vue
I've left the electron-main.js file untouched as it's auto generated.
All reactions