8000 bug #50487 [VarDumper] Use documentElement instead of body for JS flag · symfony/symfony@35f724b · GitHub
[go: up one dir, main page]

Skip to content

Commit 35f724b

Browse files
committed
bug #50487 [VarDumper] Use documentElement instead of body for JS flag
Using `document.documentElement` allows to use the dumper outside of a `<html><body>...</body></html>` scenario. Fixes: #50487
1 parent 1a9ac8d commit 35f724b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ protected function getDumpHeader()
163163
<script>
164164
Sfdump = window.Sfdump || (function (doc) {
165165
166-
if (doc.body instanceof HTMLElement) {
167-
doc.body.classList.add('sf-js-enabled');
166+
if (doc.documentElement) {
167+
doc.documentElement.classList.add('sf-js-enabled');
168168
}
169169
170170
var rxEsc = /([.*+?^${}()|\[\]\/\\])/g,

0 commit comments

Comments
 (0)
0