electron

require(“electron”).app is undefined. I npm installed fresh modules. Unsure what to do

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Yesterday, I was developing on Electron perfectly fine. Then I hop onto my computer to realize Electron isn't working at all now. I removed node_modules and did a fresh npm install package.json: ... "devDependencies" : { "devtron" : "^1.4.0" , "electron" : "^1.4.7" }, "dependencies" : { "electron-debug" : "^1.1.0" } ... This is the error I got. I followed the suggestions used of previous issues of this problem. Nothing is resolving it. Electron is not installed globally. Everything should be self contained in the directory. npm

Electron create MSI installer using electron-builder

匿名 (未验证) 提交于 2019-12-03 08:41:19
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I managed to create an .exe installer for windows using electron builder, I create 2 package.json as pointed out in the docs : https://github.com/electron-userland/electron-builder . I ended up having a folder with a working .exe "dist:win64": "./node_modules/.bin/build --platform win32 --arch x64" The build section of my main package.json is "build": { "app-bundle-id": "org.test.mytest", "app-category-type": "public.app-category.graphics-design", "osx": { "contents": [ { "x": 410, "y": 150, "type": "link", "path": "/Applications" }, { "x":

How to hide the API key in my Electron application?

好久不见. 提交于 2019-12-03 08:36:48
I'm building an Electron application that uses Google's YouTube Data API v3. For accessing the API, I decided to use the standard API key (instead of OAuth, since I am not going to be accessing any personal data). But the problem is, I cannot hide the API key in my app, and I also cannot use referrer restrictions (referrer restrictions allow you to filter which web sites can use your API key (by HTTP address)), since this is an Electron app. So basically, if someone looks at the source code (or even just at the developer tools), they can see the key, and use it freely. Any advice on what to do

How to make SQLite to work with Angular 4+, Electron and NodeJS

▼魔方 西西 提交于 2019-12-03 08:32:23
I'm trying to build one small desktop app using: Angular 4+ NodeJS Electron SQLite3 NodeJS will be used for scanning local user hdd and inserting specific files that are found into SQLite3 database. I checked dozens of documentation and suggestions. Most of them suggest to use NodeJS express framework and make layer between Angular 4+ -> Express -> SQLite3. I want to avoid using express framework because it is going to be desktop app and it is not needed at all. What I tried and what I did: I installed: "sqlite3": "^3.1.9", "node-pre-gyp": "^0.6.36", as dependencies in my project. Than I have

Printing a PDF file with Electron JS

耗尽温柔 提交于 2019-12-03 08:31:44
问题 I am trying to create an Electron JS app that has the purpose to print letter size PDFs. This is my snippet of code for printing: win = new BrowserWindow({ width: 378, height: 566, show: true, webPreferences: { webSecurity: false, plugins: true } }); // load PDF win.loadURL('file://' + __dirname + '/header1_X_BTR.pdf'); // if pdf is loaded start printing win.webContents.on('did-finish-load', () => { win.webContents.print({silent: true, printBackground:true}); }); My issues are: if I have

What are the pros and cons of Chrome Apps compared to Electron?

半腔热情 提交于 2019-12-03 08:29:42
问题 I want to program a desktop app in javascript (with web technologies) and looked for a comparison between Electron and Chrome Apps. Everything I need seems to be possible with Chrome Apps, but there's a big hype around Electron/NW.js. What are the advantages of Electron? Is it due to the large amount of Node packages? I think the functional differences are clear to me. Pros and cons like: + Chrome Apps can run on Chrome OS - Chrome Apps needs an installed Chrome Browser ... UPDATE 2016-08-20:

How to call local .dll files in Electron App

白昼怎懂夜的黑 提交于 2019-12-03 08:17:20
问题 i have an issue how to call sample .dll files into my Electron App. I have sample .dll files in my folder, the thing is how to access my sample.dll file and how to call my sample.dll function and gets results. Any tutorials or steps to follow please sample code to start 回答1: Calling into a .dll in Electron is no different to calling into one in plain NodeJS, which means you have two options, node-ffi or a native Node addon that links with your .dll and exposes a JavaScript API. If you decide

Electron: How to minimize a window from a rendered process

守給你的承諾、 提交于 2019-12-03 08:15:45
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 window from rendered process. Please help, many thanks; Note: Browsers do not provide a function to

Bootstrap: Uncaught TypeError: Cannot read property 'fn' of undefined

て烟熏妆下的殇ゞ 提交于 2019-12-03 07:49:21
I am trying to make an Electron application with Bootstrap. I get this error message: Uncaught TypeError: Cannot read property 'fn' of undefined at setTransitionEndSupport (bootstrap.js:122) at bootstrap.js:199 at bootstrap.js:201 at bootstrap.js:9 at bootstrap.js:10 My dependencies in the package.json are: "dependencies": { "bootstrap": "^4.1.2", "electron": "^2.0.5", "jquery": "^3.3.1", "popper.js": "^1.14.3" } My index.html file is: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Release Management Report</title> </head> <body> <div class="container"> <h1>Bootstrap Test</h1> <p>

How to detect desktop idle time from an Electron app?

大兔子大兔子 提交于 2019-12-03 07:48:08
I need my Electron app to respond to the user becoming idle (no mouse or keyboard inputs to any program on the OS) for a certain amount of time. How can I trigger a function based on such idle time data? You can always detect idle times on Linux by using XScreenServer , GetLastInputInfo on Windows and CGEventSourceSecondsSinceLastEventType on Mac I've published desktop-idle using these API's, you can check the source code https://github.com/bithavoc/node-desktop-idle UPDATE: Electron 3 users can use the power monitor API to achieve the same goal: https://electronjs.org/docs/api/power-monitor