A Firefox/Chrome extension that connects to Polkadot networks using Smoldot light client and renders HTML pages stored in system.remark extrinsics.
- Uses Smoldot light client to connect to Polkadot, Paseo, and Westend networks
- Renders HTML content from blockchain remark calls
- No centralized backend required
- Works with both Firefox and Chrome
Install dependencies:
npm installBuild for Firefox:
npm run build:firefoxBuild for Chrome:
npm run build:chromeThe built extension will be in the ./dist directory.
- Open Firefox and navigate to
about:debugging#/runtime/this-firefox - Click "Load Temporary Add-on"
- Navigate to the
distdirectory and selectmanifest.json
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right
- Click "Load unpacked"
- Select the
distdirectory
Once installed, you can view HTML content from blockchain remarks by navigating to:
chrome-extension://<extension-id>/viewer.html#/<chain>/<block>/<extrinsicIndex>
Or for Firefox:
moz-extension://<extension-id>/viewer.html#/<chain>/<block>/<extrinsicIndex>
#/<chain>/<blockNumberOrHash>/<extrinsicIndex>
- chain:
polkadot,paseo,westend,westend-asset-hub, or any custom chain name you've added - blockNumberOrHash: Block number (e.g.,
9898203) or block hash (e.g.,0x123...) - extrinsicIndex: Index of the extrinsic in the block (e.g.,
3)
You have two options for connecting to a local node:
Connect directly to your local node via WebSocket URL:
-
Upload HTML to your local node:
node cli.mjs -w ws://localhost:8000 -f example.html
-
View it in the extension using the WebSocket URL format:
viewer.html#/ws://localhost:8000/<block>/<extrinsic-index>Example:
viewer.html#/ws://localhost:8000/123/2
This connects directly to your local node and doesn't require a chain spec file.
Use Smoldot light client with a custom chain spec:
-
Fetch the chain spec from your node:
node cli.mjs fetch-spec -w ws://localhost:9944 -n local -
This saves the chain spec to
chains/local.json -
Rebuild the extension:
npm run build:firefox # or build:chrome -
Reload the extension in your browser
-
Use it in the viewer:
viewer.html#/local/<block>/<extrinsic-index>
Note: This option requires the node to support the sync_state_genSyncSpec RPC method.
viewer.html#/westend/9898203/3
This will:
- Connect to the Westend network via Smoldot
- Fetch block 9898203
- Extract extrinsic at index 3
- Decode the remark data as HTML
- Render it in an iframe
Firefox supports protocol handlers. You can use URLs like:
web+polkadot://<chain>/<block>/<extrinsicIndex>
This will automatically open the viewer in the extension.
- viewer.ts/viewer.html: Main UI that connects to blockchain and renders HTML
- bg.ts: Firefox background script running Smoldot light client
- sw.ts: Chrome service worker running Smoldot light client
- chains/: Contains chain specifications for Polkadot, Paseo, and Westend
The viewer renders HTML in a sandboxed iframe with restricted CSP to prevent malicious code execution.
Watch mode for development:
npm run devThis will rebuild on file changes. You'll need to reload the extension in your browser after changes.