broz
broz copied to clipboard
Basic navigation
Is it possible to add an input field in a similar fashion as the drag button that can take user input and communicate it with the BrowserWindow
object?
I've been playing around with this idea and tried a preload script,
webPreferences: {
preload: path.join(__dirname, 'renderer.js'),
},
but I'm not sure if this is the correct route, or if this is even possible. I can't seem to get access to the client-side's window
or document
objects in order to execute
const input = document.getElementById('url-input')
input.addEventListener('submit', () => {
ipcRenderer.send('search', input.value)
})
Yeah, have thought about that. But I kinda feel that's too much to implement this simple feature. And sadly, it looks like Electron does not provide native prompts. https://github.com/electron/electron/issues/472
If anyone could find an elegant way to do that, I am happy to have it. Thanks