electron

How to port an existing angular app to electron?

不羁岁月 提交于 2019-12-03 04:36:49
问题 I am a beginner to angular and a complete noob to electron. I was wondering if it would be possible to port an existing angular app to electron by using most of the existing codebase of the webapp? I found a couple of links on this but not much on Google. Most results talk about starting with angular and electron to create a desktop app - which is my intention but I would like to use most of my existing code base and ideally just add webpack and electron related config to compile the electon

Distinction between the renderer and main processes in Electron

丶灬走出姿态 提交于 2019-12-03 04:14:33
问题 I originally thought that the renderer process in Electron was sandboxed in a chrome-like environment, meaning all you can do is mess with the DOM. However, I recently learned that you can access the filesystem, run child processes and get their output, and import any other node modules you want. If this is the case, what exactly is the distinction between the main process and the renderer process? Is it not a hard separation? What kind of code goes in the main process and what kind of code

Electron app with protractor end-to-end testing

自作多情 提交于 2019-12-03 03:30:47
I'm currently working on an Electron app and I now want to integrate end-to-end testing with Protractor . I've reviewed the tutorials for Protractor and am now trying to adapt it to Electron. Since Electron runs as a standalone app, how do I do this? It seems that Protractor stands-up a Selenium server that then tries to reach out to an available HTTP server and run tests such as click here, what url am I on, input this text, etc. Therefore how would I go about allowing the selenium server access to the electron instance? Anyway that's my mindset on the situation, any help is appreciated and

Saving desktopCapturer to video file in Electron

℡╲_俬逩灬. 提交于 2019-12-03 03:26:58
The desktopCapturer api example shows how to write a screen capture stream to a <video> element. // In the renderer process. var desktopCapturer = require('electron').desktopCapturer; desktopCapturer.getSources({types: ['window', 'screen']}, function(error, sources) { if (error) throw error; for (var i = 0; i < sources.length; ++i) { if (sources[i].name == "Electron") { navigator.webkitGetUserMedia({ audio: false, video: { mandatory: { chromeMediaSource: 'desktop', chromeMediaSourceId: sources[i].id, minWidth: 1280, maxWidth: 1280, minHeight: 720, maxHeight: 720 } } }, gotStream,

Electron and sequelize error: the dialect sqlite is not supported

江枫思渺然 提交于 2019-12-03 03:03:51
I'm trying to use sequelize and sqlite with electron in a desktop application but get the following error when running the app via npm start (which runs node_modules/.bin/electron . ): Uncaught Error: The dialect sqlite is not supported. (Error: Please install sqlite3 package manually) I've installed sequelize and sqlite with npm install --save sequelize sqlite . When I run the models file directly via node models.js , everything works fine: $ node models.js Executing (default): CREATE TABLE IF NOT EXISTS `Users` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `username` VARCHAR(255), `birthday`

Electron loading animation

匿名 (未验证) 提交于 2019-12-03 03:00:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Could someone please help me to implement a loading animation for my Electron app ? I am learning this new technology and it would be nice to understand the correct way to do that. I am thinking about something like : app.on('ready', () => { // show main content }) app.on('not-ready', () => { // show loading animation }) 回答1: As far as I know there is no event emitted from app before ready (only exception is will-finish-launching available only on macOS). Furthermore, you cannot open any BrowserWindow before app is ready , so you should

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

匿名 (未验证) 提交于 2019-12-03 02:53:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: 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 installed: "sqlite3" : "^3.1.9" , "node

Run python script in Electron app

孤人 提交于 2019-12-03 02:26:40
问题 I have a Electron project which executes some python script using NodeJS's child_process module. My python script is in the root folder of my project. Here's how I call the python script: let py = spawn('python',['ResolvePosition.py', obsFilePath, navFilePath]) py.stdout.on('data', data => console.log('data : ', data.toString())) py.on('close', ()=>{ // Python ends, do stuff }) This works fine if I run my electron app with npm start When I build an executable for Windows using the npm module

Electron PDF viewer

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an Electron app that loads URL from PHP server. And the page contains an iFrame having a source to PDF. The PDF page seems absolutely ok in a normal web browser but asks for download in Electron. Any help? My codes for html page is <h1>Hello World!</h1> Some html content here... <iframe src="http://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf" width="1200" height="800"></iframe> And my js code is something like mainWindow = new BrowserWindow({width: 800, height: 600}) mainWindow.loadURL(url.format({ pathname: path

Electron package doesn&#039;t start in linux environment:error while loading shared library libgtk-3.0

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have built an electron app to work in windows and linux environment. It works as expected in windows environment but doesn't even start in linux environment. Below is the pic that shows error in Linux environment. I am unaware of what is needed so that application runs in Linux Environment. I suspect some library might be missing. But its output of electron-packager. It works fine in windows platform but not in linux. 文章来源: Electron package doesn't start in linux environment:error while loading shared library libgtk-3.0