1 pièce(s) jointe(s)
TypeError: Cannot read property
Bonjour, je crée une app Electron avec notamment un fichier "secondary.html" et un fichier "main.js" dans lequel j'ai créé une fonction JS SetInterval et SetTimeout qui sert à ouvrir et à fermer ma fenêtre "secondary.html" de façon récursive :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| // Load index.html into the new BrowserWindow
mainWindow.loadFile('index.html')
setInterval(function () {
secondaryWindow.loadFile('secondary.html')
secondaryWindow.show()
console.log('yep!')
setTimeout(function () {
secondaryWindow.close()
secondaryWindow = null
}, 6000);
}, 12000); |
Au lancement, ma fenêtre (secondary.html) s'ouvre et puis se ferme convenablement une première fois mais ensuite je reçois ce message d'erreur: