1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-06-26 04:33:26 +02:00

Add option to not immediately show AJAX requests (#315)

By default, the debug bar will immediately show new AJAX requests. If
your page makes a lot of requests in the background (e.g. tracking),
this constant switching of the active data set can be disruptive to the
debug bar user.

This commit adds an option for disabling this behavior by calling
setAjaxHandlerAutoShow(false) on the JavascriptRenderer, like this:

    $renderer = $debugbar->getJavascriptRenderer();
    $renderer->setAjaxHandlerAutoShow(false);

When this behavior is disabled, AJAX requests are still available in the
drop-down list, but won’t become active until the user explicitly
selects them.
This commit is contained in:
James Johnston
2017-03-04 23:17:18 -08:00
committed by Barry vd. Heuvel
parent 7a13e2a42e
commit cbdeba00d0
5 changed files with 59 additions and 9 deletions

View File

@ -43,6 +43,14 @@ request. Use true as the first argument of `sendDataInHeaders()`.
$debugbar->sendDataInHeaders(true);
By default, the debug bar will immediately show new AJAX requests. If your page
makes a lot of requests in the background (e.g. tracking), this can be
disruptive. You can disable this behavior by calling
`setAjaxHandlerAutoShow(false)` on the `JavascriptRenderer`, like this:
$renderer = $debugbar->getJavascriptRenderer();
$renderer->setAjaxHandlerAutoShow(false);
## Stacked data
Some times you need to collect data about a request but the page won't actually