Typescript + React/Redux: Property “XXX” does not exist on type ‘IntrinsicAttributes & IntrinsicClassAttributes

So after reading through some related answers (specifically this one and this one and looking at @basarat’s answer to the question, I managed to find something that works for me. It looks (to my relatively new React eyes) like Connect was not supplying an explicit interface to the container component, so it was confused by … Read more

Electron nodeIntegration not working, also general weird Electron behavior [duplicate]

Electron 12 is now defaulting contextIsolation to true, which disables Node (here are the release notes; and here’s the PR). Here’s a discussion of this change. nodeIntegration for what it’s worth is going to be removed in a future Electron version. The easiest way to fix this is to simply disable context isolation: mainWindow = … Read more

Use of require(lib) versus in Electron apps

Some libraries only expose their variables through a CommonJS interface. Others, like jQuery, will also expose them as global variables. The reason you can’t just do <script src=”https://stackoverflow.com/questions/37736836/…”></script> for a library that only exposes through CommonJS is that it won’t bind to the global space. Binding with CommonJS module.exports = myLibrary; Bindings to the global … Read more

How to import ipcRenderer in vue.js ? __dirname is not defined

Updated Answer – Nodeintegration disabled and contextIsolation enabled In order to use the ipcRenderer with Vue CLI plugin Electron Builder you need to first setup electron to utilize a preload.js file. Inside your vue.config.js file you need to add the preload.js path like this: // vue.config.js – project root module.exports = { pluginOptions: { electronBuilder: … Read more

Replace ‘Prompt’ in on Electron

prompt, confirm and alert are functions which blocks the execution thread of the script until a user input and that’s the reason electron team didn’t supported it. Instead you can use some third party package for the same reason. Here are some packages which provides this functionality in async way https://www.npmjs.com/package/smalltalk https://www.npmjs.com/package/vex-js https://www.npmjs.com/package/dialogs

Open external file with Electron

There are a couple api’s you may want to study up on and see which helps you. fs The fs module allows you to open files for reading and writing directly. var fs = require(‘fs’); fs.readFile(p, ‘utf8’, function (err, data) { if (err) return console.log(err); // data is the contents of the text file we … Read more

How can I force external links from browser-window to open in a default browser from Electron?

Update: this does not work in electron >= 22 because on(‘new-window’ has been removed. I came up with this, after checking the solution from the previous answer. mainWindow.webContents.on(‘new-window’, function(e, url) { e.preventDefault(); require(‘electron’).shell.openExternal(url); }); According to the electron spec, new-window is fired when external links are clicked. NOTE: Requires that you use target=”_blank” on your … Read more

Electron.remote is undefined

Update 2020, since this answer still appears at the top. For the original answer to work in current versions of Electron, you need to set enableRemoteModule when creating the window in your main process. const myWindow = new BrowserWindow({ webPreferences: { enableRemoteModule: true } }); Original answer: remote is needed only to require other modules … Read more