Spaces:
Running
Running
Iframe Dialog Test
This example tests WebSerial + WebUSB dialog behavior in iframe vs standalone environments to replicate HuggingFace Spaces behavior.
Purpose
Tests the user gesture consumption issue that occurs when WebSerial and WebUSB dialogs conflict in iframe contexts (like HuggingFace Spaces).
Files
iframe-dialog-test.html
- Main test page with iframe controlsiframe-content.html
- Content loaded in iframe to simulate HuggingFace Spacesiframe-dialog-test.ts
- TypeScript logic for testing dialog behavior
Running
From the root directory:
pnpm example:iframe-test
Or from this directory:
pnpm dev
Testing
- Click "🔓 Permissive" to load iframe in permissive mode
- In the iframe, click "Test Actual findPort Function"
- Should demonstrate sequential dialog behavior working in iframe context
Browser Requirements
- Chrome/Edge 89+ with WebSerial and WebUSB APIs
- HTTPS or localhost
- Real robot hardware for full testing