I am trying to make a simple Google Chrome extension – like finding a specific element on the page and display an alert.
My problem is that the specific page loads relatively slow (having also some AJAX behind).
How can I make my check only when all the page is loaded?
I tried "run_at" : "document_idle" in my manifest file, but with no success. It shows me the message, before the whole page loads.
I was thinking to check every second (or something) the whole DOM elements, but is this a feasible solution? I think it will slow down the page…
Thanks.
If that element does not exist on the page when you click “view source”, then one way of catching it would be listening to
DOMSubtreeModifiedevent, which fires each time DOM is modified: