Months ago I built an electron app that scrapes data from a web page using selenium and then visualizes it inside the electron webpage and everything worked fine. After a few months of not using it, I’m having trouble because of many breaking changes inside electron and selenium themselves. The major breaking change is that is not possible to start
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?
Should I use worker or child processes to run my function?
I have two files, main.js and job.js. When a button is clicked in main.js, I want a new, seperate process of the function in job.js to run. What this process does is launch a new puppeteer browser instance. When the stop button is clicked, this process should be killed by pid. (For this we use process.kill(child.pid)?) So would I want
electron js – cannot get button to perform simple actions from click
Long story short I am working on a single page application that sends commands over a local network. Testing out Electron JS and I can’t even seem to get a simple button to work. I feel like I am not linking the logic between main.js and index.js somehow but for the life of me I cannot figure out the correct
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
nodejs sqlite 3 “SQLITE_MISUSE: Database handle is closed” db.run within db.all
So I am trying the following: This results in “SQLITE_MISUSE: Database handle is closed” Apparently I cannot run the UPDATE query within the db.all callback. But why is that so? Answer You should put the second query as an argument to db.serialize(). Then it will wait for it to complete before returning and allowing db.close() to run.