Skip to content
Advertisement

Tag: electron

Eventlistener function is undefined?

When a button is clicked I want the event listener to be removed. As shown in the code above, removeAllListeners works, however, I do not want all listeners to be removed. I believe I can use removeListener(‘message’, function) but if I try to put removeListener(‘message’, startMe()) I get thrown an error of undefined. How would I go abouts doing this?

Persistent file storage across electon app updates with electron-builder electron-updater

When I update an Electron app using the electron-builder autoUpdater, all the file storage I defined is overwritten. What settings do I need to make these files persist? Here is an MCVE example (for the main process): In this example I’d like the file persistentFile to persist across updates, so that it contains the number generated from the first version.

apis delcared in contextbridge undefined in render process

I’ve been working on updating a electron app from 11.x to 12.x and have run into an issue where the apis declared by contextBridge.exposeInMainWorld come as undefined when called upon through window. This is my preload.js file my app.js I’m lost on why contextBridge doesn’t work. Answer The object passed to the BrowserWindow constructor is not correct. The preload option

electron-builder doesn’t create a release in GitHub when publish is set to always, though there are no errors

I am trying to publish an electron app to my GitHub repository’s releases. Here is my package.json When I run the npm run deploy script, I expect it to create a release called v1.0.1 in the GitHub repository, but nothing happens. electron-builder’s output doesn’t show any error. Here is the console output: As you can see from the last two

How to listen to keyboard events in electron without interrupting default behavior?

I was trying to listen to Ctrl-C event using electron globalShortcut module, but as it seems, electron is re-writing default behavior automatically (without features like preventDefault in plain javascript). Here’s what I did: Is there an another way to listen to global keyboard shortcut events using electron without interrupting their default behavior? Answer This seems to be Electron’s expected behaviour

Blockly doesn’t show anything in the browser

I want to customize blockly but after following instructions from online sources, I don’t see anything appearing in the browser. This is the example code: How can I make the Blockly editor show up? Answer Your Blockly workspace seems fine. The problem is missing CSS to give the editor a height and width so that it’s visible: All I added

Advertisement