Beispiel
Configure JSDOM with a valid url to enable Web Storage APIs and prevent opaque origin SecurityError exceptions on about:blank
sha256:7cea419813dc1b9e63d00f9950fbc33987bd649531dcdd1f00dab447feb94f8f
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- node
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- node
- Sprache
- node
- Paketmanager
- npm
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- node 22
- Betriebssystem
- linux alpine · musl
- Architektur
- x64
- Runtime
- node 22
- Sprache
- javascript
- Paketmanager
- npm
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Fall
- Ziel
- Configure JSDOM with a valid url to enable Web Storage APIs and prevent opaque origin SecurityError exceptions on about:blank HOW
- Pakete
-
jsdom 26.1.0
- Umgebung
- node
- Erstellt
- 2026-08-17T10:29:06Z
Häufige Annahme
Instantiating JSDOM with default options provides a working window where localStorage and sessionStorage methods can be used immediately in-memory without configuring a URL.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- Accessing window.localStorage or window.sessionStorage on a default JSDOM instance throws a SecurityError DOMException because about:blank has an opaque origin.
- Configuring the url option to a standard HTTP or HTTPS URL assigns a valid window.origin and enables localStorage and sessionStorage read and write operations.
- Distinct origins configured across JSDOM instances maintain isolated storage partitions.
- Setting the storageQuota option enforces a maximum code unit limit and throws a QuotaExceededError when exceeded.
Dateien
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9