Sorry I only found ways to test it when page loaded.
Find text, with browser's find function:
DOMContentLoaded&gBrowser.contentWindow.find('Firefox')
Find in innerHTML code:
DOMContentLoaded&gBrowser.contentDocument.body.innerHTML.indexOf
('Firefox')>-1
Both are window events.