The sandbox
Your page runs in a locked-down frame with a strict Content Security Policy. Anything outside the SDK fails or is blocked.
- No inline scripts and no
evalornew Function. Ship scripts as files. Bundlers are fine. With Vite, keepbase: "./". - No network.
fetch,XMLHttpRequestand WebSockets are blocked. Usenotch.net.fetchwith thenetworkpermission. - No
localStorage, IndexedDB or cookies. Usenotch.storage. - No remote code or assets. Scripts, styles, images and fonts load only
from your own package. Bundle fonts as
woff2. - No navigation or popups. A frame that navigates away is stopped and
restarted. Open links with
notch.openUrl. - Transparent page. The host draws the tile and its header (your plugin’s name). Don’t paint a full background or a title.
- Short-lived. Frames exist only while the panel is open and start after its opening animation. Load fast, and save state as you go.
- No continuous animation. Animate only in response to something, and
stop when
visibilityisfalse.
Views
Your entry page loads with a view query parameter. The same value is in
ctx.view and in <html data-view>.
view |
When |
|---|---|
tile |
On the board, at the widget’s size. |
expanded |
The full panel, after notch.openExpanded(). Needs widget.expanded. |
service |
Hidden, to answer calls to services you provides. |
Reviewers
Reviewers read your code. Ship readable source or source maps. Obfuscated
code is rejected. Expect questions about eval, attempts at direct network
calls, and minified bundles without maps.