electron

win.reload showing showing blank white window in electron

Deadly 提交于 2019-12-13 03:36:09
问题 I need to reload my site/app after network re-connect. So, I'm using win.reload after reconnect but after reloading it shows me a blank white screen I have tried to re-create the window but it gives me the same output. Another question reported here by me. I found window.location.href is set to "chrome-error://chromewebdata/" after reload This sample code from is main.js let mainWindow = null; let offlineWindow = null; let loadingwindow = null; let mainWindowWidth = 1100; let mainWindowHeight

Issue in requiring a custom module

﹥>﹥吖頭↗ 提交于 2019-12-13 03:34:55
问题 Let's give the context: I am currently working on making a little library for Electron . Since the beginning, I was working on a single JS file containing a class. But I decided to make a different class (and so another JS file) to have a better organization. So I made it. I made this file, with an export at the end like I read on many websites. Unfortunatly, when I try to require my second class in my first one, I get this error: Uncaught Error: Cannot find module './my-module-two'

Can't run Electron app - EINVAL: invalid argument, lstat

偶尔善良 提交于 2019-12-13 03:32:21
问题 I'm getting the following error whenever I try to run my app: My package.json : { "name": "SteamCMD-GUI", "productName": "SteamCMD GUI", "version": "0.0.1", "main": "main.js", "author": "avi12", "scripts": { "start": "electron .", "package": "asar pack \"SteamCMD GUI-win32-x64\" \"SteamCMD GUI.asar\"", "build-windows": "electron-packager . --platform=win32 --overwrite --out=release-builds --prune=true --icon=image/icon.ico --asar", "build-linux": "electron-packager . --platform=linux -

How to stop class/functions from continuing to execute code in Node.js

℡╲_俬逩灬. 提交于 2019-12-13 03:25:38
问题 I have made a few questions about this already, but maybe this question would result in better answers(i'm bad at questions) I have one class, called FOO, where I call an async Start function, that starts the process that the class FOO was made to do. This FOO class does a lot of different calculations, as well as posting/getting the calculations using the node.js "requets" module. -I'm using electron UI's (by pressing buttons, that executes a function etc..) to create and Start the FOO class

Insert image to CKEditor

和自甴很熟 提交于 2019-12-13 03:13:59
问题 I trying to use CKEditor5 and CKEditor-react in my electron app. And i want to paste image in editor, but i have an error filerepository-no-upload-adapter: Upload adapter is not defined. Docs says that I mast using cloud. But my app must working locally and without internet Can someone help me? 回答1: The docs say, in short, this: To handle image upload in CKEditor 5 you can use one of these: use the built-in Easy Image adapter (cloud service), use the built-in CKFinder adapter (can work

How to set a custom path for Electron app installer

此生再无相见时 提交于 2019-12-13 03:13:54
问题 Is there a way to ask custom installation path to the user during electron app installation? 回答1: Even if I set allowToChangeInstallationDirectory to true, compiled installer was not giving me the opportunity select the path. I found that my modules were outdated. After an update I managed to get what I wanted. So If you have any problem make sure that your modules are supporting recent updates Another important issue is setting your package.json correctly. if you are using nsis and doing it

Error while running execFileSync in packaged Electron app

扶醉桌前 提交于 2019-12-13 03:04:47
问题 I ran the following code in packaged electron app by electron-packager(asar=false). const app = require(‘electron’); const { join } = require(‘path’); const EXEC_OPTS = {encoding: 'utf-8', shell: true}; childProcess.execFileSync(join(app.getAppPath(), 'src', 'executable') + ‘/test.sh’, [''], EXEC_OPTS); But I got nothing even error logs.. This code normally can run only by command of “electron .” , But this code cannot run after packaging by electron packager . Structure is like this (just

Cancelled Dialog Box Without Selecting File: ERR_INVALID_ARG_TYPE

老子叫甜甜 提交于 2019-12-13 02:55:59
问题 If a user cancels the dialog box without selecting a file, the error ERR_INVALID_ARG_TYPE is thrown in console. The full error reads The "path" argument must be one of type string, Buffer, or URL. Received type object , which I believe is the case because undefined is returned. This happens in at least the context of writeFile , readFile , and unlink . I'm new to Node, and even newer to FS, so I'm wondering if there is an appropriate way to deal with this error other than ignoring it? I have

How to use Electron's <webview> within Angular2 app?

本小妞迷上赌 提交于 2019-12-13 02:54:55
问题 I try to use Electon's webview tag inside my Angular2 app, but when I add the src attribute binded to an Angular2 variable, the following error occurs: Can't bind to 'src' since it isn't a known native property This is the index.html: <head> <!-- cut out stylings, metatags, etc. --> <script src="../node_modules/zone.js/dist/zone.js"></script> <script src="../node_modules/reflect-metadata/Reflect.js"></script> <script src="../node_modules/systemjs/dist/system.src.js"></script> <script src=

API calls with axios inside a React app bundled in Electron is returning 400

若如初见. 提交于 2019-12-13 02:19:37
问题 Just a quick question: I'm building a React/Electron app and inside the React app I've got a few async/await calls to an API. These calls are made with axios and work fine when in development. When the app is wrapped in Electron, the requests return with a "400 Headers required" error. When running a dev version of React it call the api correctly. Any idea why this is happening? I came across the WebRequest Electron method https://electronjs.org/docs/api/web-request. It looks like I could