electron

Debugging Electron renderer process with VSCode

▼魔方 西西 提交于 2019-12-06 10:43:01
I tried this document , but hit a problem. I went through the guide one by one and it is all fine until "1. Update the contents of renderer.js to" in "Debugging of the renderer process" section. But when I try "2. While your debug session is...." , VSCode shows the image like below and I cannot attach the debugger to the Electron process. The list in the image shows the tabs of my browser but there's no option corresponding to the electron process launched by the Main debugger. How do I solve this issue? I had that problem too. It appears, it takes time for Chrome Debugger to attach to the

How to properly run a Rails app inside Electron?

被刻印的时光 ゝ 提交于 2019-12-06 09:43:22
问题 I am very new to Electron, just tried to follow the Documentation. I was able to run a html in Electron and it worked fine. Then I tried to load a Rails app with BrowserWindow loadUrl, but the javascripts of the app are not working inside Electron. My main is this index.js here: var app = require ('app') var BrowserWindow = require ('browser-window') app.on('ready', function(){ var mainWindow = new BrowserWindow({ width:1115, height:945 }) mainWindow.loadUrl('http://my-app-at-heroku.herokuapp

electron startDrag target OS path

僤鯓⒐⒋嵵緔 提交于 2019-12-06 09:29:01
问题 I have been playing around with the file system drag and drop functionality of Electron apps. What I want: I need to know , if I drag a div out of electron app into OS , I just want to know target Os path. I am not interested in copying file operation to that path as i have my custom logic Similar Solutions: I know about these solutions but I am not interested in as my goal is know target OS path. All these issues address drag and drop files out of electron app into OS . Is it possible to

Debugging Electron-Atom script with Visual Studio Code

我与影子孤独终老i 提交于 2019-12-06 08:29:53
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 say how to setup Visual Studio Code ready for Electron work. Shawn Rakowski The answer depends on

Electron-packager: can not locate local db file after packing

有些话、适合烂在心里 提交于 2019-12-06 07:55:13
问题 Background: In my app, I have a local DB file, named example.db which is read by the main.js . The project structure and part of my main.js program is shown below. Project folder architecture main.js const { app, BrowserWindow, dialog, Menu } = require('electron') const fs = require('fs') const path = require('path') const sqlite3 = require('sqlite3').verbose() // load dataBase let dbFile = 'app/db/example.db' const db = new sqlite3.Database(dbFile) Package.json { "name": "Example", "version"

electron中JS报错:require is not defined的问题解决方法

筅森魡賤 提交于 2019-12-06 07:53:26
Electron已经发布了6.0正式版,升级后发现原来能运行的代码报错提示require is not defined 解决办法: 修改创建BrowserWindow部分的相关代码,设置属性webPreferences.nodeIntegration为 true let win = new BrowserWindow({ webPreferences: { nodeIntegration: true } }) 在原有的new BrowserWindow基础上加入 webPreferences: { nodeIntegration: true } 就可以了。 来源: https://www.cnblogs.com/nayek/p/11969762.html

Electron without GUI

江枫思渺然 提交于 2019-12-06 06:28:55
问题 I need to create a node.js application that works in background as a web application. The app should provide some functionality for the main client's site. The application is going to be installed on many machines with differences OS, that's why I want to get rid of node.js dependency and compile it to binary. I used electron-builder, but as I understood it depended on GUI. So, what can I do to compile the app that can work without GUI and Node.js? 回答1: How about pkg? This command line

Closing application and notifying renderer process

僤鯓⒐⒋嵵緔 提交于 2019-12-06 05:57:56
问题 I have an Electron application that needs to save some data when it's closed by the user (e.g. just after the user clicked on the "Close" button). The data is available at the renderer process, so it should be notified before the application dies. The Electron API for Browser Window mentions a close method, but it seems this is done by the main process, not the renderer one (if I'm not mistaken). I tried using WebContents.send from the main process to notify the renderer process, but it seems

Blank screen when navigating Angular routes within Electron app

不羁的心 提交于 2019-12-06 05:19:24
问题 I'm currently writing a desktop hybrid app with Electron with AngularJS integration for routing etc, please see following angular config: app.config(function($routeProvider, $locationProvider) { $routeProvider .when('/', { templateUrl: 'partials/dashboard.html', controller: 'dashboardController' }) .when('/sites', { templateUrl: 'partials/sites.html', controller: 'sitesController' }) .when('/sites/:site', { templateUrl: 'partials/site.html', controller: 'siteController' }) .when('/sites/:site

Intellisense in VSCode for electron app development

99封情书 提交于 2019-12-06 05:14:06
I am developing windows desktop app using Electron and VSCode. I do not see any intellisence when I try to use functions from electron. My query is, how to configure vscode to enable the electron intellisense? In general I want to know what procedures I need to follow so that I can get intellisense feature in JavaScript code. Running this should do the trick typings install github-electron --source dt --global Update The new method would be to install the @types through npm via: npm i -D @types/electron Looking at that repository though, it says that if you have the following included in your