Skip to content

0.86.8

Choose a tag to compare

@botberry botberry released this 01 Aug 11:56
· 17 commits to main since this release
3d36487

The built-in toolbar script is now compatible with django-debug-toolbar 7.0.0,
which renders the toolbar inside a shadow DOM by default.

Previously, all DOM queries targeted #djDebug directly on the document,
which broke under shadow DOM isolation — querySelector cannot pierce a shadow
boundary.

Using a getDebugElement() helper that locates #djDebug via
the shadow root of its parent element (#djDebugRoot):

function getDebugElement() {
  const root = document.getElementById("djDebugRoot");
  if (root) {
    return (root.shadowRoot || root).querySelector("#djDebug");
  }
  return document.getElementById("djDebug");
}

This also handles the USE_SHADOW_DOM = False fallback gracefully, keeping
backward compatibility with older versions of the toolbar.

This release was contributed by @daudln in #926

Additional contributors: @Copilot, @pre-commit-ci[bot], @bellini666