I tried getting the length of the windows availabale in my electron application using BrowserWindow in my preload.js file.
But it gives me an error saying
Uncaught Error: Cannot read properties of undefined (reading 'getAllWindows')
This is my code:
const{ipcRenderer,contextBridge,BrowserWindow} = require("electron")
console.log(BrowserWindow.getAllWindows().length)