bskinn / bga-wingspan-scraper

Firefox extension to scrape data from a Wingspan game replay on BGA
MIT License
2 stars 0 forks source link

Add mechanism for debug printing from inside the active extension #66

Closed bskinn closed 7 months ago

bskinn commented 7 months ago

Closes #56.

This is going to be less flexible than I would prefer, but since we're working with compiled & Webpacked TypeScript, just using eval(...) isn't going to work -- we have to import the functions to be called via TypeScript mechanisms, and then call them outright, without eval().

It should be possible to pull arguments from the debug <input>. For any given function, we'll know how many arguments we need, so we just pull that many from the .split(',') args list and ignore the rest.

If there gets to be too many debug commands, then probably going one level deep in a hierarchy of <select> elements will be called for. A top-level selector that then exposes a set of low-level selectors. Hopefully it'll be awhile before we get to that point...........