@notionhq/custom-blocks-dev-shell 0.1.111 → 0.1.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dist/assets/index-DgQZ0zg6.js +11 -0
- package/dist/index.html +1 -1
- package/dist-cli/block-csp.js +84 -0
- package/dist-cli/dev-shell-launcher.js +5 -0
- package/dist-cli/vite-middleware.js +23 -1
- package/package.json +1 -1
- package/dist/assets/index-D2bAuB0Q.js +0 -11
package/README.md
CHANGED
|
@@ -45,6 +45,33 @@ The shell and each block use separate origins, so a block cannot access the shel
|
|
|
45
45
|
Instances of the same block share `localStorage`; `sessionStorage` is also scoped to the browser
|
|
46
46
|
tab.
|
|
47
47
|
|
|
48
|
+
Block responses enforce a production-like content security policy (CSP) and send a
|
|
49
|
+
`Connection-Allowlist` header:
|
|
50
|
+
|
|
51
|
+
- **Blocked features:** Native form submission, browser workers, `<object>`, `<embed>`, web app
|
|
52
|
+
manifests, and `<base>`.
|
|
53
|
+
- **Scripts and styles:** Bundled scripts and inline scripts/styles work. Runtime CDN scripts are
|
|
54
|
+
blocked.
|
|
55
|
+
- **Media and fonts:** Notion-hosted media and Google Fonts use the same exceptions as production.
|
|
56
|
+
- **External access:** Network requests and nested frames may use any origin for now. Browser CORS
|
|
57
|
+
checks still apply.
|
|
58
|
+
|
|
59
|
+
#### Differences from production
|
|
60
|
+
|
|
61
|
+
- **Local origins:** Blocks and the shell use HTTP localhost origins instead of production HTTPS
|
|
62
|
+
origins.
|
|
63
|
+
- **Hot reload:** CSP permits the block's exact WebSocket host and port for Vite HMR.
|
|
64
|
+
- **External access:** Production uses workspace-approved external origins. The dev shell currently
|
|
65
|
+
allows all origins; configurable limits will be added later.
|
|
66
|
+
- **Embedding hosts:** Any host may embed local blocks for now, including Notion apps in every
|
|
67
|
+
environment. Configurable limits will be added later.
|
|
68
|
+
- **Parent navigation policy:** The shell does not apply production's parent navigation CSP. The
|
|
69
|
+
block's CSP alone cannot prevent it from navigating its own iframe to another document.
|
|
70
|
+
- **Sample data:** SDK handlers use local sample data instead of production permissions and
|
|
71
|
+
persistence.
|
|
72
|
+
- **Developer control:** Vite plugins are developer-controlled, so the preview is not a security
|
|
73
|
+
boundary for untrusted code.
|
|
74
|
+
|
|
48
75
|
### Error surface
|
|
49
76
|
|
|
50
77
|
The preview shows an error when a block cannot initialize or an uncaught runtime error prevents
|