Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-79068

Improve iframe load handling in Activity Stream to prevent null body errors

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • Dashboard & Gadgets
    • None
    • 1
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Summary

      Make iframe loading checks in Activity Stream gadget more resilient (avoid JS error when body is not yet available).

      Environment

      • Jira Data Center 9.12.26
      • Browser: Firefox (latest at the time of testing)
      • Extension: NoScript enabled

      Current Behavior

      When the Activity Stream gadget loads in Firefox with the NoScript extension enabled (even with the Jira domain fully whitelisted), the following error appears in the console:

      Uncaught TypeError: can't access property "hasChildNodes", iframe.contentDocument.querySelector("body") is null

      The gadget fails to load until a layout event is triggered (e.g., resizing the browser window).

      Expected Behavior

      The gadget should degrade gracefully and not throw errors if the iframe’s <body> is not yet available.
      For example, checking for the existence of the body element before accessing it, or attaching a listener to the iframe loadevent.

      Impact

      • Users running security extensions such as NoScript encounter broken Activity Stream gadgets even if the Jira domain is fully whitelisted.
      • While this is an edge case, making the check more robust would also reduce the chance of timing issues in other scenarios (e.g., lazy loading, slower browsers, or unusual network conditions).

      Suggested Fix

      Update the iframe handling logic in the Activity Stream to:

      • Verify that iframe.contentDocument.querySelector("body") is not null before accessing .hasChildNodes().
      • Optionally wait for the iframe’s load event before running DOM checks.

              Unassigned Unassigned
              82697f38779c Vasti Marucci
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: