Skip to content

Allow manual screenshot upload in User Feedback widget #12938

Closed as not planned
Closed as not planned

Description

@fabregas4

Problem Statement

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.

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 16, 2024
  2. andreiborza commented on Jul 17, 2024

    @andreiborza
    Member

    Hey, thank you for taking the time to file this. I'll pass this on internally.

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 17, 2024
  4. tjhiggins commented on Jan 20, 2025

    @tjhiggins
    Contributor

    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)

    // Override navigator.mediaDevices.getDisplayMedia and use html2canvas
    navigator.mediaDevices.getDisplayMedia = async () => {
      const canvas = await html2canvas(document.body, {
        x: window.scrollX,
        y: window.scrollY,
        width: window.innerWidth,
        height: window.innerHeight,
      });
      return canvas.captureStream();
    };
  5. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jan 20, 2025
  6. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jan 20, 2025
  7. 16 remaining items

  8. JPeer264 commented on Apr 24, 2026

    @JPeer264
    Member

    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.

  9. removed their assignment
    on Jun 2, 2026
  10. AG0708 commented on Jul 10, 2026

    @AG0708
    Contributor

    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.

  11. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 10, 2026
  12. JPeer264 commented on Jul 10, 2026

    @JPeer264
    Member

    @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.

  13. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 10, 2026
  14. Lms24 commented on Jul 17, 2026

    @Lms24
    Member

    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.captureFeedback API: https://docs.sentry.io/platforms/javascript/guides/react/user-feedback/#user-feedback-api

    Apologies for the back and forth on this issue folks! Going to close this to reflect this decision properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions