---
title: "Shipping support for module script integrity in Chrome & Safari"
description: "Subresource Integrity previously covered only top-level scripts, styles and preloads, not imported ES modules, which forced Shopify's PCI-compliant checkout to shim dynamic imports."
url: "https://swe.quest/articles/shipping-support-for-module-script-integrity-in-chrome-safari-1f1be3d6d912771d"
canonical: "https://shopify.engineering/shipping-support-for-module-script-integrity-in-chrome-safari"
source: "Shopify Engineering"
published: "2024-08-02"
difficulty: "easy"
kind: "Case study"
reading_minutes: 3
tags: ["browsers","appsec","javascript","open-source"]
---

# Shipping support for module script integrity in Chrome & Safari

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2024-08-02, 3 min read, Case study. Original: [https://shopify.engineering/shipping-support-for-module-script-integrity-in-chrome-safari](https://shopify.engineering/shipping-support-for-module-script-integrity-in-chrome-safari)

## Summary

Subresource Integrity previously covered only top-level scripts, styles and preloads, not imported ES modules, which forced Shopify's PCI-compliant checkout to shim dynamic imports. Shopify revived Guy Bedford's proposal to add an "integrity" section to import maps that maps module URLs to hashes, so static imports, dynamic import(), top-level module scripts and modulepreload are verified before execution without the cache-invalidation cascades import maps avoid. The feature was implemented in both Chromium and WebKit and landed in the HTML spec. It shipped in Chromium 127 and Safari 18 Beta after roughly two weeks of full-time work across seven calendar weeks.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [Application security](https://swe.quest/tags/appsec.md) (Security)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)

## Prerequisites

- ES modules
- Subresource Integrity
- import maps ([easy posts on Maps & geospatial](https://swe.quest/tags/geospatial.md?difficulty=easy))

## Keywords

Subresource Integrity, import maps, Chromium, WebKit, ES modules, WHATWG, modulepreload

## Related posts

- [Resilient Import Maps - Better Theme Development and Beyond](https://swe.quest/articles/resilient-import-maps-better-theme-development-and-beyond-6678d102dbdca2c3.md): Shopify Engineering · 2025-05-28 · Medium · 7 min read · Browsers, JavaScript, Web performance, Caching, Frontend
  Shopify worked with browser vendors to change the HTML spec, Chromium and WebKit so import maps no longer break when JavaScript modules load before them or when a page has more than one map.
- [Fixing Top-Level Await in Safari](https://swe.quest/articles/fixing-top-level-await-in-safari-4919b25f6b19644e.md): WebKit · 2026-09-02 · Medium · 7 min read · JavaScript, Runtimes & VMs, Browsers, Testing
  Safari 27 fixes long-standing top-level await bugs, such as spurious "accessed before initialization" errors and wrong import completion order, by rewriting WebKit's ES module loader from scratch.
- [Bun v1.1.44](https://swe.quest/articles/bun-v1-1-44-d312dca6375cbc2a.md): Bun · 2025-01-16 · Medium · 6 min read · JavaScript, Runtimes & VMs, Build systems, Frontend
  Bun v1.1.44 adds experimental HTML imports (behind --experimental-html) so Bun.serve() can bundle and serve frontend apps on demand alongside API routes, with no hot module reloading yet.
- [Bun v1.2.5](https://swe.quest/articles/bun-v1-2-5-0384b8a49ec32571.md): Bun · 2025-03-11 · Medium · 19 min read · JavaScript, Runtimes & VMs, Frontend
  Bun v1.2.5 fixes 75 bugs, adds 69 passing Node.js tests, and nearly rewrites its Node-API implementation, which now passes 98% of Node's js-native-api suite.
- [Bun v0.7.1](https://swe.quest/articles/bun-v0-7-1-5c9040e5c49cc1d7.md): Bun · 2023-07-29 · Medium · 8 min read · JavaScript, Runtimes & VMs, Performance engineering
  Bun v0.7.1 makes ES Module loading 30%–250% faster by running its transpiler concurrently for import statements and dynamic imports, though CommonJS require is still sequential.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
