electron

Error: EMFILE: too many open files on win

跟風遠走 提交于 2019-12-12 10:14:29
问题 I was building an Vscode-like App, and I wrote my own extension to Vscode and put it into source code, it's work fine. But after I use gulp command to package my app, here is sth wrong :(On mac OS it's worked) [17:07:59] Finished 'optimize-vscode' after 23 s [17:07:59] Starting 'vscode-win32-x64'... [17:08:31] Downloading extension: ms-vscode.node-debug2@1.25.6 ... [17:08:32] Downloading extension: ms-vscode.node-debug@1.25.4 ... events.js:183 throw er; // Unhandled 'error' event ^ Error:

Electron dying without any information, what now?

邮差的信 提交于 2019-12-12 10:00:27
问题 The app I'm building, when I compile it for distribution packing it with electron-builder, every now and then, dies, showing a blank screen and a disconnected devtools: Any ideas what's going on or how to start figuring out what's happening here? 回答1: Listen for the uncaughtException event and log any error that you get. This will give you insight into what is happening. Then perform any cleanup if necessary and relaunch the app if desired. This allows your app to "recover" from crashes if it

Save video blob to filesystem electron/node js

ⅰ亾dé卋堺 提交于 2019-12-12 09:45:20
问题 In my electron application, users can record video from their webcam using the MediaRecorder API. When the user hit the "stop record" button, I get a blob of the recorded video. What i would like to do is to convert this blob to a real webm video and write it into the user's filesystem with for example : fs.writeFile(localdir + '\\video.webm', videoBlob); // does not work The example below works pretty well with base64 image snapshot that I get from the webcam, but i can't make it work with

Atom Electron capture all keyboard events even when app is unfocused

a 夏天 提交于 2019-12-12 09:39:11
问题 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 that solves my problem. 回答1: The closest thing there is to what you're looking for is global shortcuts: https://github.com/electron/electron/blob/master/docs/api/global-shortcut.md. While

TypeError: window.require is not a function

青春壹個敷衍的年華 提交于 2019-12-12 09:37:46
问题 Im trying to build an electron app and want to use window.require. Unfortunately the compiler says "TypeError: window.require is not a function". Ironically require works only in main.js. Here the code Im trying to run: const electron = window.require('electron') const low = window.require('lowdb') const FileSync = window.require('lowdb/adapters/FileSync') I read in another post that somebody have had the same problem and it was fixed by adding this code into the .html file: <script type=

How to getCurrentPosition via navigator.geolocation in Electron app?

一曲冷凌霜 提交于 2019-12-12 09:24:26
问题 When I try to get the current position navigator.geolocation.getCurrentPosition(handleCoordinates, handleError, {timeout:10000}) it returns "Network location provider at 'https://www.googleapis.com/' : Returned error code 400." Can somebody suggest any possible ways? 回答1: You should configure correct google api key to request google related services in chromium. https://github.com/electron/electron/blob/master/docs/api/environment-variables.md#google_api_key https://github.com/electron

Navigate to page after authentication using React Router v4

女生的网名这么多〃 提交于 2019-12-12 08:12:53
问题 I'm trying to navigate to app.js from login.js upon successful authentication. I was able to do this relatively easy using router v3 and browserhistory. I'm not really sure how to navigate pages using router v4 as their methodology seems to be very different and the previous method I used no longer works. I tried referencing this post Navigating Programatically in React-Router v4, but the suggestions didn't work for me. Any advice on how how I can traverse pages in my app with v4? This is an

Access a MySQL Database in Electron

☆樱花仙子☆ 提交于 2019-12-12 07:50:03
问题 I am using Electron to create an app, and wanted to get to select and insert/update some table in a MySQL Database in my localhost, how can I make the connection with the Database ? PS: I am very new to Electron Thank you for your help. 回答1: Electron is the combination of Chromium, the web renderer used in Chrome, and Node.js. Adding Node.js to the mix gives Electron the ability to work with the native OS in ways normal web pages cannot. With Node.js at your disposal you have access to all

How to write commands to a serial port using NodeJs?

橙三吉。 提交于 2019-12-12 06:33:24
问题 Good day everyone, I am having issues writing commands to a lock connected to a USB controller which is connected to the laptop port using NodeJs. I have successfully achieved this in python, but is having issues in nodejs. The reason why I am converting to nodejs is because the entire application is written in nodejs and runs has a desktop app via electron, and opening/closing port is just a small component of it. The python equivalent and which works fine ser = serial.Serial() ser.baudrate

Repeatedly clicking an element on a page using Electron (NightareJS)

陌路散爱 提交于 2019-12-12 06:24:06
问题 I'm writing a page scraper for a dynamic web page. The page has an initial load and then loads the remainder of the content after a short load time. I've accounted for the load and have successfully scraped the HTML from the page, but the page doesn't load ALL the content at once. Instead it loads a specified amount of content via GET request URL and then has a "Get more" button on the page. My objective is to click this "Get More" button until all the content is loaded on the page. For those