electron-renderer-value
v1.1.0
Published
Get a value as a promise from an electron renderer process
Downloads
6
Maintainers
Readme
electron-renderer-view
Easily get a value from an electron renderer instance
(eg. some attribute on the window object)
Usage
const { BrowserWindow } = require('electron')
const rendererVal = require('electron-renderer-value')
// ...
app.on('ready', () => {
const ipcMain = electron.ipcMain
const win = new BrowserWindow()
win.loadURL(`file://${__dirname}/someFile.html`)
rendererVal(win.webContents, 'window.foo')
.then(param => {
console.log(param) // value of foo from window object of renderer
})
}
Contributions / Issues
Please feel free to open an issue or a PR if something's broken, or if you'd like some specific features added.
License
MIT