electron

electron and node on windows, kill a spawned process

自作多情 提交于 2020-05-28 19:24:38
问题 i'm starting a background process (on windows) from electron main, something like this: app_exe = require("child_process").spawn( "app.exe" , [ "--params", ... ], { stdio: "ignore" } ); this works fine, i can see this from process explorer: but i cannot kill the process when the electron is closed ( .on("closed") or on("window-all-closed") ) i tried child.kill([signal]) , but also tree-kill or taskkill with no results: only the first process (6036 from the example) is killed, the second (5760

How to include Chrome DevTools in Electron?

泪湿孤枕 提交于 2020-05-21 03:50:05
问题 I'm still new to Electron which I'm currently following here. I've read this page regarding on how to include the Chrome DevTools so that I can debug my application easily. I've followed the documentation but once I execute the electron <app-name> command it returns an error: The app provided is not a valid electron app, please read the docs on how to write one... Here's the block of code from my main.js file: var app = require('app'); var BrowserWindow = require('browser-window'); // Add

Read/Write data returns null - Unable to perform any operations - node serialport

耗尽温柔 提交于 2020-05-17 07:04:45
问题 I am working with serialport for the first time and trying to establish a read and write connection with an UART device which is a controller of a height adjustment desk by using the below method. The application is a desktop application using electron. const SerialPort = require('serialport') const Readline = require('@serialport/parser-readline') const parser = new Readline() const port = new SerialPort("COM4", { baudRate: 9600 }) This is the code I have used and port.read() always returns

How to manage form submission in an Electron desktop app?

孤者浪人 提交于 2020-05-17 03:24:49
问题 I have read this question but the way to manage a form in electron is still unclear to me. Currently, I am using the code below and I want to store the data using dexie.js when a user submits the form, but I'm not able to figure out how to retrieve the data when using Vue. My main process file contains this code: // main.js const electron = require('electron'); const { app, BrowserWindow, ipcMain } = electron; function createWindow(){ let win = new BrowserWindow({ width: 800, height: 600,

Error Message: It looks like you are missing some dependencies you need to get Electron running

天大地大妈咪最大 提交于 2020-05-16 06:32:31
问题 After globally installing electron-forge with npm install -g electron-forge any command I enter in the terminal related to electron-forge gives me the following message: It seems like it's missing some dependencies you need to run Electron. Make sure you have git and Node.js version 6.0.0+ installed I don't know why it tells me that it is missing git and Node which both installed both locally and globally versions 0.1.5 and 14.0.0 respectively. 回答1: git 0.1.5 is a partial implementation of

Electron set cookie

不想你离开。 提交于 2020-05-16 04:16:08
问题 I am new to electron and converting an web app to desktop application.I am loading pages from file system.Cookies are working if pages are served from web server but when I load pages from local folder I am not able to save them. I am saving cookie using document.cookie in web.I want to know how I can I enable file:// cookies in electron . Regards 回答1: Follow the documentation to get it done, and use the standard.https://electronjs.org/docs/api/cookies const {session} = require('electron') //

Typescript & Electron exports is not defined

≡放荡痞女 提交于 2020-05-15 06:45:24
问题 I'm trying to run my simple electron app. I use Typescript as a development language which compiles into JavaScript. When I run the app I get the following error: ReferenceError: exports is not defined[Learn More] file:///Users/ahmet/Documents/JumbleUp-Desktop/dist/Login/Login.js:5 exports.__esModule = true; My login.ts file looks like this import firebase from "firebase"; firebase.auth().onAuthStateChanged(function(user) { if (user) { location.replace("index.html"); } else { location.replace

electron-vue项目打包踩坑指南

此生再无相见时 提交于 2020-05-09 08:16:12
  配置 " build " : { " productName " : " xxxx " , // 项目名 这也是生成的exe文件的前缀名 " appId " : " com.leon.xxxxx " , // 包名 " copyright " : " xxxx " , // 版权 信息 " directories " : { // 输出文件夹 " output " : " build " }, " nsis " : { " oneClick " : false , // 是否一键安装 " allowElevation " : true , // 允许请求提升。 如果为false,则用户必须使用提升的权限重新启动安装程序。 " allowToChangeInstallationDirectory " : true , // 允许修改安装目录 " installerIcon " : " ./build/icons/aaa.ico " , // 安装图标 " uninstallerIcon " : " ./build/icons/bbb.ico " , // 卸载图标 " installerHeaderIcon " : " ./build/icons/aaa.ico " , // 安装时头部图标 " createDesktopShortcut " : true , // 创建桌面图标

Electron Dialog saving file not working

微笑、不失礼 提交于 2020-05-09 06:46:32
问题 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: const {dialog} = require("electron").remote; dialog.showSaveDialog(myObj) A new windows is opening, I fill the name of the file but nothing has been saving. 回答1: The showSaveDialog() API does not save the file for you. You must use the returned path and use Node to save your file. const {dialog} = require("electron").remote; const fs = require('fs'); var savePath =

使用electron-vue搭建桌面应用程序项目

五迷三道 提交于 2020-05-07 21:22:49
vue-cli+electron一种新的脚手架(vue-electron) vue-electron主要业务逻辑都放在src下的renderer文件夹内,和之前的vue-cli搭建项目流程没有任何区别 GIT地址: https://github.com/SimulatedGREG/electron-vue 搭建项目:   1.全局安装脚手架: npm install -- global vue-cli   2.创建项目: //demo06 是项目名称 vue init simulatedgreg/electron-vue demo06 3.cd到项目文件里面,安装依赖: cd demo06 npm install 4.启动这个项目: npm run dev 启动成功之后会自动跳出程序窗口 到此项目结构就搭建好了 关于打包的后面再整理 原文出处:https://www.cnblogs.com/wuhefeng/p/10576034.html 来源: oschina 链接: https://my.oschina.net/u/4411978/blog/3267645