electron

How to run express within electron?

╄→гoц情女王★ 提交于 2019-12-20 10:55:18
问题 I have been able to successfully run express within the electron app via repositories such as https://github.com/theallmightyjohnmanning/electron-express https://github.com/frankhale/electron-with-express However, I was advised not to do so due to the GNU GENERAL PUBLIC LICENSE that they impose. I am trying to create a commercial app that will monetize. Hence, a liscene like MIT might do, but not sure about GNU. Anyhow, I have been trying to follow his procedure: https://gist.github.com

Bringing an electron app to foreground with a global shortcut (like Spotlight/Launchy)

五迷三道 提交于 2019-12-20 10:13:28
问题 I'm looking to replicate behavior similar to that of Launchy/Quicksilver/Spotlight. I want to have an electron app that's always running. When I hit a shortcut key, the electron app is brought to the foreground and to focus. I understand that the globalShortcut module can be used to bind a shortcut, however I can't figure out how to make that shortcut trigger bringing the app to the foreground. Any help would be much appreciated... 回答1: Let's start with the simplest case and then build our

Electron - Download a file to a specific location

坚强是说给别人听的谎言 提交于 2019-12-20 09:54:01
问题 I need to download a file to a specific location in my Electron program. I tried implementing this API but failed. Then I tried implementing the official API, but couldn't realize how to actually start downloading the file. How can I download a file to a specific location, say C:\Folder ? Thanks! 回答1: I ended up using electron-dl. To send a download request (from the renderer.js ): ipcRenderer.send("download", { url: "URL is here", properties: {directory: "Directory is here"} }); In the main

How to persist data in an Electron app?

半腔热情 提交于 2019-12-20 08:24:33
问题 I've been scouring the Electron documentation to try and figure out how to persist data in an Electron app. For example, in iOS or OS X, you could use NSUserDefaults to store user settings and preferences. I would like to do something similar. How can I persist data in an Electron app? 回答1: NeDB is the only suggested or featured tool as an embedded persistent database for Electron by Electron, currently. - http://electron.atom.io/community/ It's also could be useful to store user settings if

Electron+Python软件系统开发记录(一):基础环境搭建

南笙酒味 提交于 2019-12-20 04:48:57
Electron+Python软件系统开发记录(一):基础环境搭建 1.问题说明 最近开始做本科毕设,其中有一部分内容是搭建一个完整的软件系统。系统要求就是常见的客户端,服务器,数据库的整体架构。因为本科不是计算机系的,所以学习的相关技能少,以前写课程设计一般用QT或者MFC,还有Mac的OC语言。本着多学习的态度,这次选用了Electron框架,可以迫使自己学学html,css,js这些东西。后端因为需要大量数据处理和深度学习,因此采用python。这个文档会持续更新,记录自己的系统开发过程。 2.框架简介 Electron 是用js,html,css开发客户端APP的框架。我的理解就是给网页套了个壳,打开桌面软件好像打开了一个chorme一样。 3.通信方式选择 经过调研,发现网上的Electron+python程序实现前后端通信的方式主要有三种: http zerorpc thrift 这里的通信是指桌面端前端和本地后台的通信,用http不太合适,也太笨重了。 跟着网上的demo搞了一天zerorpc这个方式,最后也没成功。大概看了一下,zerorpc其中的依赖zeromq好像已经停止更新维护了。并且其存在很多版本问题,报错说需要abi编号为75的node.js版本,但是我去官网看,最新的一些版本都是79(我用的node12.13.1),再往前是72,没有75的

electron-builder is not bundling the python files

。_饼干妹妹 提交于 2019-12-20 03:44:06
问题 This is my directory structure where renderer.js is included by index.html . The python scripts visitor.py and download.py are called from renderer.js via python-shell. Once I bundle, it is not able to find the python scripts |_ index.html |_ styles.css |_ main.js |_ package.json |_ dist/ |_ node_modules/ |_ renderer.js |_ visitor.py |_ download.py I tried putting everything in files: [...] in package.json under build > files and then ran npm run dist . I also tried copying python files to

require() not defined in Electron HTML page

谁说我不能喝 提交于 2019-12-20 03:36:17
问题 I'm currently unable to load Electron modules in Javascript files outside of the main.js file. I'm trying to use: const electron = require('electron'); const ipcRenderer = electron.ipcRenderer; in a file called settings.js. I have the correct NPM modules installed (eletron-prebuilt). The settings page is loaded in a webview like so: <webview id="settings" src="./settings.html"></webview> and the settings.js included like: <script type='text/javascript' src='./resources/js/settings.js'><

Electron cookie

纵然是瞬间 提交于 2019-12-20 03:17:39
问题 For electron cookie I used https://www.npmjs.com/package/electron-cookies Then added this into my html <script type="text/javascript"> require('electron-cookies') function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function getCookie12(name) { var regexp = new RegExp("(?:^" + name + "|;\s*"+

Pass arguments to packaged electron application

╄→гoц情女王★ 提交于 2019-12-20 01:33:36
问题 We're using electron-packager to bundle up and distribute the front-end of our web application. We need to be able to pass in the host and port of the server to the electron front-end for connecting. When we launch via electron main.js --host blah --port 8080 it works. Once it's packaged, we run via ./MyApp --host blah --port 8080 and it doesn't work. This is bad because we don't want customers to need to install electron/npm itself. Also worth noting is that this happens whether we package

How to debug an app with Electron and Angular from Visual Studio Code?

戏子无情 提交于 2019-12-19 17:43:18
问题 I'm trying to develop a very simple app using the latest versions of Angular and Electron. For this, I followed the tutorials of Angular and Electron. After a lot of trial and error, finally I can start my application (source code on GitHub). I use Visual Studio Code and when setting a breakpoint in my TypeScript code, it never get's hit when debugging my Electron application. For this, I've configured launch.json as follows: { "version": "0.2.0", "configurations": [ { "type": "node",