I have an electron project when I need to get electron to read a local file. Right now what I have is this, where it loads and displays the contents of a html file. I just need it to read a file and store it on a variable for now. Here is my current main.js: How can I do this
Tag: electron
Avoiding circular dependencies with Node require()?
I’m having a problem where I have an Electron app, we’ll say contained in files index.html and app.js. app.js is included in index.html with a script tag. Within app.js, I use var ENGINE = require(“./myGameEngine/”); which then requires different classes, each in their own file. It looks something like this: Unfortunately, sometimes ClassA, needs to use new myEngine.ClassB(). For example,
Save loaded HTML file from electron app
I am trying to explore electron and trying to make a simple Mac application. The problem is that I wanted to save the loaded HTML when user closes the application, and upon next start of application the saved html will be loaded. Now, consider following case: The html which i have loaded initially have some table and items, and during
Atom Electron capture all keyboard events even when app is unfocused
I would like to know if there is a way to make an application with Atom Electron that runs and gets my keyboard events when the user is/isn’t focused on my app. For example if he is on Chrome and writes something, my app will store all the keys that he pressed. I searched a little but didn’t find something
Electron Dialog not saving the file
Electron version: 1.3.3 Operating system: Ubuntu 14.04 I want to save a XML object into a .xml file with Electron. I try this: A new windows is opening, I fill the name of the file but nothing has been saving. Answer The showSaveDialog() API does not save the file for you. You must use the returned path and use Node
Download game with electron / detect game version with electron
I have to build a game launcher with electron. I have two questions: Which way to download file from client (angularjs)? ftp? http? how can I detect the game version to update it? Answer With electron you can use all the APIs Node.js have additional to the APIs Chrome have. So you can Download the game useing ftp or http
How to use FS module inside Electron.AtomWebPack application?
I need write some data in the file, using FS module (fs.writeFile). My stack is webpack + react + redux + electron. The first problem was: Cannot resolve module ‘fs’. I tried to use After several attempts, the problem is resolved ( node: {fs: “empty”} ). But then there was a second problem: screenshot. You can see, that fs is
Requiring electron dialog from render process is undefined
I am using electron and am trying to open a file browser when a user clicks on button. From the render process I am trying to include the elctron.dialog package like this. However the result from the console log is undefined I am absolutely sure I am in the rendering process so I am not sure why this is not
Electron Uncaught Error: A dynamic link library (DLL) initialization routine failed
I’ve successfully built node.js addon, which works well with Node on Windows. Now, I want to create a Windows app using Electron. When loading the module in HTML file, I got the error: Something wrong with ATOM_SHELL_ASAR.js. The issue only occurred on Windows. On Linux and Mac, it worked well. How can I fix it? Thanks! Answer You need to
Saving JSON in Electron
I am building an app using Electron. In this app, I am building a data structure using JSON. My data structure looks like this: I want to save this JSON to a file called “data.json”. I want to save it to a file because I want to load the next time the application starts. My challenge is, I do not