René's URL Explorer Experiment


Title: feedback: screenshot can contain the feedback form itself, because `getDisplayMedia` is called in the same task that hides the form · Issue #25657 · getsentry/sentry-javascript · GitHub

Open Graph Title: feedback: screenshot can contain the feedback form itself, because `getDisplayMedia` is called in the same task that hides the form · Issue #25657 · getsentry/sentry-javascript

X Title: feedback: screenshot can contain the feedback form itself, because `getDisplayMedia` is called in the same task that hides the form · Issue #25657 · getsentry/sentry-javascript

Description: Is there an existing issue for this? I searched for the symptom and did not find one. Package and version @sentry/browser 11.5.0 (@sentry/feedback 11.5.0), feedbackIntegration({ enableScreenshot: true }). develop and the latest release (...

Open Graph Description: Is there an existing issue for this? I searched for the symptom and did not find one. Package and version @sentry/browser 11.5.0 (@sentry/feedback 11.5.0), feedbackIntegration({ enableScreenshot: t...

X Description: Is there an existing issue for this? I searched for the symptom and did not find one. Package and version @sentry/browser 11.5.0 (@sentry/feedback 11.5.0), feedbackIntegration({ enableScreenshot: t...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/25657

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feedback: screenshot can contain the feedback form itself, because `getDisplayMedia` is called in the same task that hides the form","articleBody":"## Is there an existing issue for this?\n\nI searched for the symptom and did not find one.\n\n## Package and version\n\n`@sentry/browser` 11.5.0 (`@sentry/feedback` 11.5.0), `feedbackIntegration({ enableScreenshot: true })`.\n`develop` and the latest release (11.8.0) have the same sequence in `useTakeScreenshot.tsx`, as far as I can read it.\n\n## What happens\n\nSometimes the screenshot the user adds in the feedback form is a picture of the page *with the feedback form on top of it*, instead of the page alone. The picture is then sent with the feedback.\n\n## Why\n\nIn `packages/feedback/src/screenshot/components/useTakeScreenshot.tsx` the effect does:\n\n```ts\nonBeforeScreenshot();                 // ScreenshotEditor: dialogStyle.display = 'none'\nconst stream = await NAVIGATOR.mediaDevices.getDisplayMedia({ ... preferCurrentTab: true ... });\n```\n\n`onBeforeScreenshot()` only sets `display: none` on the dialog. `getDisplayMedia` is called right after, in the same task, before the browser has painted a frame without the dialog. The tab capture starts from the last frame the compositor produced, so on a busy machine that frame can still be the one with the form in it. The first frame of the video is what `onloadedmetadata` hands to the editor, so the form ends up in the picture.\n\n## Reproduction\n\nA page with a blue 56px bar at the top and the feedback form opened over it. The test clicks \"Add a screenshot\", reads the editor's background canvas and checks that the top 40px are the page's blue bar and not the form.\n\n`app.js` (bundled with `esbuild app.js --bundle --format=esm --outfile=dist/app.js`):\n\n```js\nimport { feedbackIntegration, getFeedback, init } from '@sentry/browser'\n\ninit({\n  dsn: 'https://public@example.invalid/1',\n  integrations: [feedbackIntegration({ autoInject: false, enableScreenshot: true })],\n})\n\ndocument.getElementById('open').addEventListener('click', async () => {\n  const form = await getFeedback().createForm()\n  form.appendToDom()\n  form.open()\n})\ndocument.documentElement.setAttribute('data-ready', '')\n```\n\n`dist/index.html`:\n\n```html\n\u003c!doctype html>\n\u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\u003cstyle>\n  body { margin: 0; background: #101214; color: #eee; font: 14px system-ui; }\n  nav { height: 56px; background: rgb(0, 102, 255); }\n  pre { margin: 12px; padding: 8px; background: #000; height: 520px; }\n  #open { position: fixed; right: 16px; bottom: 16px; }\n\u003c/style>\n\u003cnav>\u003c/nav>\n\u003cpre>some page content\u003c/pre>\n\u003cbutton id=\"open\">feedback\u003c/button>\n\u003cscript type=\"module\" src=\"/app.js\">\u003c/script>\n```\n\n`repro.spec.ts` (Playwright 1.62.1, Chromium, `--use-fake-ui-for-media-stream`, viewport 390x800):\n\n```ts\nimport { expect, test, type Page } from '@playwright/test'\n\ntest.use({\n  viewport: { width: 390, height: 800 },\n  launchOptions: { args: ['--use-fake-ui-for-media-stream'] },\n})\n\n/** Headless Chromium hands the capture a frame only when the page paints, so paint one pixel on every poll. */\nasync function repaintCorner(page: Page) {\n  await page.evaluate(() => {\n    let dot = document.getElementById('corner')\n    if (!dot) {\n      dot = document.createElement('div')\n      dot.id = 'corner'\n      dot.style.cssText = 'position:fixed;left:0;top:0;width:1px;height:1px;z-index:2147483647'\n      document.body.append(dot)\n    }\n    dot.style.background = dot.style.background === 'rgb(0, 0, 0)' ? 'rgb(255, 255, 255)' : 'rgb(0, 0, 0)'\n  })\n}\n\ntest('the screenshot holds the page, not the feedback form', async ({ page }) => {\n  await page.goto('/')\n  await page.waitForSelector('html[data-ready]', { state: 'attached' })\n  await page.locator('#open').click()\n  await page.getByRole('button', { name: 'Add a screenshot' }).click()\n  const canvas = page.locator('#sentry-feedback canvas#background')\n  await expect.poll(async () => {\n    await repaintCorner(page)\n    return canvas.evaluateAll((all: HTMLCanvasElement[]) => (all.length === 1 ? all[0]!.width : 0))\n  }).toBeGreaterThan(0)\n\n  // The share of the top 40px of the picture that is the page's blue bar.\n  const share = await canvas.evaluate((el: HTMLCanvasElement) => {\n    const { data } = el.getContext('2d')!.getImageData(0, 0, el.width, 40)\n    let blue = 0\n    for (let i = 0; i \u003c data.length; i += 4) {\n      if (Math.abs(data[i]!) + Math.abs(data[i + 1]! - 102) + Math.abs(data[i + 2]! - 255) \u003c 60) blue += 1\n    }\n    return blue / (data.length / 4)\n  })\n  expect(share, 'blue bar share of the top 40px of the screenshot').toBeGreaterThan(0.9)\n})\n```\n\nIt does not fail on an idle machine. It fails when the browser is short of CPU.\n\n## Measured\n\n`mcr.microsoft.com/playwright:v1.62.1-noble` on an x86_64 Linux VM, `docker run --cpus=2`, with 8 busy loops (`while :; do :; done`) running next to the browser, 1 worker, 200 runs each:\n\n| SDK | runs where the picture holds the form |\n|---|---|\n| 11.5.0 as published | 16 of 200 |\n| 11.5.0 with the patch below | 0 of 200 |\n\nIn a larger app with the same setup, no busy loops, 2 CPUs: 1 of 100. With 4 CPUs and no load: 0 of 100. I could not make it happen on a laptop at idle.\n\n## Suggested fix\n\nLet the page draw two frames without the form before asking for the capture, with a timeout so a tab that draws no frames (a background tab) does not hold the screenshot forever:\n\n```diff\n       const takeScreenshot = async () => {\n         onBeforeScreenshot();\n+        await new Promise\u003cvoid>(resolve => {\n+          let frames = 2;\n+          const next = () => (--frames > 0 ? WINDOW.requestAnimationFrame(next) : resolve());\n+          WINDOW.requestAnimationFrame(next);\n+          setTimeout(resolve, 1000);\n+        });\n         const stream = await NAVIGATOR.mediaDevices.getDisplayMedia({\n```\n\nWith this patch the same reproduction gave 0 of 200. On the same load, waiting for one frame instead of two still failed in 3 of 500 runs (the larger app, 2 CPUs with 4 and 8 busy loops); two and three frames gave 0 of 500 each.\n\nHappy to open a PR if that direction is fine.\n","author":{"url":"https://github.com/larcane97","@type":"Person","name":"larcane97"},"datePublished":"2026-10-22T15:39:09Z","url":"https://github.com/getsentry/sentry-javascript/issues/25657"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:42ca705c-cd6a-ef72-9010-c4c2bcd925ad
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9C24:1F98:1954432:2161B79:6B041591
html-safe-nonceff11eb04c7d0d7a7be5f242fc1cd02f06a4c07dc8ace0cd467a760b1c4658edf
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzI0OjFGOTg6MTk1NDQzMjoyMTYxQjc5OjZCMDQxNTkxIiwidmlzaXRvcl9pZCI6IjExOTM4NjIyNTEzNTkyNDU3MTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb9a86218f4de3951247ca3037565eac622d784a42b80200c465d98865216a232
hovercard-subject-tagissue:5982529914
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/25657/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6473f25c4a9d046c486b1b7e59eb03c3794052dd2d3d02f29b615a54b6211e33/getsentry/sentry-javascript/issues/25657
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6473f25c4a9d046c486b1b7e59eb03c3794052dd2d3d02f29b615a54b6211e33/getsentry/sentry-javascript/issues/25657
og:image:altIs there an existing issue for this? I searched for the symptom and did not find one. Package and version @sentry/browser 11.5.0 (@sentry/feedback 11.5.0), feedbackIntegration({ enableScreenshot: t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamelarcane97
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/25657#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F25657
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F25657
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/25657
Reloadhttps://github.com/getsentry/sentry-javascript/issues/25657
Reloadhttps://github.com/getsentry/sentry-javascript/issues/25657
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues340 (340)https://github.com/getsentry/sentry-javascript/issues
Pull requests54 (54)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/25657
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/25657
#25658https://github.com/getsentry/sentry-javascript/pull/25658
feedback: screenshot can contain the feedback form itself, because getDisplayMedia is called in the same task that hides the formhttps://github.com/getsentry/sentry-javascript/issues/25657#top
#25658https://github.com/getsentry/sentry-javascript/pull/25658
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
User Feedbackshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22User%20Feedbacks%22
https://github.com/larcane97
larcane97https://github.com/larcane97
on Oct 22, 2026https://github.com/getsentry/sentry-javascript/issues/25657#issue-5982529914
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Oct 22, 2026https://github.com/getsentry/sentry-javascript/issues/25657#event-33966588003
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Oct 22, 2026https://github.com/getsentry/sentry-javascript/issues/25657#issuecomment-6344782888
Linear Codehttps://linear.app
JS-3987https://linear.app/getsentry/issue/JS-3987
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 22, 2026https://github.com/getsentry/sentry-javascript/issues/25657#event-33966594538
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 22, 2026https://github.com/getsentry/sentry-javascript/issues/25657
linear-codehttps://github.com/apps/linear-code
User Feedbackshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22User%20Feedbacks%22
on Oct 22, 2026https://github.com/getsentry/sentry-javascript/issues/25657#event-33966639702
https://github.com/larcane97
larcane97https://github.com/larcane97
on Oct 22, 2026https://github.com/getsentry/sentry-javascript/issues/25657#issuecomment-6345222102
#25658https://github.com/getsentry/sentry-javascript/pull/25658
mydeahttps://github.com/mydea
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Oct 23, 2026https://github.com/getsentry/sentry-javascript/issues/25657#event-34027484874
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Oct 23, 2026https://github.com/getsentry/sentry-javascript/issues/25657#event-34027487020
Lms24https://github.com/Lms24
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#25658https://github.com/getsentry/sentry-javascript/pull/25658
on Oct 27, 2026https://github.com/getsentry/sentry-javascript/issues/25657#event-34363650558
Lms24https://github.com/Lms24
on Oct 27, 2026https://github.com/getsentry/sentry-javascript/issues/25657#event-34363651462
fix(feedback): Wait for frames without the form before capturing the …https://github.com/getsentry/sentry-javascript/commit/3710736dc59ad2190a5b0a959c904ae3e230e7b4
3710736https://github.com/getsentry/sentry-javascript/commit/3710736dc59ad2190a5b0a959c904ae3e230e7b4
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Oct 28, 2026https://github.com/getsentry/sentry-javascript/issues/25657#issuecomment-6474400972
GitHub Actionshttps://help.github.com/en/actions
#25658https://github.com/getsentry/sentry-javascript/pull/25658
11.10.0 releasehttps://github.com/getsentry/sentry-javascript/releases/tag/11.10.0
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/25657
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/25657
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
User Feedbackshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22User%20Feedbacks%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.