electron

Why is Babel needed in an Electron project

ぐ巨炮叔叔 提交于 2019-12-23 20:39:10
问题 I'm quite confused about all the Javascript ecosystem. I'm trying Electron that seems a promising way in creating cross platform apps, leveraging the power of node and Chrome. I create a small app and used some "modern" ( this make a C# programmer laughing ) javascript concepts as lambdas, and it worked out of the box ( I supposed it was natural, since I've the latest version of node ). Then I'm trying to move next, and I see a lot of boilerplating in the examples using for example Babel. Why

How to get dev tools in built electron app?

て烟熏妆下的殇ゞ 提交于 2019-12-23 17:37:42
问题 Is it possible to show the dev tools within a built electron app? The executable that I built using electron-packager is behaving differently from the app run using electron at the command line, and I have no way to see what kinds of exceptions are being thrown. 回答1: Yes it's possible to show the DevTools in a packaged app, just call someBrowserWindow.webContents.openDevTools() . If you want a menu item and/or keyboard shortcut to do it then you'll need to create and set your own menu for the

NEDB persistance in Electron app

久未见 提交于 2019-12-23 17:10:42
问题 I am trying to connect to nedb from electron app. CRUD operations work great. BUT I don't see db file (D:/my.db, checked for hidden files). File exists somewhere, because it keeps data even after machine reboot. I suspect that electron threats my path as relative, but I can find it anywhere. var Datastore = require('nedb'), db = new Datastore({filename : 'D:/my.db', autoload: true}); var doc = { hello: 'world' , n: 5 , today: new Date() , nedbIsAwesome: true , notthere: null , notToBeSaved:

Leaflet flipping tiles in electron

家住魔仙堡 提交于 2019-12-23 17:04:06
问题 Hey im new to electron but i want to use Leaflet inside it to some magic mapping stuff. I created an basic electron application with the index.js according to the basic example. I added also an basic index.hetml: <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <div id="map"></div> </body> <script> require('./renderer') </script> </html> And the Leaflet stuff inside the renderer.js window.L = require('leaflet') var map = L.map('map').setView([51.0420175, 13.7358889], 12)

How connect to proxy in electron webview-dynamically

怎甘沉沦 提交于 2019-12-23 15:44:34
问题 I am creating simple web browser using Electron. My use case is I need to route each URL via different/respective proxy-IPs. If the user type google.com it has to route via 123.123.122.1:8081 and if he type gmail.com it has to route via 111.111.111.123:8080 [Proxy/Port].I saw this http://stackoverflow.com/questions/37393248/how-connect-to-proxy-in-electron-webview?rq=1 but it will not change proxy dynamically. Is it possible to do it in electron. 回答1: There are two ways to solve this problem.

How to get actual line # within source (for custom logging) in TypeScript

青春壹個敷衍的年華 提交于 2019-12-23 14:55:10
问题 Referencing this question I am using this bit of code to find the line number of the caller to my custom logging function: /** * eLog - displays calling line number & message & dumps vars as pretty json string * @param {string} msg - string to display in log message * @param {any} dispVars - any number of variables (ellipsis , aka Rest parameters) to dump */ function eLog(msg:string,...dispVars:any[]){ let caller_line = (new Error).stack.split("\n")[4]; console.log(`eLog->Line#${caller_line}-

In Electron process.stderr is not defined

北慕城南 提交于 2019-12-23 12:21:00
问题 I'm trying to use sqlite3 nodejs add-on in my Electron app. I encountered an error while just loading the sqlite3 module. Looking at the stack trace of the crash I see that sqlite3 has several dependencies and one of them being a logging library (npmlog). This library tries to initialize some logging objects from process.stderr . It crashes because process.stderr is undefined. When I check the value of process.stderr from DevConsole, I see that it's indeed undefined. Looking at the Electron

Electron JS - Deep Linking - Example of how to use deep linking

北城余情 提交于 2019-12-23 08:37:13
问题 In Electron JS, I created an app for Windows and registered my own protocol for deep linking. The app properly opens when clicking on my link ludo://play?level=1234 . No problem there. However I don't know how to retrieve the deep link inside of my app. The docs for app.setAsDefaultProtocolClient mention this sentence: The whole link, including protocol, will be passed to your application as a parameter. Can anyone tell me how to retrieve that? Because it is not in process.argv nor is it in

Stacking of Context Menus in Electron

风流意气都作罢 提交于 2019-12-23 07:27:38
问题 I am building an Electron based application that contains a grid containing unique rows. I would like a context-menu that is specific to each row. Here is an example: Although this screen shot is cropped, you can see there are multiple rows and each row contains separate data. Since I'd like to right-click on a row and get a unique context menu, I have implemented electron-context-menu, which does work on the first right click, but then subsequent right-clicks causes a stacking effect of

Node child process exits immediately after packing the electron app

北城余情 提交于 2019-12-23 05:00:26
问题 I have this piece of code in the GUI part of my electron app which works perfectly alright when run from the terminal. I have packaged the app using 'electron-packager', then I started getting some issue. Initially, the child process was terminating immediately and giving code 127 which I resolved by using 'fix-path' module as discussed here. https://github.com/electron/electron/issues/7688 Even after this, the process exits immediately with a code 1, I am unable to resolve this as there is