Use Electron Resources Out of main.js

1

My question is this: Is it possible to call a dialog.showOpenWindow outside the main.js file? I would like to execute a function that when I click on a specific button in my BrowserWindow open the showOpenWindow and return the path of the specified file. I tried doing out of main.js however javascript did not recognize the electron command. Is there any way to do this?

    
asked by anonymous 08.03.2018 / 13:33

1 answer

0

You need to call the dialog using Remote. The remote is just for calling the main features to work inside a Renderer.

I hope I have helped you with your doubts: p

const { remote } = require('electron');
const dialog = remote.dialog;
    
03.07.2018 / 07:14