Skip to content

Lazy load feedback screenshot #11435

Closed
@c298lee

Description

@c298lee

From Francesco:
So, just writing down my thoughts on how we could lazy load the feedback screenshot stuff:

  1. We package the code into a new integration, similar to @sentry-internal/replay-canvas, e.g. @sentry-internal/feedback-media or something like this.
  2. This can be added in addition to Feedback to enable this. Users can add this manually, either lazy loading it themselves or just eagerly including this - normal integration stuff!
  3. If users do not add this, what we'll do if a user clicks "Add screenshot" is inject a <script> tag to the integration CDN bundle into the page, and go from there. e.g. something like this:
function lazyLoadFeedbackMedia() {
  const tag = `<script src='[https://cdn.sentry.com/${SDK_VERSION}/integration.feedback-media.min.js](https://cdn.sentry.com/$%7BSDK_VERSION%7D/integration.feedback-media.min.js)'></script>';
  // inject tag into page
  tag.onLoad = function() {
    // continue when everything is ready
  }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions