electron

Why doesn't npm start run electron app?

你。 提交于 2019-12-05 18:54:58
I have the following in package.json for several electron apps: "name": "my-app", "version": "1.0.0", "description": "", "main": "main.js", "scripts": { "start": "electron ." }, When I'd do npm start in the app folder, the corresponding app use to run. I just started getting the following output for all of my electron apps when using npm start : electron . module.js:471 throw err; ^ Error: Cannot find module './' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25). at Module.require (module.js:497:17) at require (internal/module.js:20:19) at

iframe with local resource in Electron

谁说胖子不能爱 提交于 2019-12-05 18:05:14
I need to render iframe in my Electron application: <!DOCTYPE html> <html> <head> <title></title> </head> <body> <iframe sandbox='allow-scripts' src='frm.html'></iframe> </body> </html> where the frm.html links the local file script foo.js which is part of my Electron application <!DOCTYPE HTML> <html> <head> <title></title> <script src="foo.js"></script> </head> <body> <p>Inside iframe</p> </body> </html> When I run the application in Electron I can see this error in devtools console Not allowed to load local resource: file:///C:/electron/app1/foo.js Is it possible such scenario in Electron?

Having two isolated (in terms of history/cookies/localstorage) BrowserViews in the same BrowserWindow with Electron

匆匆过客 提交于 2019-12-05 17:07:33
Let's say I have two BrowserView in the same BrowserWindow and an UI button allowing the user to switch between showing bv1 or bv2 (like the "tab" system in browsers like Firefox, Chrome, that allows you to switch between the different pages): browserWindow = new BrowserWindow({ width: 1200, height: 600 }); let bv1 = new BrowserView({ webPreferences: { nodeIntegration: false }}); bv1.setBounds({ x: 0, y: 0, width: 1200, height: 600 }); bv1.webContents.loadURL('https://www.twitter.com'); let bv2 = new BrowserView({ webPreferences: { nodeIntegration: false }}); bv2.setBounds({ x: 0, y: 0, width:

electron桌面应用

回眸只為那壹抹淺笑 提交于 2019-12-05 15:22:08
npm/6.4.1 node/v8.9.0 win32 x64 安装时使用淘宝镜像,否则会一直卡在 > electron@7.1.2 postinstall E:\myObject\my\netObject\electron-hello\electron-quick-start\node_modules\electron > node install.js npm install --ELECTRON_MIRROR="https://cdn.npm.taobao.org/dist/electron/" 来源: https://www.cnblogs.com/lvshoutao/p/11930760.html

How can I display a Save As dialog in an Electron App?

老子叫甜甜 提交于 2019-12-05 13:52:06
问题 I am writing a NodeJS Electron App to be distributed on all platforms. I have a download button that I would like to pop open a Save As dialog with the file being provided from the server. Does anybody know the best way to do this? Here are the things I have tried that work when running the node app locally but fail after I have packaged the app with electron-packager: Setting window.location.href to the location of the file Setting the src of a hidden iframe to the location of the file When

Accessing an SDK that is written in c++ using node.js

。_饼干妹妹 提交于 2019-12-05 13:31:01
I have a SDK that will communicate with my Scanner device that is written in C++ language. I need to develop an Electron App that can access the Scanner device. I know there are many libraries available for scanner but I want to use this SDK since it will allow me to access full feature of the device and moreover it is provided by the device manufacturer. So, is there any way to implement this. Please suggest me any idea. You can use the native V8 API for that. You will need to provide a layer over your C++ code and expose it as Javascript entities. if there's also a C-style interface you

Where can I find the logs for my Electron app in production?

烂漫一生 提交于 2019-12-05 13:10:23
问题 I've built an app with Electron and used Electron-Builder to create a Squirrel windows installer and updater. It all works great but I'm having trouble debugging the production version of my app. Are the logs created by a console.log written somewhere on disk when using the production version? If so, where can I find them? Or are those all removed when compiling the executable? There must be some kind of log file for my app right? I've found the SquirrelSetupLog in C:\Users\Tieme\AppData

Overlay Electron

可紊 提交于 2019-12-05 12:43:09
I am wondering if it is possible to overlay an application made in electron over a game. essentially similar to how steam overlays in games. I want this because we have made a timer web app that times tasks and are debating making it an overlay if possible. to time certain events in games that reoccur I have no idea if this can be achieved but it is something high on our list. Any example of how this can be achieved or has anyone done this before. Thanks, Kieran To draw overlay in a game, you need hook Direct3D or OpenGL api according to which the game use. And before present call(in D3D), you

How can I use node “fs” in electron within angular 5

旧巷老猫 提交于 2019-12-05 12:40:09
I try to use Electron and Angular5 to write my first desktop App but unfortunately i am stuck in using the fs module. It seems that I have imported fs correctly (no errors within Visual Studio Code and code completion) but when i tried using "fs.readFile" the console prints out this error: Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_2_fs__.readFile is not a function This is the code of my service so far: import { Injectable } from '@angular/core'; import { ElectronService } from 'ngx-electron'; import * as fs from 'fs'; import { OpenDialogOptions } from 'electron'; @Injectable() export class