Manual:Hooks/OutputPageBeforeHTML

Warning
Use this hook at your own risk.
 * Not used for page previews (bug 7050)
 * Can cause infinite loops (see talk)
 * May fail under certain caching systems
 * Runs on every page load and page view, so increases overhead

Details

 * $out: the OutputPage (object) to which wikitext is added
 * $text: the HTML text (string) that is being added