electron

How to prevent multiple instances in Electron

你。 提交于 2020-07-04 10:01:47
问题 I do not know if this is possible but I might as well give it a chance and ask. I'm doing an Electron app and I'd like to know if it is possible to have no more than a single instance at a time. I have found this gist but I'm not sure hot to use it. Can someone shed some light of share a better idea ? var preventMultipleInstances = function(window) { var socket = (process.platform === 'win32') ? '\\\\.\\pipe\\myapp-sock' : path.join(os.tmpdir(), 'myapp.sock'); net.connect({path: socket},

Showing Error - unknown error: DevToolsActivePort file doesn't exist - it's electron application (I am using windows OS))

Deadly 提交于 2020-07-02 03:12:54
问题 When I run my code it's showing below error - Electron application org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist. Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z' System info: host: 'DESKTOP-GN8LLQU', ip: '192.168.1.20', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.2' Driver info: driver.version: ChromeDriver My Code: ChromeOptions opt = new ChromeOptions(); // path of your

Using components from an external directory in a Electron project with Webpack

时光总嘲笑我的痴心妄想 提交于 2020-06-29 03:18:52
问题 I am trying to do this as simple as possible, I studied Yarn Workspaces for a while, but that's a solution that's currently doesn't work with Electron, there were simply too many issues. I have am Electron project here: ./electron/ I have a directory with components here: ./common/ The components are developed in React/JSX, there is nothing really fancy about them. That said, I am using hooks (useXXX). I tried many ways to include those components (ideally, I wanted to use Yarn Workspaces,

Electron index.html not loading after building the app

一世执手 提交于 2020-06-28 08:10:42
问题 I have an electron app that works perfectly fine before bundling it with electron-builder . After bundling it and opening the app, I get the following error : Not allowed to load local resource: file:///tmp/.mount_displa4VwuQh/resources/app.asar/file:/tmp/.mount_displa4VwuQh/resources/app.asar/build/index.html In the build folder I have the electron.js file and index.html and since the app is starting electron.js and thus index.html got bundled correctly. Here is my electron.js app entry

Electron index.html not loading after building the app

邮差的信 提交于 2020-06-28 08:10:28
问题 I have an electron app that works perfectly fine before bundling it with electron-builder . After bundling it and opening the app, I get the following error : Not allowed to load local resource: file:///tmp/.mount_displa4VwuQh/resources/app.asar/file:/tmp/.mount_displa4VwuQh/resources/app.asar/build/index.html In the build folder I have the electron.js file and index.html and since the app is starting electron.js and thus index.html got bundled correctly. Here is my electron.js app entry

Hot reload using Electron and Angular

社会主义新天地 提交于 2020-06-28 07:30:22
问题 I'm using Angular and Electron for my app. I'm looking for a way to enable hot reload... When I run my yarn run electron (scripts : "electron": "ng build --base-href ./ && electron ." ), if I save a change, my app isn't reloading. Here is my main.js file : const { app, BrowserWindow } = require("electron"); const path = require("path"); const url = require("url"); let win; function createWindow() { win = new BrowserWindow({ width: 800, height: 600 }); // load the dist folder from Angular win

Require node module in angular2 component

空扰寡人 提交于 2020-06-27 18:19:17
问题 I can not figure out how to require node modules in my angular2 components - especially in my case on how to open a new electron window within an angular2 component. My component.html has something like this <button class="btn btn-success" (click)="buttonLoginClick()">Login</button> And within the component.ts I use the following export class LoginComponent { constructor() {} buttonLoginClick(): void { alert("just a test"); const remote = require('electron').remote; const BrowserWindow =

Require node module in angular2 component

本秂侑毒 提交于 2020-06-27 18:18:49
问题 I can not figure out how to require node modules in my angular2 components - especially in my case on how to open a new electron window within an angular2 component. My component.html has something like this <button class="btn btn-success" (click)="buttonLoginClick()">Login</button> And within the component.ts I use the following export class LoginComponent { constructor() {} buttonLoginClick(): void { alert("just a test"); const remote = require('electron').remote; const BrowserWindow =

Require node module in angular2 component

折月煮酒 提交于 2020-06-27 18:18:29
问题 I can not figure out how to require node modules in my angular2 components - especially in my case on how to open a new electron window within an angular2 component. My component.html has something like this <button class="btn btn-success" (click)="buttonLoginClick()">Login</button> And within the component.ts I use the following export class LoginComponent { constructor() {} buttonLoginClick(): void { alert("just a test"); const remote = require('electron').remote; const BrowserWindow =

Electron application SQLITE package has not been found installed

拟墨画扇 提交于 2020-06-22 03:54:12
问题 We are struggling with building app for windows 32bit and 64bit. It is angular 2 application which uses sqlite3 as a database. Everything works perfectly in a development but after packaging app and running it on windows it throwns error SQLite package has not been found installed. Try to install it: npm install sqlite3 --save Here is package.json ( part of it which is important for this issue ): "scripts": { "build:aot:prod": "npm run clean:dist && npm run clean:aot && cross-env BUILD_AOT=1