im triying to open a local file or directory in new electron window like the chrome does.
the new window open with nothing to show:
PDT Im using linux and vscode
new window open
and show this error:
error
the code from the script who launch the window:
function shell(path){
console.log(path);
createWindow = () => {
nombre=tittle(path);
const fileWin = new remote.BrowserWindow({
width: 800,
height: 600,
title: nombre,
resizable: true,
show: true,
webPreferences: {
plugins: true,
contextIsolation: false,
nodeIntegration: true,
enableRemoteModule: true,
webSecurity: false
}
});
remote.require("@electron/remote/main").enable(fileWin.webContents);
fileWin.setMenu(null);
fileWin.setIcon('src/assets/img/logo-FC.png');
fileWin.loadURL('file://'+path);
fileWin.show();
}
createWindow();
}
the variable path is for diferent locations of files or directorys the case of the error examples is:
/home/aromero/Documentos/3225 DOSSIER Julio/0. GENERAL/0.1 CalibraciĆ³n de equipos/HMV
if i put tha link with the ‘file://’ in front in the chrome browser, that display that i want.
chrome explorer