electron

大话Electron应用自动更新

╄→гoц情女王★ 提交于 2020-04-02 05:52:10
一、Windows下更新特有的问题 软件更新在Linux和macOS还好说,但是在Windows上可能会遇到UAC问题,常用的方法是:Windows计划任务、Windows Service,本质上这两种方式还是提权,Windows Service 与 Windows计划任务相比最大的特点就是可以与应用交互,Windows的更新就是使用Windows Update服务,即使在macOS的Edge浏览器也是使用的Microsoft Update服务。 二、手动更新 手动更新是下载完整的安装包,用户手动安装,如果数据需要保存在本地,那么不要将数据保存在应用安装目录,而是用户目录。 手动更新适合用户粘性高,非频繁更新的应用,在macOS的App Store中,通常只要上传安装包,用户终端可以自动更新。手动更新一般会有比较大的安装包,因为是完全下载。一般作为降级更新方案使用。 三、覆盖更新 程序自动替换,下载更新过程快,只需要重启应用,甚至不需要重启,但是容易出现写入文件失败,而且实现复杂,适合打补丁。 四、自动更新 应用程序自动下载,再次启动以后重新加载最新版本即可,一般这样的应用结构是由一个固定的应用启动程序读取不同的应用版本。 这样更新速度快,异步更新并且适合高频更新的应用。缺点就是实现有一定的难度。 五、Electron应用更新 (1)Web化 将业务视图存放到远程HTTPS服务器

Raspberry pi load app at startup / Raspberry pi cargar app al iniciar

走远了吗. 提交于 2020-03-25 12:32:44
问题 My project is in /home/pi/app Starts with npm start How can I get the app to start up when I start the operating system? **** Español Mi proyecto esta en /home/pi/app Arranca la aplicación con npm start Cómo puedo hacer que la app se inicie al principio? Service => it does not work [Unit] Description=appvi After=netwwork-online.target [Service] WorkingDirectory=/home/pi/appvi ExecStart=/usr/local/bin/npm start Restart=always StandardOuput=syslog StandardError=syslog SyslogIdentifier=notell

Raspberry pi load app at startup / Raspberry pi cargar app al iniciar

Deadly 提交于 2020-03-25 12:32:02
问题 My project is in /home/pi/app Starts with npm start How can I get the app to start up when I start the operating system? **** Español Mi proyecto esta en /home/pi/app Arranca la aplicación con npm start Cómo puedo hacer que la app se inicie al principio? Service => it does not work [Unit] Description=appvi After=netwwork-online.target [Service] WorkingDirectory=/home/pi/appvi ExecStart=/usr/local/bin/npm start Restart=always StandardOuput=syslog StandardError=syslog SyslogIdentifier=notell

Web桌面应用框架1:Electron与WEB桌面应用程序开发及其它

て烟熏妆下的殇ゞ 提交于 2020-03-25 07:15:23
这几天在构思项目,研究了一下Electron,记录下来。 说起WEB桌面程序,当前最火的就是Electron了。 Electron的架构用一句话总结,就是一个main.js进程加上一个或数个chrome窗口,每个窗口都包含一个独立的Node.js。 这样的架构,使得这种桌面应用必须是一个(或数个)单页面应用(SPA),而这个SPA还拥有访问本地API的能力(Node.js)。 一方面,程序对前端框架的依赖必然加强,想再JQuery打天下就不那么容易了;另一方面也大大加强了前端框架的能力与版图。 这样它把前端与后端的战火,从服务器蔓延到了桌面。使得JS解决一切的宗旨,又得到了贯彻。 相比较这种新的架构,还有三种早已出现在WEB桌面程序。一般基于嵌入式Chromium框架(CEF)。 一种就是CEF+远程访问。这种程序体验极差,就是个单页面的网站。 值得注意的是Electron+远程访问,是极度危险的,只需劫持JS,则可利用Node.js为所欲为。 另一种就CEF+本地服务。本地服务常见的有.net和java,也有用PHP和Node.js的。 这种组合与前一种组合体验类似,而且体积臃肿,但胜在页面延时较小。 最后一种就是CEF+本地资源+远程API接口。这种是手机WebAPP的常用模式。体验尚可。 和这些架构比较起来,Electron的体验和能力上得到很大的增强,但是有着天生的弱点。

Video recording with OpenVidu and electron

℡╲_俬逩灬. 提交于 2020-03-23 07:51:29
问题 I have to be able to record an incoming video call into a file. The recording must be done on the desktop application, built with electron. I'm using OpenVidu as a streaming platform. Is there any way to do that? 回答1: @Vasniktel Technically it could be possible to record the video client side as there are a number of WebRTC examples that record locally on the client, however this is not natvie to openvidu. However recording on electronjs is... github.com/hokein/electron-screen-recorder

Using ipc in Electron to set global variable from renderer

北城以北 提交于 2020-03-19 07:39:45
问题 renderer.js ipcRenderer.sendSync('setGlobal', 'globalVarName').varInner.varInner2 = 'result'; main.js global.globalVarName = { varInner: { varInner2: '' }, iWontChange: 'hi' }; ipcMain.on('setGlobal', (event, arg) => { console.log(arg) // should print "result" // what goes here? }) console.log(varInner2) // should print "result" Is something like this possible, namely setting the varInner2 of globalVarName in this manner? Secondly, is there a way to optimize this so we wouldn't have to

Electron “require is not defined”

戏子无情 提交于 2020-03-18 11:56:08
问题 I'm making an application which I need to give access to the file system (fs) module, however even with nodeIntegration enabled the renderer gives me this error: Uncaught ReferenceError: require is not defined All similar problems I could find had a solution that said they needed to turn nodeIntegration on, however I already have it enabled. This is my main.js: const electron = require('electron'); const {app, BrowserWindow} = electron; let win; app.on('ready', () => { var { width, height } =

Electron fix “ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command”

╄→尐↘猪︶ㄣ 提交于 2020-03-18 05:41:09
问题 I recently stepped down my electron application removed knex and sqlite since it was painfully complicated to creating a rebuild on windows also when i made an executable for windows sqlite database didn't seem to work. Linux executable worked fine with sqlite guessing the same with mac. To use sqlite i had rebuilt the application using electron-rebuild . In order to clear the rebuild i did rm -rf node_modules && npm install I have eventually decided to use IndexDB using dexie . However now

Electron Manipulate/Intercept WebView Requests and Responses

て烟熏妆下的殇ゞ 提交于 2020-03-17 10:43:04
问题 I want to create an Electron app that will use webview to display 3rd party content. I would like to be able to intercept all requests and responses from this webview. Sometimes I would like to manipulate this content, other times I would like to log it, and other times I’d like to do nothing. As one example for the responses, maybe a web server will respond with TypeScript code, maybe I want to take that response, and compile it to standard JavaScript. I have looked into this page but it