Some time ago an acquaintance started a danish version of “Word a Week” on Twitter. She would every week tweet a word that she thought wasn’t used enough. It could be a real word or some old slang. I found it very funny and thought “Why isn’t there a site…
Over the last decade I have started to travel more and more. When travelling a lot one of the constant problems is figuring out how to pay for stuff like food accommodation etc. Without paying millions in fees to your bank or Forex companies. …
At work we are starting to test Electron and see what we can do with it. Electron gives us several ways to create desktop applications. One of those are as simple as opening a URL in a BrowserWindow. But sometimes we want to do more and run code in Electron based on what happens in the application embedded in our BrowserWindow.
Fortunately Electron gives us access to ipcRenderer and ipcMain which together with a simple preload script makes this quite easy.
So let’s start with a simple Electron app. This will open https://google.com and use our preload script.
When we receive an event on the postMessage channel we will just use console.log to log some output. If open-url is then triggered we will send a message to the renderer process for our mainWindow.
I build stuff at Relatel A/S, vivid traveller and gear junkie.