Skip to content

feat: Add Blob as a default endowment#4063

Merged
FrederikBolding merged 3 commits into
mainfrom
fb/add-blob-global
Jul 13, 2026
Merged

feat: Add Blob as a default endowment#4063
FrederikBolding merged 3 commits into
mainfrom
fb/add-blob-global

Conversation

@FrederikBolding

@FrederikBolding FrederikBolding commented Jul 3, 2026

Copy link
Copy Markdown
Member

Add Blob as a default endowment for instanceof checks when using fetch.

https://consensyssoftware.atlassian.net/browse/WPC-1126


Note

Low Risk
Small expansion of the default sandbox API using the same hardened global pattern as other Web platform types; no auth or network policy changes.

Overview
Snaps now receive a hardened global Blob by default, alongside existing fetch-related globals like Response.

Blob is registered in the common endowment factory, included in DEFAULT_ENDOWMENTS, and covered by hardening and executor tests (including fetchres.blob()instanceof Blob). Simulation endowment snapshots are updated to list Blob.

Reviewed by Cursor Bugbot for commit 00347d2. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.59%. Comparing base (58c5d8b) to head (00347d2).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4063   +/-   ##
=======================================
  Coverage   98.59%   98.59%           
=======================================
  Files         425      425           
  Lines       12413    12414    +1     
  Branches     1969     1969           
=======================================
+ Hits        12238    12239    +1     
  Misses        175      175           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FrederikBolding FrederikBolding marked this pull request as ready for review July 13, 2026 08:33
@FrederikBolding FrederikBolding requested a review from a team as a code owner July 13, 2026 08:33

@naugtur naugtur left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blob global is a constructor for data views, it doesn't bring in any new powers that didn't already exist with fetch or typed ararys

@FrederikBolding FrederikBolding added this pull request to the merge queue Jul 13, 2026
Merged via the queue into main with commit b6cd45a Jul 13, 2026
132 checks passed
@FrederikBolding FrederikBolding deleted the fb/add-blob-global branch July 13, 2026 08:59
@cursor cursor Bot mentioned this pull request Jul 13, 2026
pull Bot pushed a commit to Dustin4444/snaps that referenced this pull request Jul 13, 2026
Release candidate for `164.0.0`. Including support for `Blob` in Snaps.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Version and changelog-only release; sandbox surface grows slightly via
the Blob endowment already merged in prior PRs.
> 
> **Overview**
> Release cut for **164.0.0** that bumps the monorepo version and
publishes **`@metamask/snaps-utils@12.4.0`** and
**`@metamask/snaps-execution-environments@11.2.0`**.
> 
> The highlighted user-facing change in these package notes is **`Blob`
as a default Snap endowment**
([MetaMask#4063](MetaMask#4063)), so Snaps can use
`Blob` without an extra permission. The execution-environments release
also records a **`@metamask/superstruct`** bump to `^3.3.0`
([MetaMask#4062](MetaMask#4062)).
> 
> No application logic appears in this diff—only version fields and
changelog/compare-link updates.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1a21ee3. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

3 participants