Troubleshooting · October 2026

Session replay missing from WhaTap browser monitoring? Check worker-src in your CSP

A Content Security Policy with no worker-src falls back to script-src, which blocks the WhaTap browser agent's blob: Web Workers. Page-load beacons keep returning 200 while session replay silently never sends. One directive fixes it, verified end to end in a lab.

Published Updated 7 min readPublished

TL;DR

WhaTap browser monitoring looks like it is working — pageLoad and resource beacons return 200 — but session replay is never collected. The browser console shows:

text
Creating a worker from 'blob:https://app.example.com/4798...' violates the following
Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval' https:".
Note that 'worker-src' was not explicitly set, so 'script-src' is used as a fallback.
The action has been blocked.        @ whatap-browser-agent.js:10

The fix is one directive in the site’s CSP:

nginx
worker-src 'self' blob:;

That is the whole change. worker-src governs only Worker/SharedWorker/ServiceWorker sources, so it does not loosen script-src for ordinary scripts.

Symptom

On the instrumented page, the agent’s console looks like this (browser agent v1.3.15):

  • One console error — the worker creation above, attributed to whatap-browser-agent.js.
  • pageLoad, resource, collect and v2/webVitals beacons are sent and return 200.
  • No sessionreplay beacon is sent at all, ever. In the network panel you will not see the request fail — it is simply never made.
  • In the WhaTap console, the session-replay surface is empty for that project while the other browser metrics look healthy.

If you only check “are beacons arriving”, you will conclude monitoring is fine. It is half instrumented, and the half that is missing is the one that records the user’s session.

Why it looks like a configuration error somewhere else

The tell that it is not a collector problem: a wrong collection endpoint, a wrong port, or a firewall block makes beacons fail with an HTTP error you can see. Here the beacons that are sent succeed. The failure happened inside the browser, before any network request was made.

The second reason it misleads: the CSP in the client’s config is not obviously wrong. It is a perfectly normal, fairly strict policy. Nothing in it says “no workers” — the problem is the absence of a directive, and CSP absence behaves as an implicit fallback rather than an error.

Reproduction

You do not need WhaTap to see the browser behaviour — a page with any blob worker under such a CSP reproduces the console error. To prove it is specifically the replay worker that dies, instrument a page with the real agent snippet.

1. A site whose CSP has no worker-src (a snippet included into your server block):

nginx
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https:; style-src 'self' 'unsafe-inline' https:; img-src 'self' data: https:; font-src 'self' data: https:; connect-src 'self' https: wss:; frame-src 'self' https:; frame-ancestors 'self'; object-src 'none'; base-uri 'self'; form-action 'self'" always;

2. A page instrumented with the WhaTap snippet, including a proxyBaseUrl so beacons go through your own host to the collector:

html
<script>
  // WhaTap browser agent snippet: pcode + access key, agent URL, collection endpoint
  // proxyBaseUrl: location.origin + "/api/v1/system-sync/"
</script>

3. A script that drives the page and reports what actually left the browser. A short Playwright script is enough: load the page, type into the fields, click, wait ~15 s, navigate away to flush, reload — then print the CSP header, any securitypolicyviolation events, the console errors, and every beacon sent to the sync path:

bash
cd lab/test && npm i && node test.mjs before        # URL env var overrides the target

Then flip the CSP to include worker-src 'self' blob:, reload, and run it again. The result is unambiguous:

Before (no worker-src)After (worker-src 'self' blob:)
CSP violationworker-src blocked blobnone
pageLoad / resource / v2/webVitals200200
sessionreplaynever sent200

End-to-end confirmation is the WhaTap console: User action analysis → Session replay plays back a recorded session with the typed text and the click timeline visible. In our lab only the post-fix sessions carried replay data — the pre-fix sessions were listed but had nothing to play.

Confirmed on a live client site. The directive was rolled out to the client’s production nginx and session replay started recording — the lab reproduction and the real site agreed. No other policy change was needed.

Root cause

The browser agent builds two Web Workers from blob: URLs:

WorkerPurposeWhen blocked
Deflate worker (new Worker(URL.createObjectURL(new Blob(...))))Compresses outgoing beaconsCatches the error and compresses on the main thread. Everything else keeps working — which is exactly why pageLoad/resource still return 200.
Session-replay worker (rrweb)Records and compresses the replay streamTries a blob: worker, then falls back to a data:text/javascript;base64 worker. A CSP that permits neither means replay never sends.

A CSP with no worker-src does not mean “workers are unrestricted” — it means the browser applies the fallback chain and script-src is consulted instead. A typical script-src allows 'self' and your CDNs but not blob:, so every blob worker is refused at creation time.

The failure is therefore silent and partial: one worker degrades to a fallback path, the other has no viable fallback, and nothing surfaces except a console error that is easy to skim past.

The fix

Add worker-src 'self' blob: to the policy, next to connect-src:

