I laughed, because the answers/opinion provided in the comments, are very useful to answering the question, probably good enough to accept as an answer, hence this meta post:
Seriously, those four comments almost completely suffice as a good answer, even if it merely attempts to dispel the practicality of what I wish to achieve, although I'd say the XKCD comic vastly over-exaggerates the complexity of my question.
In case the question was closed because it was too broad:
According to the principles here: Why questions about "the correct way" are too broad
- State your criteria.
The answer ideally needs to take into account, that the backend is Qt/C++ oriented, so I can interface easily with the other libraries I depend on. I can do things like inject JQuery into the webpage, or track printfs and the like. If it matters, the current engine I am using is based upon Chromium, https://wiki.qt.io/QtWebEngine
- Be specific.
- I chose html specifically. Not xml or anything like that.
- I laid out a specific example, with opacity
- I gave my language and framework, Qt/C++ along with its WebEngine based on Chromium
- Focus on requirements.
Like for example, lets say that only one value changes in a 100,000 line html document changes; Do I reparse the entire document, compare, and find the change, or is there a way to avoid all of that and fish out the difference?
- In short, I require the intelligent way to parse in the worst case scenario.
- Tell us what you want to achieve, and ask us how you can achieve it.
My original strategy of just detecting every change in the html string and parsing it on an interval, seems to me, to be a very bad approach.
What API design philosophies, or existing API's, should I employ when interfacing with HTML, that will give me the correct signals to do code injection, or when to scrape data?
- Maybe this could be worded better, but I kept it semi-broad in case strategies or APIs for doing this sort of thing already exist, or have already been established
- If not, I was going to suggest a black-list or white-list approach. Ask whether it is possible to save processing power by parsing with diffs, and how that can be achieved.
If my question is really that poor despite all of this, how can I improve upon it?
Would perhaps asking three different questions be appropriate:
- How to reparse HTML using diffs to save processing power?
- Advantages and disadvantages to doing a whitelist approach to parsing and tracking HTML?
- Advantages and disadvantages to doing a blacklist approach to parsing and tracking HTML?