electron

Electron: How to minimize a window from a rendered process

别等时光非礼了梦想. 提交于 2019-12-04 11:39:50
问题 Scenario I have a window and it has an add task button that is opening a window. Everytime user clicks on it, it opens a window. I have a button on add task window that minimize it. How to implement this minimize button? Code I am able to close maximize window by using the code below: var winclose = function () { window.close(); } var winmaximize = function () { window.moveTo(0, 0); window.resizeTo(screen.width, screen.height); } However, I am not able to find any function that can minimize a

Make electron app smaller?

谁说胖子不能爱 提交于 2019-12-04 11:03:40
问题 I just recently built an electron app and packaged it using electron-packager. The .exe file is 55,000kb and the rest of the folder is quite bulky as well. Is there any way to take down the size of this application at all? 回答1: Here's a github issue on it. The comment I'm emphasizing is: That's the expected size, there is no way to make it smaller. The reason why it's so big is because electron is loading most of chromium inside that 50mb file. So no unfortunately there is no way to make it

How do i disable the horizontal scroll bar in Electron BrowserWindow?

蓝咒 提交于 2019-12-04 10:44:34
How do i disable the horizontal scroll bar in a fixed width and height browser window in Electron? Thank you. I think you just have to disable horizontal scrolling in your HTML file. One way to do so is by using css: <style> body { overflow-x: hidden; } </style> Try to add this in the <head>. Try to add this in your CSS ::-webkit-scrollbar { display: none; } 来源: https://stackoverflow.com/questions/44990519/how-do-i-disable-the-horizontal-scroll-bar-in-electron-browserwindow

Closing application and notifying renderer process

…衆ロ難τιáo~ 提交于 2019-12-04 09:48:41
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 that, because the message is asynchronous, the application is closed before the renderer process has

Visual Studio Code配置技巧

半世苍凉 提交于 2019-12-04 09:28:02
Visual Studio Code配置技巧 VS Code是啥 Visual Studio Code(以下简称 VS Code) 是一个免费、开源、跨平台的由微软开发的程序编辑器。它是用 TypeScript 编写的,并且采用 Electron 架构。官网是 https://code.visualstudio.com/ 。 来源: https://www.cnblogs.com/bingogyz/p/11853452.html

Electron and sequelize error: the dialect sqlite is not supported

橙三吉。 提交于 2019-12-04 09:25:35
问题 I'm trying to use sequelize and sqlite with electron in a desktop application but get the following error when running the app via npm start (which runs node_modules/.bin/electron . ): Uncaught Error: The dialect sqlite is not supported. (Error: Please install sqlite3 package manually) I've installed sequelize and sqlite with npm install --save sequelize sqlite . When I run the models file directly via node models.js , everything works fine: $ node models.js Executing (default): CREATE TABLE

如何在使用Vue的情况下实现Electron打开文件保存对话框?

邮差的信 提交于 2019-12-04 08:57:34
一、问题场景 最近是在使用Electron+Vue构建一个基于modbus rtu协议的上位机应用,使用ipcMain和ipcRenderer实现点击Vue组件后打开对话框,获取到文件路径并写入数据,完成后通知。但是出现ipcRenderer.on() 调用多次的错误情况。 那么,使用Electron+Vue实现文件保存的正确姿势是什么呢? 二、具体实现 在electron的src/main/index.js中定义IPC通道 // 1. 引入对话框与IPC通信模块 const ipc = require('electron').ipcMain const dialog = require('electron').dialog // 2.定义IPC主进程响应函数 ipc.on('open-save-chart-dialog', function (event) { dialog.showSaveDialog({ title: '保存图像文件', defaultPath: '/', filters: [ { name: 'Images', extensions: ['png', 'jpg'] } ] }, function (filename) { // 通知渲染进程,将获取到的文件路径传给Vue组件中响应函数 event.sender.send('save-finished',

How to embed a mac app extension in an Electron app?

半世苍凉 提交于 2019-12-04 08:30:50
I'm trying to embed a Finder Sync extension written in Swift in my app written with Electron . How can I manage to make them work together and communicate with each other? I have read the Apple documentation but it only explains how to add a target to a native application. I also noticed that I can manually inject the .appex compiled file (produced by XCode) in the application Plugins folder using electron builder . How can I develop and test the extension in XCode and embed it correctly in a custom Electron app? Any suggestion? Thank you very much for any suggestion Create PlugIns folder in

How to launch my electron app from a website

喜你入骨 提交于 2019-12-04 08:09:04
问题 We have an electron crypto app that signs transactions (among other things). We want other websites to have the ability to have a button that opens that electron app, pre-filled with some params (the transaction information). flow is: user clicks "make transaction" on some-crypto-site.com electron app opens up with pre-filled params user clicks "sign transaction" in electron app electron app does stuff behind the scenes electron app closes and sends a message to some-crypto-site.com This

Angular 4 + Electron - How to run application and watch for changes (live reload)

流过昼夜 提交于 2019-12-04 07:58:56
I am creating an Electron application using Angular 4. How can i set it up so that it watches for any changes and live reloads it. package.json { "name": "angular-electron", "version": "0.0.0", "license": "MIT", "main": "main.js", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "electron": "electron .", "electron-build": "ng build --prod && electron ." }, "private": true, "dependencies": { "@angular/animations": "^4.2.4", "@angular/common": "^4.2.4", "@angular/compiler": "^4.2.4", "@angular/core": "^4.2.4", "@angular