electron

how to clear user data while delete mac electron app from application directly?

為{幸葍}努か 提交于 2021-02-20 02:52:27
问题 how to delete user data while deleting the macos electron app? It seems we need to write a daemon to listen to the folders change, but how to do? do you have more clear or easier methods to handle it? packaging used electron-builder. 回答1: I use electron-localstorage to set one flag into app, while everytime you start app, which will check if the flag can get from app, if not, this was new installed and opend first time, so it will clear the old userdata. const userDataPath = app.getPath(

Electron tray app position on Mac OS

一曲冷凌霜 提交于 2021-02-19 07:56:09
问题 I am building an electron tray app for Mac OS. Everything seems okay, but if I run the app on one desktop and then switch to another, when I click on app icon, app returns me back to place where it was launched. How can I fix it to be open on every desktop? Thanks in advance // Sets variables (const) const {app, BrowserWindow, ipcMain, Tray} = require('electron') const path = require('path') const assetsDirectory = path.join(__dirname, 'img') let tray = undefined let window = undefined // Don

As an electron client, is there a way I can make session persist after an app close?

淺唱寂寞╮ 提交于 2021-02-19 05:35:23
问题 I have a couple of sites that I visit regularly. In fact, so much so, that I like to have a small electron app on my machine to check for updates (since the site doesn't support email updates or anything of that nature). My script basically just launches a browser, retrieves web content for the site, logs it to a file, and then checks for differences. It then notifies me of a difference, if there is one. The catch, though, is that while a given browser window is open (even if I close the

child_process.fork() in Electron

我只是一个虾纸丫 提交于 2021-02-19 04:46:05
问题 Is it possible to fork a child_process from an electron render process? I found some posts across the net, but there were no hint how helps me to get my code working. I created a module, that fork child processes. This code works, when I run this with cmd and under node. But when I try to integrate it in my electron app, I can not communicate with the child.send() method. // create fork const fork = require('child_process').fork; const fs = require('fs'); const img_path = [ 'path/to/an/image1

How to get rounded corners on an Electron app?

北城余情 提交于 2021-02-18 22:13:46
问题 I am currently trying to get rounded corners on an Electron application I'm making. I have tried nearly every solution available on-line at the moment, but none of them make any difference. How can I round the corners of my Electron app? 回答1: Make a frameless transparent window const myWindow = new BrowserWindow({ transparent: true, frame: false }) And have something like this in the renderer, or apply the style directly to the body tag <div style="width: 500px; height: 500px; border-radius:

ElectronJS - sharing redux store between windows?

百般思念 提交于 2021-02-18 19:05:12
问题 I have an electron app based on electron-react-boilerplate . Now, that I have one window running as I wanted it to run, I started to create a new window. I currently have 2 html files - one for each window - containing div roots: <div data-root id="main_root"></div> <div data-root id="second_root"></div> My index.js file that is response for rendering the react app looks like this: import React from 'react'; import { render } from 'react-dom'; import { AppContainer } from 'react-hot-loader';

Transparent Windows on Linux (Electron)

孤者浪人 提交于 2021-02-18 05:33:28
问题 Using the transparent argument and setting it to true when creating a new BrowserWindow in Electron usually gives the window a transparent background... But on Linux that isn't the case for my knowledge Now I heard you can set some Command Line Arguments... But that isn't working... It just displays black or white no matter what... // Should set the commandLine arguments and work... const {app} = require('electron') app.commandLine.appendSwitch('enable-transparent-visuals'); app.commandLine

electron热更新与windows下的安装包

前提是你 提交于 2021-02-17 10:46:29
帮朋友公司做了点东西,他说有很多bug,我一看,基本问题都是浏览器兼容引起的,而electron内带Chromium内核,正好一直想尝试下electron,所以研究了一波。这里只是简单的使用electron作为壳,把自己的项目嵌进去,更多深入研究以后再来。 打包自己的项目 这里没啥说的自己的项目打包下来,类似下面 快速开始electron 上手electron,官方提供了一个非常好的快速上手实例"electron-quick-start"。 git clone https://github.com/electron/electron-quick-start cd electron-quick-start npm install 把自己的项目拷进去 npm run start就启动起来了 npm run packager就打包出来了 热更新 因为Chromium的缘故,即使很小的项目打包出来也有120M左右,如果给客户使用,不可能每次有点改动就让客户重新安装,显然我们需要热更新。 热更新的原理:每次启动程序我们就去拿本地的版本号和服务器上的版本号做对比,如果不一致就去请求资源,下载下来更新本地文件。 首先我们观察打包出来的文件,发现原始文件都放在resources/app下面的,也即是说我们下载下来的文件直接覆盖到resources/app下就可以达到更新了。 这里我推荐七牛云

electron 热更新

巧了我就是萌 提交于 2021-02-17 09:54:53
试用了下,electron 自带的热更新 并不是特别理想。 想自己处理下载更新文件。刚好看到了网上有一个比较好的处理方式。试了下效果还可以。 使用以下命令将此库包含在项目中: npm install request 在脚本的顶部声明基本依赖项。 var request = require('request'); var fs = require('fs'); 将GET数据流式传输到文件输出。  function downloadFile(file_url , targetPath){ // Save variable to know progress var received_bytes = 0; var total_bytes = 0; var req = request({ method: 'GET', uri: file_url }); var out = fs.createWriteStream(targetPath); req.pipe(out); req.on('response', function ( data ) { // Change the total bytes value to get progress later. total_bytes = parseInt(data.headers['content-length' ]); }); req.on(

BCH/BSV coin split troubleshooting

时光怂恿深爱的人放手 提交于 2021-02-17 04:48:46
BCH/BSV coin split troubleshooting Mark Lundeberg 2018 November 27 Resources Guides: Locktime based splitting (no dust needed) Geri’s guide (from BCA Discord) My tips on splitting My special Electron Cash version to make OP_CDS / OP_MUL splits. (You probably do NOT need this!) Some SV electron cash servers (network dialog, second tab: right click then ‘use server’): sv.electrumx.cash sv1.hsmiths.com satoshi.vision.cash BCH-only dust sources: http://forkfaucet.cash/ https://free.bitcoin.com/ BCH explorers: BlockDozer BlockChair btc.com bitcoin.com BSV explorers: https://bchsvexplorer.com/ -