You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow manual screenshot upload in User Feedback widget #12938
Some environments require an app to be loaded within an iframe (e.g. Shopify embedded apps). Clicking 'Add a screenshot' on the User Feedback widget shows a message of: Failed to execute 'getDisplayMedia' on 'MediaDevices': Access to the feature "display-capture" is disallowed by permission policy.
As I understand, this is because the iFrame hasn't given permission for native screenshots. I realise there's not much you can do about that, but it would be nice if as a fallback, Sentry could revert to a regular file upload field so a user can upload their own screenshots, as it can be quite an important part of a bug report.
Solution Brainstorm
It could either fall back automatically, or it could be another config option, e.g. enableFileUpload or enableImageUpload
Then those that know their app is used in an environment where the screen capture API is not available, could set enableScreenshot to false and enableImageUpload to true.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Reacted by tjhiggins, Coren "Kern" Frankel, Tracy and Eugene Aseev
// Override navigator.mediaDevices.getDisplayMedia and use html2canvasnavigator.mediaDevices.getDisplayMedia=async()=>{constcanvas=awaithtml2canvas(document.body,{x: window.scrollX,y: window.scrollY,width: window.innerWidth,height: window.innerHeight,});returncanvas.captureStream();};
As an update. We decided to put this in our backlog, as we are currently quite busy with other tickets. However, I posted a reproduction where you can see the issue - with that we're happily accept pull requests to solve this issue.
I'd like to take this. I reproduced the failure boundary in the feedback screenshot integration: a getDisplayMedia() rejection currently reaches ScreenshotEditor's parent error handler, which hides the screenshot input and leaves the user without an attachment path.
My proposed scope is an automatic fallback inside packages/feedback: keep the dialog open, render a regular image file input after capture fails, and route the selected file through the existing screenshot attachment value path. I won't add a new public configuration option or change the submission API. I'll add focused package coverage plus a browser integration test for rejection → file upload → submission.
One browser detail: permission-policy rejection and user cancellation can both surface as NotAllowedError, so the fallback will appear after any capture rejection rather than pretending those cases are distinguishable. If the team prefers an opt-in configuration instead, I can adjust the design before submitting.
@AG0708 please go ahead, I'll assign you to this ticket - thanks for taking this.
Your solution sounds good to me.
permission-policy rejection and user cancellation can both surface as NotAllowedError, so the fallback will appear after any capture rejection rather than pretending those cases are distinguishable.
I think that is ok, but an opt-in as an alternative wouldn't hurt either - then engineers could decide for themself what way they would go, in case they know their environment.
We talked about this internally and decided that for now we want to keep the feedback widget as simple as possible. Therefore we'll not add image uploading as a feature to the widget.
Activity
andreiborza commentedon Jul 17, 2024
Hey, thank you for taking the time to file this. I'll pass this on internally.
tjhiggins commentedon Jan 20, 2025
Same issue with trying to take a screenshot inside an iframe inside a chrome extension sidepanel. Currently chrome straight up crashes: https://issues.chromium.org/issues/41497364.
Here is my hacky workaround using html2canvas (https://www.npmjs.com/package/html2canvas)
16 remaining items
JPeer264 commentedon Apr 24, 2026
As an update. We decided to put this in our backlog, as we are currently quite busy with other tickets. However, I posted a reproduction where you can see the issue - with that we're happily accept pull requests to solve this issue.
AG0708 commentedon Jul 10, 2026
I'd like to take this. I reproduced the failure boundary in the feedback screenshot integration: a
getDisplayMedia()rejection currently reachesScreenshotEditor's parent error handler, which hides the screenshot input and leaves the user without an attachment path.My proposed scope is an automatic fallback inside
packages/feedback: keep the dialog open, render a regular image file input after capture fails, and route the selected file through the existing screenshot attachment value path. I won't add a new public configuration option or change the submission API. I'll add focused package coverage plus a browser integration test for rejection → file upload → submission.One browser detail: permission-policy rejection and user cancellation can both surface as
NotAllowedError, so the fallback will appear after any capture rejection rather than pretending those cases are distinguishable. If the team prefers an opt-in configuration instead, I can adjust the design before submitting.JPeer264 commentedon Jul 10, 2026
@AG0708 please go ahead, I'll assign you to this ticket - thanks for taking this.
Your solution sounds good to me.
I think that is ok, but an opt-in as an alternative wouldn't hurt either - then engineers could decide for themself what way they would go, in case they know their environment.
Lms24 commentedon Jul 17, 2026
We talked about this internally and decided that for now we want to keep the feedback widget as simple as possible. Therefore we'll not add image uploading as a feature to the widget.
The good news is, you can easily implement your own widget and send feedback with an attachment of your choice via the SDK's
Sentry.captureFeedbackAPI: https://docs.sentry.io/platforms/javascript/guides/react/user-feedback/#user-feedback-apiApologies for the back and forth on this issue folks! Going to close this to reflect this decision properly.