Skip to content

feat(browser): Disable client when browser extension is detected #16354

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

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

mydea
Copy link
Member

@mydea mydea commented May 21, 2025

Similar to #16353, this changes how default options for BrowserClient are handled. Instead of building this in init, we now do (some) of it in BrowserClient.

Additionally, this also adjusts what we do if we detect a browser extension: Instead of skipping the setup, we now just disable the client. This streamlines this a bit and also ensures that we actually always return a Client from init.

It also fixes the type for BrowserOption to actually allow to configure cdnBaseUrl, which was actually only set for the ClientOptions, oops.

@mydea mydea self-assigned this May 21, 2025
Copy link
Contributor

github-actions bot commented May 21, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.93 kB -0.12% -27 B 🔽
@sentry/browser - with treeshaking flags 23.69 kB -0.13% -29 B 🔽
@sentry/browser (incl. Tracing) 38.23 kB -0.12% -44 B 🔽
@sentry/browser (incl. Tracing, Replay) 76.36 kB -0.05% -36 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.45 kB -0.07% -46 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 81.11 kB -0.07% -55 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 93.19 kB -0.08% -67 B 🔽
@sentry/browser (incl. Feedback) 40.67 kB -0.13% -52 B 🔽
@sentry/browser (incl. sendFeedback) 28.64 kB -0.16% -45 B 🔽
@sentry/browser (incl. FeedbackAsync) 33.52 kB -0.14% -45 B 🔽
@sentry/react 25.71 kB -0.11% -26 B 🔽
@sentry/react (incl. Tracing) 40.23 kB -0.06% -24 B 🔽
@sentry/vue 28.26 kB -0.34% -96 B 🔽
@sentry/vue (incl. Tracing) 40.05 kB -0.13% -50 B 🔽
@sentry/svelte 23.94 kB -0.16% -37 B 🔽
CDN Bundle 25.22 kB -0.11% -27 B 🔽
CDN Bundle (incl. Tracing) 38.35 kB -0.1% -38 B 🔽
CDN Bundle (incl. Tracing, Replay) 74.22 kB -0.05% -37 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 79.64 kB -0.05% -32 B 🔽
CDN Bundle - uncompressed 73.57 kB -0.13% -91 B 🔽
CDN Bundle (incl. Tracing) - uncompressed 113.6 kB -0.09% -91 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 227.57 kB -0.04% -91 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 240.4 kB -0.04% -91 B 🔽
@sentry/nextjs (client) 41.9 kB -0.03% -9 B 🔽
@sentry/sveltekit (client) 38.73 kB -0.06% -20 B 🔽
@sentry/node 149.51 kB +0.01% +1 B 🔺
@sentry/node - without tracing 98.12 kB +0.01% +1 B 🔺
@sentry/aws-serverless 123.46 kB - -

View base workflow run

@mydea mydea force-pushed the fn/better-browser-client-init branch from a0318d8 to a7c890c Compare May 21, 2025 13:37
@mydea mydea changed the title feat(browser): Improve BrowserClient default data handling feat(browser): Disable client when browser extension is detected May 21, 2025
@mydea mydea force-pushed the fn/better-browser-client-init branch from a7c890c to 68c88ce Compare May 21, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant