- HTML 63.7%
- JavaScript 36.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Firefox MV3 extension that fetches the live Onshape glTF (part studio or assembly) and streams it P2P over a WebRTC DataChannel to a WebXR receiver on the Meta Quest. Includes optional tab-video sharing, hand/controller manipulation, measuring, exploded view, movable sun, Onshape selection highlight, and a Node signaling + static server. |
||
| .gitignore | ||
| background.js | ||
| content.js | ||
| manifest.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| receiver.html | ||
| server.js | ||
Onshape Live VR Bridge
A Firefox WebExtension (Manifest V3) that streams your live Onshape 3D model into the Meta Quest browser for WebXR passthrough viewing.
- Fetches the live 3D model from the Onshape API (
/api/.../gltf) — the exact geometry of the open part studio / assembly. - Streams the glTF P2P over a WebRTC DataChannel to the headset, where it's rendered natively (sharp, not a compressed video).
- The headset just opens one URL in the Quest browser (A-Frame,
xr-mode-ui="XRMode: xr",immersive-arpassthrough).
Firefox (PC) Node server (this repo) Meta Quest
┌──────────────────────┐ ┌─────────────────────────┐ ┌───────────────────┐
│ Onshape tab │ ws:// │ 127.0.0.1:8080 (sender)│ │ receiver.html │
│ content.js (sender) │───────────▶│ signaling relay + files │◀──wss────▶│ A-Frame WebXR │
│ fetch .../gltf │ │ 0.0.0.0:8443 (receiver)│ https │ (passthrough) │
└──────────┬───────────┘ └─────────────────────────┘ └───────────────────┘
│ ▲
│ WebRTC P2P: glTF over a DataChannel │
└────────────────────────────────────────────────────────────────────────┘
Why there is a server.js
A browser extension cannot bind a listening port, so it can't be the server
the headset connects to. server.js is that server. It does two things:
- Serves
receiver.htmlto the Quest. - Relays WebRTC signaling (offer/answer/ICE) between the two peers.
It exposes two endpoints so nobody has to click through a cert warning on the PC:
| Endpoint | For | Why |
|---|---|---|
ws://127.0.0.1:8080/signal |
the sender (Onshape tab) | loopback is a secure context — no TLS needed |
https://<LAN-IP>:8443/ + wss://…/signal |
the Quest | WebXR requires a secure context over LAN → HTTPS (self-signed) |
The media itself never touches the server — it's peer-to-peer WebRTC.
1. Start the server
npm install
node server.js
You'll see something like:
=== Open this on the Meta Quest Browser ===
https://172.28.193.50:8443/
2. Load the extension in Firefox
about:debugging#/runtime/this-firefox- Load Temporary Add-on… → pick
manifest.jsonin this folder. (Temporary add-ons are removed when Firefox restarts; that's expected for dev.)
3. Stream
- Open the Quest Browser and go to the
https://<LAN-IP>:8443/URL first (accept the self-signed cert once — see step 4). - Open your Onshape part studio / assembly tab in Firefox.
- Click the Onshape Live VR Bridge toolbar button → a panel appears.
- Confirm the signaling server field is
ws://127.0.0.1:8080/signal. - Click ▶ Send model to VR. The extension fetches the live glTF and streams it.
4. On the Quest
- Open the Quest Browser and go to the
https://<LAN-IP>:8443/URL. - Accept the self-signed certificate warning (Advanced → Proceed) once.
- Watch the in-VR log; when it shows MODEL LOADED ✓, tap Enter VR / Passthrough.
- Right thumbstick rotates the model, left thumbstick (up/down) scales it.
⚠️ WSL2 networking (you are on Windows 11 + WSL) — READ THIS
The IP server.js prints (e.g. 172.28.x.x) is WSL's internal NAT IP and is
not reachable from the Quest by default. Two ways to fix it:
Option A (recommended): WSL mirrored networking
Create/edit C:\Users\<you>\.wslconfig (in Windows):
[wsl2]
networkingMode=mirrored
Then in an admin PowerShell: wsl --shutdown, and restart WSL.
Now WSL shares the Windows host's IP. Point the Quest at
https://<Windows-LAN-IP>:8443/ (run ipconfig in Windows to find it).
Loopback is shared too, so the extension's ws://127.0.0.1:8080 keeps working.
You must also allow the port through Windows Defender Firewall (admin PowerShell):
New-NetFirewallRule -DisplayName "Onshape VR Bridge" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 8443
Option B: port-proxy the WSL IP (no mirrored mode)
In an admin PowerShell (replace <WSL_IP> with the 172.x address printed):
netsh interface portproxy add v4tov4 listenport=8443 listenaddress=0.0.0.0 connectport=8443 connectaddress=<WSL_IP>
New-NetFirewallRule -DisplayName "Onshape VR Bridge" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 8443
Then the Quest uses https://<Windows-LAN-IP>:8443/.
The PC↔WSL direction (extension →
ws://127.0.0.1:8080) works out of the box — WSL2 forwardslocalhostfrom Windows automatically.
Files
| File | Role |
|---|---|
manifest.json |
MV3 manifest (Firefox / browser_specific_settings). |
background.js |
Toolbar click → toggles the in-page panel; stores the signaling URL. |
content.js |
Sender. Injects the panel, fetches the glTF, is the WebRTC offerer. |
receiver.html |
Receiver. A-Frame WebXR passthrough scene; renders the streamed glTF model + in-VR debug log. |
server.js |
Static file server + WebRTC signaling relay (HTTP/WS loopback + HTTPS/WSS LAN). |
Notes & limitations
- Firefox for the sender, by design (Chrome MV3 blocks a background from
reaching a plain-
wsloopback from an https page the way this uses it, and the manifest targetsgecko). - The Quest can use any WebXR browser; the Quest Browser is what's tested.
- glTF auth: the model is fetched with your Onshape session cookies
(
credentials: "include") from the page origin, so you must be logged in. Very large assemblies can take a while or be rejected by the API; if the fetch fails, the panel shows the exact error (e.g.HTTP 404) and nothing is sent. - One headset at a time in this prototype (single signaling room). Multiple
receivers would each need their own
RTCPeerConnectionon the sender. - The self-signed cert is regenerated on every start — that's fine for LAN dev.