Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome Extension using @sentry/browser or @sentry/react gets rejected #14891

Closed
3 tasks done
FedorT22 opened this issue Jan 2, 2025 · 1 comment · Fixed by #14895
Closed
3 tasks done

Chrome Extension using @sentry/browser or @sentry/react gets rejected #14891

FedorT22 opened this issue Jan 2, 2025 · 1 comment · Fixed by #14895
Assignees
Labels
Package: browser Issues related to the Sentry Browser SDK

Comments

@FedorT22
Copy link

FedorT22 commented Jan 2, 2025

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

Framework Version

18.3.1

Link to Sentry event

No response

Reproduction Example/SDK Setup

As you kindly asked in the previous issue, #14010 (comment), I created a small repo with a reproduction to build a Chrome Extension for the side panel:
https://github.com/FedorT22/sandbox-chrome-extension

Steps to Reproduce

  1. Build the project with @sentry feedbackIntegration function using @sentry/browser or @sentry/react. You can follow README.md file in the project.
  2. See in the /dist/sidePanel.js and dist/sidePanel.js.map the piece of code wtih CDN link:

const baseURL = (options && options.cdnBaseUrl) || 'https://browser.sentry-cdn.com';\n\n return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString();\n

  1. Submit the extension to the Chrome Webstore
  2. Wait for the Chrome Webstore answer

Expected Result

Extension is approved by the reviewers.

Actual Result

Extension is rejected by the reviewers
The given reason:

Violation reference ID: Blue Argon
Technical Requirements - Additional Requirements for Manifest V3:
Violation:
Including remotely hosted code in a Manifest V3 item.
Violating Content:
Code snippet: sidePanel.js: "function $re(e) { const t = an(), n = t && t.getOptions(), r = n && n.cdnBaseUrl || "https://browser.sentry-cdn.com/"; return new URL(/${mc}/${e}.min.js, r).toString() }"

The current work-around:
Clear up @sentry CDN links during the build process with a help of patch-package. See more info in the previous issue.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 2, 2025
@github-actions github-actions bot added the Package: browser Issues related to the Sentry Browser SDK label Jan 2, 2025
@mydea
Copy link
Member

mydea commented Jan 3, 2025

Hello,

We will look into this, ideally when using the feedbackIntegration from an NPM package like this it should not have references to the lazy loading code!

@getsantry getsantry bot removed the status in GitHub Issues with 👀 3 Jan 3, 2025
@mydea mydea self-assigned this Jan 3, 2025
@mydea mydea closed this as completed in c347dae Jan 7, 2025
mydea added a commit that referenced this issue Jan 7, 2025
Closes #14891

This PR updates the sync feedback integration to avoid it pulling in the
`lazyLoadIntegration` code. This is not really needed and leads to some
problems (and also bundle size increase).

For this I updated the type signature of `buildFeedbackIntegration` to
ensure that _either_ `lazyLoadIntegration` _or_ the getter functions are
provided, so we can type-safely use this.

We probably also want to backport this to v8 then.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: browser Issues related to the Sentry Browser SDK
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants