Wala pang Filipino na bersyon ang page na ito, kaya naka-English muna.
Widget scripts in a sealed frame
A widget with a script renders inside a sandboxed iframe with its own policy: it reads the owner's values from window.WIDGET and has no network, cookies or access to the page.
When script is set, the widget is painted inside <iframe sandbox="allow-scripts" srcdoc="…">. The frame is an opaque origin: no cookies, no storage, no access to the page around it, no forms, pop-ups or top navigation — and no network at all.
default-src 'none'; img-src 'self' data:; style-src 'unsafe-inline'; script-src 'unsafe-inline'; connect-src 'none'; form-action 'none'; base-uri 'none'(function () {
var el = document.querySelector('.cd-time'); // the rendered template
var end = new Date(window.WIDGET.until + 'T23:59:59'); // the owner's field values
function tick() {
var s = Math.max(0, Math.floor((end.getTime() - Date.now()) / 1000));
var d = Math.floor(s / 86400), h = Math.floor(s % 86400 / 3600), m = Math.floor(s % 3600 / 60);
el.textContent = d + 'd ' + h + 'h ' + m + 'm';
}
tick(); setInterval(tick, 30000);
})();height(60–1200 px, default 320) sets the frame height.fetch,XMLHttpRequest,WebSocket,EventSource,sendBeaconandimportScriptsare refused at submission; the script may be at most 40,000 characters.- Without a script the widget is plain HTML on the page; with one the buyer is told it runs in a sealed frame.
Lifecycle
Install copies the signed definition into the workspace (Setting marketplace:widgets). An update replaces the definition and keeps the values the owner typed — so keep field keys stable between versions. Uninstall removes it; blocks that use it then render nothing.
Written from: docs/DEVELOPERS/WIDGET-SPEC.md, examples/marketplace/widget-countdown/widget.json, src/lib/marketplace/widget-core.ts, src/components/blocks/market-widget.tsx, src/lib/marketplace/install.ts