electron

How to execute locally installed Node.js application by child_process.spawn()?

泪湿孤枕 提交于 2019-12-07 09:33:42
I want to execute the Electron application by child_process.spawn : import ChildProcess, {ChildProcess as ChildProcess__type} from 'child_process'; const childProcess: ChildProcess__type = ChildProcess.spawn( 'electron', ['ProjectInitializer__ElectronMain.js'], { cwd: __dirname } // current project root ); I got Error: spawn electron ENOENT error. Electron has been installed locally, AFAIK is the good practice. Also, electron ProjectInitializer__ElectronMain.js works, it to execute this console command from my project directory. Following frequently up-voted ENOENT error debugging guidance , I

Disable backspace in Atom-shell

牧云@^-^@ 提交于 2019-12-07 07:53:12
问题 I've been scouring the interwebz and Atom-shell documentation trying to find out how to disable the back() functionality of the backspace key within a browser window. I would prefer not to have to resort to a javascript onkeydown listener (which works) and rather use something more native and at more of the application level instead of the browser window level. 回答1: The only way I have figured out to do this without the onkeydown listener is with a global-shortcut and the ipc events in the

Overlay Electron

五迷三道 提交于 2019-12-07 07:51:28
问题 I am wondering if it is possible to overlay an application made in electron over a game. essentially similar to how steam overlays in games. I want this because we have made a timer web app that times tasks and are debating making it an overlay if possible. to time certain events in games that reoccur I have no idea if this can be achieved but it is something high on our list. Any example of how this can be achieved or has anyone done this before. Thanks, Kieran 回答1: To draw overlay in a game

ipcRenderer in React component constructor

…衆ロ難τιáo~ 提交于 2019-12-07 07:07:14
问题 I have an app using Electron, React, and React Router. I'm using ipcRenderer in the component constructor to send events from my component to the main Electron process. After I added React Router to the mix, I noticed that my ipcRenderer event was getting added again and again each time I left and came back to the component. I figure it's because React Router is mounting and unmounting the component as needed. I found a way around the issue by checking if the event already has been registered

Display .icns file in electron renderer process

霸气de小男生 提交于 2019-12-07 04:56:50
问题 I'm looking for a way to display .icns files in electron renderer. In osx all icons (system icons, applications icons) stored in .icns format. I need to show these icons in my electron application. Currently, when I need to show an icon, I'm converting it to png on-the-fly and show converted result using <img /> tag. Problem that it is super slow. Also, since all icons are stored in this format and all apps use it, there should be a fast native way to display them. Any ideas on how can I use

Importing node modules with electron and Systemjs

a 夏天 提交于 2019-12-07 04:51:23
问题 I just wondered if it is possible to make systemjs use require("remote").require("nodemodule"), if system js can't find the module in its own registry? I think something like this mechanism is already working when using electron with typescript and commonjs modules... Has someone already solved that struggle? 回答1: Finally after some time I found a working solution: var node_modules = ["child_process","fs"]; var fetch = System.fetch; window.remote=require("remote"); System.fetch = function ()

Context menu click/open event with Atom Shell/Electron?

江枫思渺然 提交于 2019-12-07 04:07:09
问题 I'm trying to capture the click even on a tray icon click with a context menu on OSX, but according to the docs this is disabled in OSX for some reason: Platform limitations: On OS X clicked event will be ignored if the tray icon has context menu. I've wondering if there is another way to know when a tray icon with a context menu is interacted with? Relavent code: var app = require('app'); var path = require('path') var Menu = require('menu'); var MenuItem = require('menu-item'); var Tray =

Electron - Can my app communicate with the main and renderer processes?

寵の児 提交于 2019-12-07 04:04:18
问题 I have written a very, very basic electron application - The standard hello world type, where you basically have a HTML file which says "Hello, World" - and that lives in the "app" directory within electron, and then is loaded via main.js when you run the app. Now, lets say I want to be able to maybe communicate with either of those processes (main, or renderer, preferably both!) from the javascript within my application, can that be done? I can't really find anything online about it - but my

electron error AVDCreateGPUAccelerator: Error loading GPU renderer

主宰稳场 提交于 2019-12-07 03:32:07
问题 I'm attempting my first electron App. Does anyone know why i get this error AVDCreateGPUAccelerator: Error loading GPU renderer in the terminal when i do npm start ? It doesn't seem to effect anything yet. I've gotten it right from the beginning of my install using the quick start guide. Will it effect me down the road? mac pro late 2013 2.7 GHz 12-Core Intel Xeon E5 128 GB 800 MHz DDR3 ECC AMD FirePro D700 6144 MB 回答1: Most likely the AVDCreateGPUAccelerator error is because the Xeon CPUs

ES6 is not supported after Electron packaging

ε祈祈猫儿з 提交于 2019-12-07 03:14:51
问题 I'm using various ES6 syntax (such as import etc.) & React code (JSX) in my Electron-based application. During the development, I'm using the electron-prebuilt-compile package (as a dev-dependency ) in order to support these new features and it works perfectly fine without any errors. But after packaging my app using the electron-packager package and running the distributable application file, I experiencing unsupported ES6-related errors such as: Unexpected token import That's is how I run