Seatext library / BotRefund evidence
How to Implement WebWorker Platform Leak Detection
WebWorker platform leak detection identifies bots by comparing navigator.platform values between the main thread and a spawned worker. This forensic signal reveals environment mismatches common in headless browsers. BotRefund uses this as one of...
✓ Built for advertisers who need clear, refund-ready traffic evidence.

What Is a WebWorker Platform Leak?
A WebWorker platform leak is a specific type of browser fingerprinting anomaly. It occurs when an automated script fails to synchronize its spoofed identity across different execution contexts. Modern browsers run code in two primary environments: the main window thread and isolated WebWorker threads.
Headless browsers like Puppeteer or Playwright often mask their identity on the main thread. They might report navigator.platform as "Win32" to appear as a standard Windows user. However, these tools frequently forget to apply the same override to the WebWorker thread.
The WebWorker thread then reports its true underlying environment. This creates a mismatch. A real human browser maintains consistent identity signals across all threads. An automated bot often leaks its true nature through this discrepancy.
Why This Matters for Security
This leak matters because it provides high-confidence evidence of automation. Basic IP blocking is easily bypassed using residential proxies. User-Agent strings are trivial to spoof. But maintaining consistent environmental states across multiple JavaScript execution contexts is technically difficult for bot frameworks.
Automated scrapers and click-fraud bots consume ad budgets without generating value. They poison conversion data and inflate costs. Detecting these leaks allows you to filter out non-human traffic at the source.
BotRefund utilizes this signal as part of a broader forensic strategy. It is not a standalone verdict. Instead, it serves as one objective fact about the visit. When combined with other signals, it helps build a reliable picture of whether a visitor is human or automated.
Detection Signals Comparison
Understanding how different signals contribute to detection helps in building a robust system. The table below compares key indicators used in modern bot detection.
| Signal Type | Criteria | Takeaway |
|---|---|---|
| Platform Leak | Mismatch between main thread and WebWorker navigator.platform | High-confidence indicator of headless automation. |
| User Agent | String format and version consistency | Easily spoofed; low confidence alone. |
| Hardware Concurrency | Number of logical processors reported | Often defaults to 4 or 8 in headless modes. |
| Input Telemetry | Mouse jitter and keystroke timing | Bots lack natural human hesitation and movement. |
How to Implement Detection
Implementing this detection requires spawning a WebWorker from your main script. You must then query the navigator.platform property in both contexts. Finally, compare the results to identify discrepancies.
Here is a practical code example for implementing this check:
// Main Thread Script
const mainPlatform = navigator.platform;
// Create a Blob containing the worker code
const workerCode = `
self.onmessage = function(e) {
const workerPlatform = navigator.platform;
self.postMessage({
mainPlatform: e.data,
workerPlatform: workerPlatform,
match: (e.data === workerPlatform)
});
};
`;
const blob = new Blob([workerCode], { type: 'application/javascript' });
const workerUrl = URL.createObjectURL(blob);
const worker = new Worker(workerUrl);
worker.onmessage = function(event) {
const result = event.data;
if (!result.match) {
console.warn('Potential Bot Detected: Platform Mismatch');
// Trigger security action here
}
};
worker.postMessage(mainPlatform);
This script sends the main thread's platform string to the worker. The worker reads its own platform string and returns both values. If they do not match, you have identified a potential leak.
Trade-offs and Limitations
While effective, this method has limitations. Privacy tools, corporate network configurations, and unusual hardware can occasionally produce anomalies. A single anomaly is not a definitive bot verdict.
For instance, some enterprise environments may restrict WebWorker capabilities or alter default behaviors. Real users behind certain privacy extensions might also exhibit slight inconsistencies.
Therefore, you should never rely on this signal in isolation. Always use a multi-signal approach. Cross-reference the platform leak with behavioral data, such as mouse movement patterns and input speed. This reduces false positives significantly.
BotRefund addresses this by cross-checking this signal against independent browser, network, device, and behavior data. It treats the leak as evidence, not a final judgment. This ensures that genuine users are not blocked due to rare technical quirks.
Best Practices for Integration
To integrate this effectively, follow these best practices:
- Run Checks Early: Execute the WebWorker check during the initial page load. This allows you to block malicious sessions before they interact with critical content.
- Combine with Behavioral Telemetry: Pair the platform leak check with analysis of user interactions. Bots struggle to reproduce the varied timing and hesitation of real people.
- Use AI Prediction: Feed multiple signals into a prediction model. BotRefund uses an AI model that weighs the complete pattern instead of trusting raw rules. This approach contributes to its claimed 99% accuracy.
- Monitor Performance: Ensure your WebWorker scripts are lightweight. They should evaluate traffic without impacting user experience or site performance.
Frequently Asked Questions
Does this affect site performance?
No, lightweight edge scripts evaluate traffic without impacting user experience. The WebWorker runs in a separate thread, minimizing overhead on the main UI thread.
Is this the same as IP blocking?
No, IP blocking is easily bypassed by proxies. Behavioral detection identifies the browser's actual nature based on internal execution states.
How accurate is this method?
When combined with 100+ other forensic signals, it reaches 99% accuracy. The platform leak is just one component of a comprehensive detection system.
Do I need to change my ad account settings?
No, the detection happens on your site. It does not require access to your ad account credentials or bid strategies.
What if a real user triggers a false positive?
A robust system uses cross-checking to ensure one anomaly does not result in a false block. BotRefund keeps this signal as evidence and verifies it against other data points.
Learn More About BotRefund
BotRefund uses the WebWorker platform leak as one of its 106 independent checks. This signal helps build a reliable picture of whether a visit is human or automated. By combining this with behavioral telemetry, BotRefund achieves high-accuracy identification of non-human traffic.
If you want to protect your ad spend and clean your conversion data, consider integrating a comprehensive solution. BotRefund offers a free audit to help you understand your bot exposure.
Further reading and comparison sources
These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.
Learn more
Visit the website for more information.
Ready to Take the Next Step?
See how our verified tools and services help you put this guide into practice.