-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from michalsn/prepare-release
Prepare release 1.2.0
- Loading branch information
Showing
2 changed files
with
14 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,9 @@ | ||
# Debug Toolbar | ||
|
||
Although the Debug Toolbar rendering is disabled for HTMX requests, you can still access the toolbar | ||
for a given request by checking the URL in the `debugbar-link` response header. | ||
As long as you **don't use** the [head-support](https://htmx.org/extensions/head-support/) extension, | ||
the Debug Toolbar should work out of the box. It will be updated after every request, so please remember | ||
it will only display the latest information. If you want to see what happened in earlier request, | ||
use the `History` tab in the Toolbar. | ||
|
||
### Other options | ||
|
||
Alternatively, if you're rendering content only inside the `body` tag, you can use the snippet below. | ||
|
||
```js | ||
htmx.on('htmx:afterRequest', function (ev) { | ||
let debugBarTime = ev.detail.xhr.getResponseHeader("debugbar-time"); | ||
if (debugBarTime !== null) { | ||
loadDoc(debugBarTime); | ||
} | ||
}); | ||
``` | ||
|
||
It will cause the Debug Toolbar, rendered by the "regular" request, to be automatically | ||
replaced which information from the current HTMX request. | ||
If you're using the `head-support` extension then the Debug Toolbar rendering will not work for `htmx` requests. | ||
You can still access the toolbar for a given request by checking the URL in the `debugbar-link` response header. |