electron

Why does Electron need to be saved as a developer dependency?

人走茶凉 提交于 2019-12-21 07:19:10
问题 As per the official website, the correct way to save electron files is: npm install electron --save-dev Electron is actually required for running the app (quite literally: require() ) and this goes against the top voted answer here. So why do we make this exception, if this is even one? 回答1: The fact that you require a package is irrelevant to whether it should be considered a dependency or a devDependency (in the npm sense). E.g. many projects use webpack API (i.e. const webpack = require(

How should I configure the base href for Angular 2 when using Electron?

断了今生、忘了曾经 提交于 2019-12-21 06:58:05
问题 I need to either set <base> in the HTML or APP_BASE_HREF during the bootstrap for Angular 2 to not throw exceptions. If I set either of these then Electron , thinking in terms of the file system, throws exceptions in browser_adapter.ts when trying to match a route: EXCEPTION: Error: Uncaught (in promise): Cannot match any routes. Current segment: 'C:'. Available routes: ['/dashboard', '/accounts']. I tried using just the HashLocationStrategy mentioned in this blog post, but Angular still

Implementing in-app purchase in an Electron app for the Mac App Store

廉价感情. 提交于 2019-12-21 04:24:14
问题 I've looked around and it seems like several people are having this issue but no-one seems to have solved it: Adding Apple in-app purchase to Electron HTML/JS app https://github.com/electron/electron/issues/3745 https://discuss.atom.io/t/osx-in-app-purchases-in-electron/22885 Some people suggest using this Node to Objective-C bridge to do it: https://github.com/TooTallNate/NodObjC Other people suggest using this in-app library, but from what I can see, it only validates receipts: https:/

Cross Domain Ajax Call in Atom Shell

痞子三分冷 提交于 2019-12-21 03:58:09
问题 We are working with Atom Shell (Currently known as electron) to wrap a web application as desktop app and having trouble making cross domain ajax calls due to CORS restriction. We also tried nw.js (Formerly known as Node-Webkit) and we had no problem making cross domain ajax call with it. Is Atom Shell (Electron) restricts cross domain calls by default ? 回答1: If the webpage is loaded in "file://" mode and not served by an http server, you can make ajax calls by default. If you still have

How can I take persistent permissions in electron app?

亡梦爱人 提交于 2019-12-21 03:52:44
问题 I am creating an electron app where I need to scan and update files which need root permission. I know I can run such commands using sudo.exec() in that way: sudo.exec ("rm /private/var/log/fsck_hfs.log", options, (e, stdout, stderr) => {}); And even I can put multiple commands in a script and execute them with single sudo.exec(). In my case, commands needs to be executed at different point of time and I cannot execute them with a single script. It is annoying for user to grant permissions

Button click event binding in Electron js

 ̄綄美尐妖づ 提交于 2019-12-21 03:36:11
问题 I have started using electron js to develop desktop application. I want to know that how to bind button click event with javascript function so that I can perform other operation. I used below HTML code: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Manav Finance</title> </head> <body> <input type="button" onclick="getData()" value="Get Data" /> </body> <script> // You can also require other files to run in this process require('./renderer.js') </script> </html> My renderer.js

How to make SQLite to work with Angular 4+, Electron and NodeJS

人盡茶涼 提交于 2019-12-21 02:46:27
问题 I'm trying to build one small desktop app using: Angular 4+ NodeJS Electron SQLite3 NodeJS will be used for scanning local user hdd and inserting specific files that are found into SQLite3 database. I checked dozens of documentation and suggestions. Most of them suggest to use NodeJS express framework and make layer between Angular 4+ -> Express -> SQLite3. I want to avoid using express framework because it is going to be desktop app and it is not needed at all. What I tried and what I did: I

How to run an electron app on docker

左心房为你撑大大i 提交于 2019-12-20 22:00:24
问题 I've created a fork of a repository hosting an electron app which is a chat client: https://github.com/Serkan-devel/BetterDiscordApp-docker. What I'm trying to do is to create a docker container with a GUI hooked to the own screen like at https://blog.jessfraz.com/post/docker-containers-on-the-desktop/ . The dockerfile I've created goes like: FROM node:slim COPY . /usr/scr/app #RUN rm bdstart.sh RUN npm install --save-dev electron RUN npm install #ENV FRESHINSTALL=true CMD ["/usr/scr/app

Electron+Vue开发跨平台桌面应用

雨燕双飞 提交于 2019-12-20 20:41:26
虽然B/S是目前开发的主流,但是C/S仍然有很大的市场需求。受限于浏览器的沙盒限制,网页应用无法满足某些场景下的使用需求,而桌面应用可以读写本地文件、调用更多系统资源,再加上Web开发的低成本、高效率的优势,这种跨平台方式越来越受到开发者的喜爱。 Electron是一个基于Chromium和 Node.js,使用 HTML、CSS和JavaScript来构建跨平台应用的跨平台开发框架,兼容 Mac、Windows 和 Linux。目前,Electron已经创建了包括VScode和Atom在内的大量应用。 环境搭建 创建Electron跨平台应用之前,需要先安装一些常用的工具,如Node、vue和Electron等。 安装Node 进入Node官网下载页http://nodejs.cn/download/,然后下载对应的版本即可,下载时建议下载稳定版本。如果安装Node使用Homebrew方式,建议安装时将npm仓库镜像改为淘宝镜像,如下所示。 npm config set registry http://registry.npm.taobao.org/ 或者 npm install -g cnpm --registry=https://registry.npm.taobao.org 安装/升级vue-cli 先执行以下命令,确认下本地安装的vue-cli版本。 vue -V

'electron-packager' is not recognized as an internal or external command

青春壹個敷衍的年華 提交于 2019-12-20 19:57:49
问题 I recently started using electron. I have successfully completed the 1st phase by creating a hello world app (included files index.html, main.js, package.json). Now I am trying to package the app using electron-packager but getting this error Steps I have followed: Created a project directory named helloworld. Initialized the project directory using npm init command. Then installed electron using npm install electron --save-dev . Then created the javascript and html files as main.js and index