nginx
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https:; style-src 'self' 'unsafe-inline' https:; img-src 'self' data: https:; font-src 'self' data: https:; connect-src 'self' https: wss:; worker-src 'self' blob:; frame-src 'self' https:; frame-ancestors 'self'; object-src 'none'; base-uri 'self'; form-action 'self'" always;

Procedure, with a rollback path:

bash
cp /etc/nginx/snippets/<headers>.conf /etc/nginx/snippets/<headers>.conf.bak.worker.$(date +%Y%m%d-%H%M%S)
# edit the CSP line as above
nginx -t && systemctl reload nginx
curl -sI https://<site>/ | grep -i content-security   # must now contain: worker-src 'self' blob:

Then hard-reload with the cache disabled (Ctrl+Shift+R, or DevTools → “Disable cache”). The worker error disappears from the console and a …/sessionreplay POST appears in the network panel.

Rollback: restore the .bak.worker.* file, then nginx -t && systemctl reload nginx.

Finding the CSP in the first place

bash
curl -sI https://<site> | grep -i content-security
grep -rn Content-Security-Policy /etc/nginx/

It is not always nginx: Apache and IIS headers, an application framework, or a <meta http-equiv="Content-Security-Policy"> in index.html can all be the source. Fix it at the source, not with a second header that fights the first.

Caveats and scope

  • Do not add data: to worker-src. It is only the replay worker’s internal fallback and blob: alone is verified to be enough. 'self' blob: is the narrow change.
  • Check every place the CSP is set. A page can receive one policy from a header and another from a meta tag; the browser enforces all of them, and the strictest one binds. If the headers are emitted by a snippet included in several server blocks, one edit covers them all — but a location block with its own add_header does not inherit the server-level headers in nginx, so the snippet has to be included there as well.
  • This is the replay-specific failure mode. A CSP can also break browser monitoring more visibly: if script-src does not allow the agent URL, nothing loads at all, and if connect-src does not allow the collection URL, beacons die at the network layer. Both are louder symptoms than this one.
  • Session replay records what the page shows. Masking options in the snippet decide how much: with input masking off, typed values are recorded (password fields are masked regardless). For a login or customer portal that is usually not what you want — consider sessionReplayMaskAllInputs: true unless the values are genuinely needed.
  • worker-src has no effect on whether replay is enabled at all. If replay is switched off in the snippet, this fix changes nothing; and a project with replay disabled will never send sessionreplay.

Takeaways

  1. A CSP is not just an allow-list, it is a fallback chain. A missing directive quietly means “inherit from a broader one”, and worker-src falls back to script-src — which almost never allows blob:.
  2. Partial success is the hardest symptom to read. An agent that degrades gracefully (main-thread compression) and an agent that dies silently (blocked replay worker) look the same in a beacon count. Verify the specific beacon you care about, not the traffic level.
  3. Read the console, not just the network panel. This bug produces exactly one console error and zero failed requests. Anything that inspects only HTTP status codes will report the site healthy.
  4. worker-src 'self' blob: is a small, targeted change — worth making on any site that runs WhaTap browser monitoring before the first “replay isn’t showing up” ticket arrives.

Derived from internal field work; client and environment details have been generalised. Exact error strings, configuration keys and commands are as observed on the affected site.

  • guide
  • installation
  • rum
  • real-user-monitoring
  • browser-monitoring
  • mobile-monitoring
  • systemd
  • linux
  • whatap

Minimal setup for WhaTap Edge Server (RUM on-premise: rumagent + rumctl)

Enable WhaTap Real User Monitoring — browser and mobile — on an on-premise Collection server with two modules: download the all-in-one package, drop rumagent and rumctl under /data, write their config.yaml files, register both with systemd. Ports, config keys and the traps included.

· 5 min read

  • guide
  • installation
  • webmethods
  • webmethods-11
  • integration-server
  • microservices-runtime
  • java-agent
  • apm
  • middleware
  • jvm
  • whatap
  • monitoring

Attach the WhaTap Java agent to a webMethods Integration Server

Step-by-step setup for webMethods monitoring with the WhaTap Java agent (2.2.68+): where the JVM options go (custom_wrapper.conf or setenv.sh, decided by USE_WRAPPER), weaving=webmethods-10, field notes from webMethods 11 Microservices Runtime, the Java 8 vs 9+ split, and how to verify the session in whatap.log.

· 9 min read

  • debugging
  • smtp
  • java
  • javamail
  • maildev
  • root-cause

A false flag: when mail.smtp.auth=false still sends AUTH LOGIN

A Java mail client ignored mail.smtp.auth=false and failed with 'AUTH LOGIN failed' on a relay that required no authentication. Reproducing it with MailDev, and why blank credentials are not the same as no credentials.

· 6 min read

Keep reading the field notes

Every note starts as a real escalation: the symptom, the metric that proved it, and the fix that shipped.

Browse all guides