If you really wanted to you could roll your own browser with an Electron core - you'd be able to inject stuff there willy-nilly.
At work we instrument our puppeteer (headless chrome scripted) tests so that it basically sumps out the Dom and other important rendering things. I then wrote a tool that lets one step through the dump with an interactive timeline showing the current state of the page along with console events, user generated events, etc.
So the power is there if you want to get your hands really, really dirty.
I had to step away from using electron because I encountered segfaults like `Received signal 11 SEGV_MAPERR 000000000060` just on visiting cnn.com and clicking one of their nav links (without much going on otherwise, which I found kinda crazy).
Electron also only recently added support for PDFs, and it's still a little buggy. I was able to get around most of these with pdf.js.
I ended up using a combination of chrome extension for injecting stuff into webpage + rpc to a local node.js server running inside an electron app (for convenience). I only made this for personal use, so I'm ok with <arbitrary_caveat>s.
> because I encountered segfaults like `Received signal 11 SEGV_MAPERR 000000000060` just on visiting cnn.com and clicking one of their nav links (without much going on otherwise, which I found kinda crazy).
Yeah, web browsers have so much compatibility code this does not surprise me...
Yeah, I also looked into qutebrowser and Falkon, which let you run arbitrary python against the QtWebEngine bindings. That’s probably the best route, but neither of them fully support WebExtensions / have the ecosystem of chrome or Firefox.
At work we instrument our puppeteer (headless chrome scripted) tests so that it basically sumps out the Dom and other important rendering things. I then wrote a tool that lets one step through the dump with an interactive timeline showing the current state of the page along with console events, user generated events, etc.
So the power is there if you want to get your hands really, really dirty.