Electron packager not set icon

I have "electron-packager": "^8.2.0" in my package.json and I tried to make a package of electron app with these command: electron-packager ./ app --win --icon=https://www.google.it/images/branding/product/ico/googleg_lodp.ico and electron-packager ./ app --win --icon="https://www.google.it/images/branding/product/ico/googleg_lodp.ico" but the icon is not setted and it set default atom icon. I have tried also with local file, but the icon is still default.

Define file association in Mac with Electron

I am trying to create a simple electron app, that opens Google office files from Google Drive, reads the link file and creates a new window containing that google doc page. I can make it work, if I edit info.plist after building with electron-builder to make the app accept the file extensions '.gdoc, .gsheets and .gslides'. Is there a smarter way that doesn't involve manually editing info.plist?

Electron Service worker registration unresponsive

Electron 1.7.6 does not respond to a service worker registration, while this works on Firefox and Chrome. The promise is neither resolved or rejected, and the console.log calls in the service worker code are not called. Under the Dev Tools, Service Worker section shows it as "installing". Interestingly clicking on "unregister", would unstuck the registration and it would register fine, but I can't reproduce that anymore. This happens with any service worker code I've tried, even when all code

Make electron app smaller?

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?

Electron LiteCoreDomain Error while opening a database Couchbase-lite

