Skip to content

Capture DOM events (e.g. clicks) for same-origin iframe contentΒ #14008

@rodolfoBee

Description

@rodolfoBee

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

8.34.0

Framework Version

No response

Link to Sentry event

https://dev-curumas.sentry.io/replays/b631bc650dd14e8192c4d2b4df61bc79/?project=5242419&query=&referrer=%2Freplays%2F&statsPeriod=24h&t_main=tags&yAxis=count%28%29

Reproduction Example/SDK Setup

Have a page with multiple nested iframes, for example:
Top:

<script>
	window.sentryOnLoad = function () {
		Sentry.init({
			replaysSessionSampleRate: 1.0,
			integrations: [
				Sentry.replayIntegration({maskAllText: false})
                         ],
	         })
	}
</script>
<script src='https://js.sentry-cdn.com/651430b2d9bbd075301fbd0377389722.min.js' crossorigin="anonymous"></script>
<body>
    Just the high level body, nothing to see here.
<iframe src="iframe1.html" width="1000" height="1000"></iframe>
</body>

Nested iframes:

  <script src="https://js.sentry-cdn.com/cf49a5aeecb64d96a5631a5cc50883a4.min.js" crossorigin="anonymous"></script>
  <script>
    throw new Error("Iframe 1 error")
  </script>
  <iframe src="iframe2.html" width="700" height="700"></iframe>
<body>

Steps to Reproduce

Run a simple page with few nested iframes and click around on each of the iframes

Expected Result

The SDK registered all clicks on the iframes and these are visible in the replay sent.

Actual Result

No user click breadcrumbs when there are nested iframes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPackage: browserIssues related to the Sentry Browser SDK

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions