I use Tampermonkey to inject some helper functions into every website I visit. I would like to do the same thing to an Electron app.
When I'm implementing a feature in the app I'm working on at work, I frequently have to make the same eight clicks to get to my feature. I wrote a script that records the selectors of the elements I click, stores them in localStorage, and replays them when I right click. So far, my solution has been to store that script in a snippet, which means I need to have DevTools open and ctrl+enter every time I reload.
I would like to load my script automatically every time I open the app, preferably without needing to open DevTools. (I could create a Chrome extension, install it once in a local branch, then revert my changes, my team none-the-wiser. However, I suspect that DevTools extensions--the only kind that work in Electron--require DevTools to be open. Still, pressing F12 once is a lot better than several clicks.)
My app is actually stored in two different repositories--one for Electron and the features I work on, and one for the HTML the app loads (a shell). I could make a spike branch in the shell repo and simply store my script there, then always have Electron pointed at my local version of the shell. The unfortunate part about that is not getting automatic updates to that repo (which, admittedly, are infrequent so it would be a minor pain-point and is currently my best option).
Does anyone have a cleverer solution?