electron

Run batch file from Electron main thread

大兔子大兔子 提交于 2019-12-13 02:17:54
问题 I'm attempting to run a simple batch file from my electron application. Here is my code: globalShortcut.register('Control+B', () => { log.info('Batch File Triggered: ' + app.getAppPath() + '\\local\\print.bat') require('child_process').exec(app.getAppPath() + '\\local\\print.bat', function (err, stdout, stderr) { if (err) { // Ooops. // console.log(stderr); return console.log(err); } // Done. console.log(stdout); }); }) The batch file should be triggered when Control+B is pressed by the user,

Electron TypeError in ipcMain event handler

对着背影说爱祢 提交于 2019-12-13 01:17:14
问题 I'm a little bit confused about a strange thing. I hope i get some explanation about this behaviour. Here is my little learning project. A simple tcp client-server chat program. The client is written electron but its not working yet. My chat module is: 'use strict'; let Socket = require('net').Socket; let EventEmitter = require('events'); let util = require('util'); function Chat() { EventEmitter.call(this); this.socket = new Socket({ allowHalfOpen:true }); this.socket.on('data', (data) => {

'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'

耗尽温柔 提交于 2019-12-13 00:23:12
问题 I am try to convert my electron app to full web. when I am running the app from my localhost I get this error: Failed to load https://agrt.herokuapp.com/login: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:4200' is therefore not allowed access. The credentials mode of requests initiated by the

Electron app runs without any errors however the window does not open or show in task manager

佐手、 提交于 2019-12-13 00:14:39
问题 I am building an electron app. The app runs without any errors but does not open. I am running windows 7 on a 32 bit machine. My main.js file looks like this: const {app, BrowserWindow} = require('electron'); const path = require('path'); const url = require('url'); // Initialize window let win; function createWindow() { win = new BrowserWindow({ width: 800, height: 600, icon: __dirnaname+ '/assets/images/icon.jpg' }); // Load Window win.loadUrl(url.format({ pathname: path.join(__dirname, '.

How MS Teams auto logs into Azure AD

*爱你&永不变心* 提交于 2019-12-12 23:15:19
问题 I tried few plugins to implement Azure AD auto-login functionality to an Electron app, but each of them had login issues described here if I choose file system URL(file:///) . This is because Electron apps run on file system URLs and Azure AD doesn't accepts a file system URL. As much as I know, MS Teams is build on Electron. How have they achieved it? Do I need to run a local server like electron-with-express? 来源: https://stackoverflow.com/questions/51773875/how-ms-teams-auto-logs-into-azure

electron-packager failing to build when run as root

删除回忆录丶 提交于 2019-12-12 23:07:27
问题 The problem I run these commands: git clone electron-quick-start cd electron-quick-start npm install npm install electron-packager --save-dev npm run-script pack which runs: electron-packager . MyApp --platform=linux --arch=x64 --prune When in vagrant, as user vagrant, it works. When I run it in vagrant, as root, it fails with ENAMETOOLONG error. When I run in Docker container, as root, it fails the same way as well. Problem is my CI, buildbot, runs as root. vagrant path: PATH=/usr/local/sbin

Is PouchDB with LevelDB adapter supposed to create a local file?

纵然是瞬间 提交于 2019-12-12 23:07:15
问题 This leaflet example (Leaflet.TileLayer.PouchDBCached) is using an "idb" adapter and for electron/node it looks like I want to use a "leveldb" adapter. So I followed the instructions here: PouchDB in Node.js In Node.js, the adapter situation is much simpler than in browsers. By default, if you create a PouchDB like this one: var pouch = new PouchDB('./path/to/db'); then a LevelDB-based database will be created in the directory ./path/to/db. The LevelDB implementation uses LevelDOWN. In my

Electron - Page is refreshed when converting HTML5 canvas to jpeg

馋奶兔 提交于 2019-12-12 23:05:45
问题 I have a desktop application using Electron platform and Javascript where I am converting an HTML5 canvas to JPEG using: <a id="download" download="Path.jpg">Download JPG</a> then, function download(){ dt = 'data:text/plain,foo'; this.href=dt; } This refreshes my whole application. Since the user is drawing on the canvas, I do not want to refresh the page, only allowing the image to be downloaded and then the user may continue to draw on the canvas. Any pointers on what I am doing wrong and

Access data from webContents.send(..) in Angular Controller

烂漫一生 提交于 2019-12-12 22:22:44
问题 I am pretty new to Electron and am currently building a small application that reuses some code from an Angular application that I built some time ago. Here is what I am trying to do: I have one main BrowserWindow (that is being filled with data from a webservice which I access using angular), when the user clicks one of the buttons I want to open another BrowserWindow and display some data in it (the data is related to what the user clicked). I figured out how to open another BrowserWindow

How to bundle Electron application and windows service together?

荒凉一梦 提交于 2019-12-12 22:17:38
问题 I am very new with electron application. I need some help with election installation . I have an Electron desktop application and a windows service . I can start and stop my pre installed services by using sudo-prompt package. I am creating windows installer by using electron-winstaller package. But I want to bundle my windows service along with my electron application . My requirement is when I install my electron package then it should install my service also, when I uninstall my package