title: Joomla plugin get contents of whole page before output
body: <p>With my Joomla plugin I would like to get and modify all the contents before the output is created.   </p>
  
  <pre><code>function newContent($html)
      {
      $html = "new content";
      return $html;
      }
  
  function onContentPrepare()
      {
      ob_start(array($this, "newContent"));
      return true;
      }
  
  function onContentBeforeDisplay()
      {
      ob_end_flush();
      return true;
      }
  </code></pre>
  
  <p>I tried with <code>onContentAfterDisplay</code> but it continues to change only a small piece and not all the output.</p>