electron

Debugging Electron-Atom script with Visual Studio Code

半城伤御伤魂 提交于 2019-12-10 11:23:46
问题 Does Electron run on Visual Studio Code ? If yes, how to setup a simple environment where I can write/webug Atom Electron script using Visual Studio Code ? For example I with this Test.js script; var app = require('app'); process.on('uncaughtException', function(error) { console.error("ERROR Exception => " + error.stack); }) app.on('ready', function() { console.log('ready!'); aksjdflkasjdf(); // Caught Exception }) For Visual Studio Code there is an launch.json configuration file but I don't

How do I use ${workspaceRoot} for my Electron app in Visual Studio Code?

我们两清 提交于 2019-12-10 10:23:00
问题 I have an Electron app that I was able to debug in Visual Studio Code. After I upgraded to version 0.10.8 it will no longer run. I am getting the error message below in my launch.json file: Relative paths will no longer be automatically converted to absolute ones. Consider using ${workspaceRoot} as a prefix. Absolute path to the runtime executable to be used. Default is the runtime executable on the PATH. Here is my launch.json file: { "version": "0.2.0", "configurations": [ { "name": "My

Node.js recursively list full path of files

独自空忆成欢 提交于 2019-12-10 09:46:37
问题 Good night everyone. I'm having trouble with probably some simple recursive function. The problem is to recursively list all files in a given folder. For the moment, I've managed to list files in a directory using a simple function : fs.readdirSync(copyFrom).forEach(file => { let fullPath = path.join(copyFrom, file); if (fs.lstatSync(fullPath).isDirectory()) { console.log(fullPath); } else { console.log(fullPath); } }); I've tried various methods like do{} ... while() but I can't get it right

Error messages and console logs in Electron?

妖精的绣舞 提交于 2019-12-10 03:54:19
问题 How do you view error messages and console logs in Electron during development? Also, is it possible for the logs to be written directly into a file? Edit: Kind of like the errors and console logs displayed by Chrome's dev tools: Except in Electron rather than Chrome. 回答1: On your BrowserWindow call the function openDevTools() this will open the same dev tools you find in Chrome. I wrote about this on my blog at http://www.mylifeforthecode.com/debugging-renderer-process-in-electron/. Here is

What's the outcome of setting node-integration to false when creating a new browser window in Electron?

落花浮王杯 提交于 2019-12-10 01:45:48
问题 In order to get jQuery to load and function correctly in a HTML page I was opening in Electron (formerly Atom Shell), I had to disable Node integration when creating the BrowserWindow in my main.js file. Can someone please tell me what setting node-integration: false will keep me from being able to do that I would normally be able to do had I not disabled it? 回答1: Setting node-integration to false will disable node.js in the renderer process - i.e. your app can only do what a web browser will

Electron: Call renderer function from main

邮差的信 提交于 2019-12-09 16:53:21
问题 I have some data in the localstorage that has to be deleted on app.quit() . But I see no way to do so from the main process. Is there a way to call a renderer function from main ? I know about var remote = require('remote'); but it seems to go only in the wrong direction. 回答1: You can send messages from the main process to a renderer process via webContents.send as called out in the documentation here: https://github.com/atom/electron/blob/master/docs/api/web-contents.md

White Screen on Fresh New Angular 8/Electron 5 App

倖福魔咒の 提交于 2019-12-09 16:26:34
问题 I am building and running an Angular 8/Electron 5 desktop app. After what I believe to be proper setup, running the app displays a blank white screen. Using: Electron 5.0.2 Angular CLI 8.0.1 Node 10.16.0 macOS Mojave 10.14.5 ... ng new my-app npm i -D electron package.json { ... "main": "main.js", //<-- ADDED "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "electron": "ng build --baseHref=./ && electron ." //<-- ADDED }

Using Protractor in Electron

岁酱吖の 提交于 2019-12-09 13:36:39
问题 I am trying to set up unit tests and e2e tests for an application I have running with Electron using Protractor. I've been refering to many different posts (this one did help), but I still get an error I don't understand : Message: Error while waiting for Protractor to sync with the page: "angular could not be found on the window" Stacktrace: undefined My conf.js file looks like this: exports.config = { directConnect : true, seleniumAddress: 'http://localhost:4444/wd/hub', baseUrl:"file:/

How to Load Angular 2+ Routes in a New BrowserWindow (Electron)?

 ̄綄美尐妖づ 提交于 2019-12-09 07:26:49
问题 So I have a finished Angular 5 app that I want to covert into an Electron app. I've gotten everything to work in the app as it did in its Web App form except for one thing. I cannot for the life of me figure out how to load Routes into a new BrowserWindow. Here is what I am working with and what I have tried so far: I load mainWindow with this: mainWindow.loadURL(url.format({ pathname: path.join(__dirname, 'dist/index.html'), protocol: 'file:', slashes: true })); I successfully navigate to

Electron App with Angular 2 reload issue [duplicate]

痴心易碎 提交于 2019-12-09 06:19:53
问题 This question already has answers here : Angular 2.0 router not working on reloading the browser (31 answers) Closed 3 years ago . I'm working on an Electron desktop app with Angular 2. Everything boots up just fine and works as it should, but it fails when I reload the application. It appears to be an issue with the routing. With no routing the app will reload just fine and display the changes made, but with routing it returns a blank html page (even the entire main index.html is completely