I am looking for a way to update the badge value of a MAC application based on information provided in the page loaded by electron.
I am loading the page at startup using the following code in the main.js
file.
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({width: 1280, height: 800, show:false})
// and load the index.html of the app.
mainWindow.loadURL('https://myapp/Home.html');
The page loaded 'https://myapp/Home.html' has an hidden input variable with the number of notifications that would need to be updated on the electon badge
How can I call the variable from the main.js file and update the badge using ?
app.on('ready', app.setBadgeCount(Html_Hidden_Variable))
Please let me know as well is this is the correct way to proceed knowing that I would like to avoid to have to create and additional call the the DB of the application.
Thanks for your help in advance.