<<sandbox code="let count = $tw.wiki.getTiddlerText('Counter')||0; count++; $tw.wiki.setText('Counter', null, null, count); return count;" onresult="<<set $:/temp/counterResult $value>>" />> Result: <<view $:/temp/counterResult>>
A toolbar button “Run Sandbox” appears on any tiddler that contains a <sandbox> widget. Clicking it the sandbox, forcing a fresh context. The button respects the widget’s attributes (e.g., custom timeout). tw5-101-0x0
// src/worker.js (bundled with the plugin) const ALLOWED_GLOBALS = Math, Date, JSON, console, setTimeout, clearTimeout, // optional: Crypto, URL, etc. added via postMessage('globals', ...) ; <<sandbox code="let count = $tw