CSP and frames
The shim works under a strict Content Security Policy and in same-origin iframes, with one feature lost when blob: scripts are forbidden.
Content Security Policy
The shim loads two pieces of code from blob: URLs: its AudioWorklet, and a polyfill that it wraps around workers so RTCRtpScriptTransform works. At startup it probes whether the page's CSP allows blob: scripts.
script-src | Audio | Encoded transforms |
|---|---|---|
Allows blob:, or no CSP | AudioWorklets | RTCRtpScriptTransform available |
Forbids blob: | ScriptProcessorNodes with the same logic | RTCRtpScriptTransform withdrawn, Worker left unwrapped |
Withdrawing the class is deliberate. A library that feature-detects RTCRtpScriptTransform then takes its fallback path, instead of sending media into a worker that cannot load.
To keep encoded transforms, add blob: to script-src and worker-src, or run the call in a document whose policy allows it.
Frames
- Top-level documents get the shim.
- Same-origin iframes get it too. They have no Tauri IPC of their own, so the shim uses the nearest same-origin ancestor's.
- Cross-origin frames get nothing. They cannot reach the app's IPC, and the plugin grants none.
This is what Element Call needs. The Matrix client embeds it as a same-origin widget iframe with its own, laxer CSP. Group calls there keep end-to-end encryption even when the main window's CSP forbids blob:, as Tchap's does.
Navigation
When a page starts loading, every peer connection that webview created is closed. A reload or navigation never leaves a call running without a page.