The Message from the documentation is not usable in my case because of this: "
The URL pattern must contain at least a second-level domain; ". I don't want that limitation. I need it to work everywhere as long as the extension is enabled. I mostly develop it for myself and colleagues to help out with debugging, so any extra effort in using it is unwanted. Must be as simple as possible. Essentially, one-click debugging.
I really like the SO solution. It is quite limited comparing to what I've had. I did all the parsing and the logic in the injected script, now I'll shift it to the popup, but it shouldn't be a biggie as long as I have my vars.
The only nuance is that I'm deploying a setInterval on the page to check if my vars have arrived. I have it running about ten times with a 2 second interval. The vars I'm looking for are dependent on a third party lib, which can get quite heavy, and take quite some time to load and execute, so there's no real expectation to get the vars once the window is loaded. I effectively give the lib 20 more seconds to initialize after injecting my script.
But I guess I could just keep doing that and reading the timer variable from my popup. If the vars are not there and the timer is below 10 then display a spinner. If they're still not there after the timer is at 10, then just report no library present. It will look awkward though. I will have to do another setInterval in my popup and have it polling the injected script's setInterval. Very awkward. But well, I guess that's how the extensions API developers want it.