Skip to content

Commit 36579a1

Browse files
committed
[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 6acdcd5 commit 36579a1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Dumper/HtmlDumper.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ 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');
168-
}
166+
doc.documentElement.classList.add('sf-js-enabled');
169167
170168
var rxEsc = /([.*+?^${}()|\[\]\/\\])/g,
171169
idRx = /\bsf-dump-\d+-ref[012]\w+\b/,

0 commit comments

Comments
 (0)