Files
Anthony LioandJoshen Lim 929af55026 fix(studio): stop csp-blocked images from failing feedback screenshots (#52590)
## Problem

- "Capture screenshot" in the studio feedback widget fails in
production, and studio shows the "Failed to capture screenshot" toast
- `html-to-image` downloads each image with `fetch()`, and the csp
`connect-src` does not allow the github and google avatar hosts
- the blocked avatar gets an empty `src`, so its `onerror` rejects the
whole capture

## Solution

- changes the capture to use a transparent pixel for each image that it
cannot download, so a blocked avatar shows blank and the screenshot
still completes

| state | preview |
| -------|------|
| before | <img width="600" height="280" alt="image"
src="https://github.com/user-attachments/assets/53c5916e-cd37-4fb5-8989-070537aa9f76"
/> |

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions

1. open
[/dashboard](https://studio-git-antlio-fix-studio-feedback-screenshot-supabase.vercel.app/dashboard)
and sign in with an account that has a github or google avatar
2. click "Feedback" in the top bar, click the image button, and click
"Capture screenshot"
3. capturing works and "Failed to capture screenshot" toast does not
show
4. click the thumbnail, and make sure that the page shows in the
screenshot with a blank area where the avatar is

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-11-03 09:41:50 +02:00
..