electron

Electron整合React使用搭建开发环境

时光怂恿深爱的人放手 提交于 2020-07-23 21:29:17
Electron整合React使用搭建开发环境 博客说明 文章所涉及的资料来自互联网整理和个人总结,意在于个人学习和经验汇总,如有什么地方侵权,请联系本人删除,谢谢! 简介 用于构建用户界面的 JavaScript 库 步骤 首先创建React npx create-react-app doc 进入到doc项目 cd doc 安装electron npm install electron --save-dev 安装依赖 判断是否为生产环境 cnpm install electron-is-dev --save-dev 在项目根目录创建main.js const { app ,BrowserWindow } = require('electron') const isDev = require('electron-is-dev') let mainWindow; app.on('ready', () => { mainWindow = new BrowserWindow({ width: 1024, height: 680, webPreferences:{ nodeIntegration: true, } }) const urlLocation = isDev ? 'http://localhost:3000' : 'dummyurl' mainWindow.loadURL

Setting an env var in package.json for use with electron-reload?

和自甴很熟 提交于 2020-07-21 07:40:19
问题 I usually develop on macOS but I've moved the project over to Windows 10 in order to work on some Windows-specific issues. I use electron-reload to reload the app when changes are made. It's been working wonderfully on macOS but breaks on Windows. Using the setup below, and npm start to start the app, on Windows it throws an error: "'APP__DEV' is not recognized as an internal or external command" Am I doing this wrong and macOS is just more "forgiving"? I saw this question: Setting process

Setting an env var in package.json for use with electron-reload?

别来无恙 提交于 2020-07-21 07:40:07
问题 I usually develop on macOS but I've moved the project over to Windows 10 in order to work on some Windows-specific issues. I use electron-reload to reload the app when changes are made. It's been working wonderfully on macOS but breaks on Windows. Using the setup below, and npm start to start the app, on Windows it throws an error: "'APP__DEV' is not recognized as an internal or external command" Am I doing this wrong and macOS is just more "forgiving"? I saw this question: Setting process

Is sharing Google Analytics tracking id safe?

夙愿已清 提交于 2020-07-21 05:53:08
问题 I currently creating a cross platform desktop application using Electron. I wish to add analytics to view user metrics. When I try to find for existing packages that provides metrics info, I found electron-ga. The package uses GA to track user metrics and to set it up I need to include GA tracking id in my app. My question is, if I include the tracking id in an electron app and distribute my app, everyone can look at the tracking id and steal it right? I would like to know if using this

Is sharing Google Analytics tracking id safe?

烈酒焚心 提交于 2020-07-21 05:52:04
问题 I currently creating a cross platform desktop application using Electron. I wish to add analytics to view user metrics. When I try to find for existing packages that provides metrics info, I found electron-ga. The package uses GA to track user metrics and to set it up I need to include GA tracking id in my app. My question is, if I include the tracking id in an electron app and distribute my app, everyone can look at the tracking id and steal it right? I would like to know if using this

Can't Add Icon To Electron App With Electron Builder

谁都会走 提交于 2020-07-20 07:17:20
问题 I have made an app with Electron and am trying to package it with Electron Builder. Link to repository Does not contain node_modules folder: Repo here I have a folder named build with my icon.ico in it and my package.json is as follows: { "name": "attendant", "productName": "Attendant", "version": "0.1.0", "description": "A simple app to streamline web development by allowing you index.html to open on a live server in the default browser", "main": "main.js", "scripts": { "start": "electron ."

How do I implement Socket.IO in an electron app?

不羁岁月 提交于 2020-07-19 13:55:28
问题 I want to implement Socket.IO in an Electron app, however I have found no documentation and no examples of how this could work. If someone could explain to me how two or more clients could communicate via the electron app, I would be very grateful! 回答1: You know, the electron app will be running at end user. So you should create Socket server at somewhere sth like Cloud server and your electron app should contain one socket.io client instance. At Socket server const app = require('express')()

How do I implement Socket.IO in an electron app?

对着背影说爱祢 提交于 2020-07-19 13:50:34
问题 I want to implement Socket.IO in an Electron app, however I have found no documentation and no examples of how this could work. If someone could explain to me how two or more clients could communicate via the electron app, I would be very grateful! 回答1: You know, the electron app will be running at end user. So you should create Socket server at somewhere sth like Cloud server and your electron app should contain one socket.io client instance. At Socket server const app = require('express')()

How can you get information about other apps running or in focus?

痴心易碎 提交于 2020-07-18 07:26:06
问题 My motivation: I'm writing an app to help with some quantified self / time tracking type things. I'd like to use electron to record information about which app I am currently using. Is there a way to get information about other apps in Electron? Can you at least pull information about another app that currently has focus? For instance, if the user is browsing a webpage in Chrome, it would be great to know that A) they're using chrome and B) the title of the webpage they're viewing. During my

Passing Data to Windows in Electron

匆匆过客 提交于 2020-07-16 16:29:33
问题 I'm learning Electron and working with multiple windows and IPC. In my main script I have the following: var storeWindow = new BrowserWindow({ width: 400, height: 400, show: false }); ipc.on('show-store-edit', function(event, store) { console.log(store); storeWindow.loadURL('file://' + __dirname + '/app/store.html'); storeWindow.show(); }); And in my primary window's script, I have the following inside of a click event handler, pulling in a list of stores: $.getJSON("http://localhost:8080