I am getting an exception while opening a database in couchbase-lite.I tried using different database name and also checked for the error and referred to this link but it seems that the error is related to the databse file format, but unable to resolve it. Here is the description for the same: Code snippet: const config = new DatabaseConfiguration(); config.setEncryptionKey('secret'); const database = new Database("test1", config) database.setEngine(new CordovaEngine({

Stop trying to Download block maps in electron-builder update

I'm looking for a way to disable looking for the blockmap file in the update process in Electron-builder. This will never exist for us and we're happy to rely on the full download. So far I cant seem to find any way to do this. but it results in the log being spammed with the fail and a stack trace. If this is not possible is there a way to explicitly declare a URL for the blockmap in the latest.yml rather than it just insert .blockmap in the exe url. As i'm hoping a 404 wont result in the stack

ElectronJS: how to clear all cookies from a session?

I am creating cookies using the code given below: ///Cookie let cookie = { url: 'http://www.example.com', name: 'oauthDetailsGoogle', value: JSON.stringify(oauthDetailsGoogle), expirationDate: oauthDetailsGoogle.accessTokenExpireDateTime }; ///save cookie electronConstants().mySession.cookies.set(cookie, (error) => { ///if error then return error if (error) { defer.reject(error); } ///return null if no error else { defer.resolve(true);

ElectronJs: app.quit is crashing the application

Task Terminate the application when all the windows are closed or the Main Window is closed. Problem application crashing when the app.quit() is called. Code app.on('window-all-closed', function () { // if (process.platform !== 'darwin') { // app.quit(); // } app.quit(); }); mainWindow.on('closed', function () { mainWindow = null; app.quit(); }); Log [901:0531/114426:FATAL:resource_dispatcher_host_impl.cc(658)] Check failed: ContainsKey(active_resource_cont

How to install 3rd party applications using Electron as a background process

How can I automate the process of installing a 3rd party software installation along with my electron app installation. Is that possible? Usage scenario. I want to make an application which deals with github repositories, now I want my users to install my app. In the same time I would like to install git for them. As a background process. NOTE: I want to automate the process for all the Operating Systems. Is that possible?

Electron How can I set the ID of a browser window?

Basically, I want to do some communication between 2 ipc renderers. Based on some information in https://github.com/electron/electron/issues/991, I am trying to set the id of a browser window which I'll eventually use to get the browser window and send the events across without involving main.js. Need to know how i can set the id of a browser window. I tried the following: chatWindow = new BrowserWindow({ x: 10, y: 10, width: 500, height: 500, id: 1234, }); The above d

Electron Show dialog on top of all other windows

Is there a way to show the dialog from dialog.showMessageBox() on top of everything? For example, I'm woking on the notepad and given some event in my Electron application it will open a dialog that should now be the main window for the user to see.

Electron - How to make a certificate select pop up window?

I am trying to wrap my head around Electron select-client-certificate. My goal to is to have something like Chrome that pops up and the end user can select which certificate they should use to sign in. Electron by default selects the first available certificate which will not work for the site they are trying to access. Using a specific name also does not work as users are assigned slightly different certificates. Any guidance will be greatly appreciated. Thank you.

Microsoft Azure login fails in electron app

I am trying to integrate Microsoft Azure AD login functionality using ms-adal-angular6. This project is on Angular-6 to create a desktop application using Electron. Everywhere the login works fine except when I create the *.exe file because it has a file:// URL system. Below is the login failed screen after entering correct OTP during the login process. I tried adding a file://* Reply URL under portal.azure.com -> Azure Active Directory -> App registrations -> Settings(of one app) -> Redire

Make electron app compatible with El Capitan

I am new to Electron, but the app I packaged (using electron-packager) for MacOS works fine on 10.12.X and 10.13.X but not on 10.10.5. Is there a way to make it compatible with El Capitan 10.10.5 as well? When I try to run the application, I get an error Check with the developer to make sure SimpleMath works with this version of OS X. You may need to reinstall the application. Be sure to install any available updates for the application and OS X.

Website viewed with electron unable to load all resources

I am trying to load https://trello.com with win.loadURL('https://trello.com'); This works fine but the login page says Your browser was unable to load all of Trello's resources. They may have been blocked by your firewall, proxy or browser configuration. Try refreshing the page and if that doesn't work, check out our troubleshooting guide. I have tried: allowRunningInsecureContent: true webSecurity: false 'Content-Security-Policy': '*' Changing my useragent Nothing shows up in console a

How do you include a distrbution of stencil components in an electron app

I am not really able to include a distribution of a stencil dist in a project. Due to electron being headless chrome, shouldn't it be possible to include it as a script? I seem to have an error regarding the security policy stencil versions: 1.12.2 They work good in standalone-html index-64aa1cf6.js:2443 Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-imoMl/F66ZbGZfn+J

Electron Forge Typescript+Webpack Boilerplate doesn't generate source maps for the renderer script

The source maps are generated only for the main process script, but not for the renderer process script. If the project is compiled via tsc source maps are generated. Link to the docs of the boilerplate: https://www.electronforge.io/templates/typescript-+-webpack-template How to install the boilerplate: npx create-electron-app my-new-app --template=typescript-webpack Would appreciate any help. Thanks.

sqlite3 database opening in Electron

I have no problems in importing sql3 in my Electron-React-Typescript-Webpack app: import sqlite3 from 'sqlite3'; But when I add these lines in main.ts : const sql3_cb = () => { console.log("Welcome to sql3"); } app.on('ready', async () => { createMainWindow(); const infopiecesSqliteDb = new sqlite3.database( path.join(app.getPath('userData'), '/infopiecessql3db'), sql3_cb, ); } when running the app I get the following errors (complete backtrace): (base) marco@

How can I update an electron BrowserWindow icon after the window is already opened?

With the electron api, I can set the window's icon when calling the BrowserWindow constructor, like this: mainWindow = new BrowserWindow({ icon: __dirname + '/electric-glowing-bear.png'); Unfortunately, I haven't been able to figure out how to update the icon after the fact. There seems to be a way to update the dock icon on Mac OS X, however, I am running Linux. The purpose of this is so that I can 'badge' the icon with a number to indicate unread messages are waiting. The only worka

how to connect to local database in electron

I'm new to electron and I'm writing a simple application in angular 5 and electron.i wonder how to store data in my application like personnel forms. I know its possible to store data in MySQL and other database engines in Nodejs code.But I want to store my data in a database engine like SQLite or MySQL using the angular code in typescript.

Electron (How) can I open the dev tools in the Microsoft Teams desktop client?

I thought I had recently seen a developer open the dev tools from inside the Microsoft Teams desktop client (for Windows), but I can't easily replicate that. Shortcuts like Strg+Shift+I, Strg+Alt+I, Shift+Alt+I, F12, Strg+F12, Shift+F12, Strg+Shift+F12, Strg+Alt+F12 don't work. The reason I am not just using the browser version is that the same app behaves differently in browser and desktop version which makes these dev tools kind of necessary for debugging.

Electron Get nativeImage dimensions

I have a nativeImage but am not able to figure out it's width and height. Is this possible? I can't find anything here - https://electronjs.org/docs/api/native-image#imagegetaspectratio

Electron Spectron opens Empty terminals during test run

During execution spectron opens two terminal windows that are blank. First window is the application as I wanted it to be, other windows look like terminals without anything inside. Currently i focus to the first window using focus(). Github issue link : https://github.com/electron/spectron/issues/60 Does anyone have any idea what's going on ? is it a ChromeDriver issue?

How to avoid windows zoom in electron app

If the Windows display zoom is set to 150%, the Electron app also appears zoomed. I want my app to avoid the windows zoom level and always display in 100% zoom only. I have tried the zoomFactor:1 but it's not working.

Prevent Electron App from attaching to console window

I created an Electron App (packed with: electron-builder + nsis-web installer) on Windows. The App works fine, but i want to open the app from a console window (cmd or powershell). Unfortunately, the app is then attached to the console window. When the console window is closed, the app is also closed. The problem does not occur if I use the portable-nsis option. Any way to prevent this?

Electron packager: Need to read the installer name

I am packaging my electron application using electron-packager and creating installer using electron-winstaller. Exe can be downloaded from different channels. reference of channel or site will be appended in exe file itself. Once user starts the installation i need to get that reference from exe. and store it in my application or any file. It will look like: MyApp_REF12345.exe Any clue how i can achieve this?

How to get absolute path to app in Electron app

I use Electron to build my app. I want to load data from zip unpack it to folder file and show it to user. I decompress data and then open window since its html it should work fine. However i see that app.getAppPath() on dev mode is giving me example path D:\elektron but when i build up path is different D:elektron\resources\app how to solve this ?

Electron Poor icon graphics on windows excecutable app

Why my electron app has poor icon graphics I recently create and electron app however when i package it with electron rebuild the icon graphics of the installer and installed app are really poor on windows. The icon am using is 512x512 and i don't have the same problem when i package it to Linux executable .deb file. As you can see the icon is not perfect. Is there a way to improve the icon quality?

Displaying images with spaces in path when using Electron (windows)

I've got a rather straightforward problem. Some of my users insist on using spaces in their directory/file names (and use windows). This sadly breaks the images in my app as the directory isn't read correctly. For example C:\Users\path name\Downloads\image name.jpeg will open fine on Linux (and mac) but fail on windows. URL encoding (encodeURI) doesn't seem to work and I've found nothing on Google (though this should be a simple problem). Any suggestions?

close current window by submenu item in ElectronJs

I have two windows opened as you see in this picture: screenshot I want to close smaller window by clicking on "close" submenu. here's my code: const addMenuTemplate = [ { label:'file', submenu:[ { label:'close', click(){ //i dont know what to put here } } ] } ] what should I do ? I've already test electron.remote.getCurrentWindow().close()

Electron Cypress.io - is it possible to make CORS requests in headless mode

The tests pass in headed Chrome. They fail in headless Chrome and Electron (headed Electron also fails). I'm setting the web security flag to false for each browser in the Cypress/Plugins file. As best I can tell from the logs is that the Options pre flight isn't even being made. The headless browser just return 403 CORS error. The backend server is not even being hit. I'm left wondering if there's another mechanism at work blocking all headless CORS requests.

How to pass ipcRenderer.invoke handler answer to electron renderer process using preload.js

I'm writing a CRA + Electron app and I need to use ipcRenderer.invoke for inter-processes communication. I was able to make ipcRenderer.send and ipcRender.on work in contextIsolation mode, but no luck with ipcRender.invoke. For some reason I don't understand, I can't get the handler response back to renderer in any form (promise or value), all I get is "undefined" value. preload.js const { contextBridge, ipcRenderer } = require('electron'); // whitelist channels const validChannels =

Electron How to dynamically change what's exposed in a preload script?

I have a BrowserWindow with a preload script. I want to expose different things in the preload script depending on what page I have loaded. In my app, either I load page A which gets navigated to page B, or I load page B from the beginning. I was considering passing additional arguments to my preload via: { preload: "path_to_preload.js", additionalArguments: ["onPageB"] } And then my preload can do: const onPageB = process.argv.find(arg => arg === "onPageB&qu

browser window not receiving focus in electron

this problem happen after i update dependency "electron": "^5.0.13" to "electron": "^12.0.6" before this it was working fine. it is hard to say what is a problem so I am telling you how to recreate press p (index.html mousetrap.js), it will open the print window(window 10) after returning from the print window dialog, the browser window did not receive focus (i think) if I try to select text in the browser it highlight with gray color rather than blue (bef

Has anyone ever successfully used electron-packager to convert an electron app into a working .exe on Windows?

So, I have this in my package.json: { "name" : "webgl-demo", "version" : "1.1.0", "main" : "main.js", "scripts" : { "build": "electron-packager . webgl --platform=win32 --arch=x64 --version=0.33.3 --overwrite" } } From command-line I build the executable using this: npm run build I used the electron-sample-apps\webgl project as a guinea pig. I got a webgl.exe in a electron-sample-apps\webgl\webgl-win32-x64 folder. But when I run it, I get a pop-up saying that "A ja

Why does this Spectron code block my Electron app after the first click?

This is the first time I'm trying to create automated tests for an Electron app using Spectron. It might be my rusty knowledge of async programming but I don't know why the code below is misbehaving: it ('should allow me to create an account', function() { return app.client .waitUntilWindowLoaded() .waitForExist('//a[text()="Create Free Account"]') .click('//a[text()="Create Free Account"]') .waitForExist('//button[text()="Create Account"]')

electron-builder is not calling x64 installer [win10]

electron-builder is calling 32bit installer causing paths point to WOW64 equivalents instead of the real x64 paths. Process that calls installer is 64bit, then 32bit installer is called and eventually application that is "runAfterFinish" is 64bit. How can I overcome this issue and force installer to call x64 version? Tested on Windows 10, electron-builder 19.16.3 Builder ran with --x64 option gives output: Building NSIS installer Packaging NSIS installer for arch x64 Calling installer

"wasm decoding failResult" when app is packaged with electron-forge

I am trying to package an electron app (that uses wasm) with electron-forge. At the moment (while I fight packaging!) it's little more than a hello-world, but it compiles a simple rust lib to wasm, then I copy the .js and .wasm files into ./src/ and package as an electron app. Running it using "electron-forge start" works perfectly, but when I package it with "electon-forge make" (to a DMG on Mac OS in this case) and then install and run it, it seems to be trying to load the wrong .wasm file (

Electron: Maximize Window on Start

I'm creating a electron app and am trying to allow it to open so that it is maximized on start. Is there a function of some kind that you put in the main.js to maximize the window? Thanks!

Electron nativeImage.createFromNamedImage low resolution

I'm using electron's nativeImage class to use a macOS icon in my app. I used nativeImage.createFromNamedImage("NSComputer") to get the icon, but it's really low resolution (32x32). I tried the resize method with a height option of 512, but it just increased the size of the original blurry image. How can I get a higher-resolution picture from this, like around 512 or 1024px?

Can I use the Google Picker API in an electron app?

I'm trying to use the Google Picker API to display a picker for the user to select a file. I have this working great in a web app (in a normal browser), but when I run the same code in an electron app, I see a 400 message in the popup iframe, and get the following console errors: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://docs.google.com') does not match the recipient window's origin ('file://'). Failed to load resource: the server responded with a statu

electron auto updater not installing in OSx

electron builder version : 20.28.4 electron-updater version : 3.1.2 building for OSx, Windows & Ubuntu I'm trying to create an electron app with an auto update mechanism. I'm facing an issue with the auto updater, especially for OSx. It works quite good on linux and windows (new version is downloaded and installed with autoUpdater.quitAndInstall(); or when the user quit the app). On OSx however, the new version gets downloaded, but is never installed. The event fired when on update is do

"Error Launching Browser" When Running Electron from Cypress

I am getting a the following error while trying to launch electron from Cypress: Error: ERR_FAILED (-2) loading 'http://localhost:4200/__/#/tests/integration/features/AssetDownload/assetDownload.feature' at rejectAndCleanup (electron/js2c/browser_init.js:217:1457) at Object.stopLoadingListener (electron/js2c/browser_init.js:217:1832) at Object.emit (events.js:315:20) I have already tried the suggestions listed in this SO post: Cypress text execution error after version update I have

  1    2   3   4   5   6  ... 下一页 共 6 页