Search code examples
htmlfirebugxdebugconsole.logvar-dump

Is there a way to output HTML within Firebug's console?


I'm using Firebug's console.log() to output Xdebug's var_dump() result and it looks like this:

<pre class='xdebug-var-dump' dir='ltr'>
<b>array</b> <i>(size=1)</i>
  'offset' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'40'</font> <i>(length=2)</i>
</pre>

Is there some way to output it as processed HTML without using the HTML tab within the Net panel?


Solution

  • Firebug doesn't allow to output arbitrary HTML within the Console panel due to security reasons and to avoid breaking the display of the output. So you are not able to let the Console panel display your XDebug output.

    The Console panel provides limited formatting options, though. The allowed CSS properties include all background-*, border-*, color, font-*, *line*, margin-*, padding-* and text-* properties.

    To get PHP debug output you may install the Firebug extension FirePHP. It works together with a server component, which lets you log information from within your PHP environment via an fb() function.