Seatext library / BotRefund evidence
How to Validate Your Empty Font Canvas Detection
Test your empty font canvas detection by running automated browser frameworks like Puppeteer or Playwright against your site. Compare the canvas hashes generated by these headless environments against those of a standard user browser...
✓ Built for advertisers who need clear, refund-ready traffic evidence.
Validating Your Detection Setup
To test if your empty font canvas detection is working correctly, run known bot frameworks like headless Chrome and Puppeteer against your site, compare their canvas hashes to real browser hashes, and verify that automated traffic is flagged while legitimate traffic passes through. This is the core validation method. You need to confirm that your system distinguishes between a normal browser and an automated one based on the empty font canvas signal.
Start by establishing a baseline. Use a standard, non-automated browser like Chrome or Firefox. Visit your site and record the canvas hash or fingerprint generated by your detection system. This is your control. Then, deploy a test script using Puppeteer or Playwright. Navigate to the same page. Check your detection logs for the session ID. If the system works, the canvas hash should differ from the baseline or trigger a specific headless flag.
But a single hash difference is not enough. A robust system cross-checks this signal with other evidence. BotRefund, for example, uses 106 independent checks to build a reliable picture of whether a visit is human or automated. The empty font canvas is just one of those checks. So your validation should also confirm that the system does not rely solely on this signal. It should weigh it alongside network behavior, device metadata, and other factors.
How Empty Font Canvas Detection Works
The empty font canvas check looks for a mismatch that a real browsing session does not normally create. A normal browser reports hardware, graphics, fonts, and operating-system details that naturally fit together for that device. An automated browser, such as headless Chrome, often fails to render fonts and graphics identically. This results in an empty or mismatched canvas hash.
Why does this happen? Headless browsers run in a simulated environment. They lack the full graphics stack of a real device. They may not load all system fonts. They may use software rendering instead of hardware acceleration. These differences show up in the canvas fingerprint. The canvas element is a drawing surface in HTML5. When you draw text or shapes, the browser uses its rendering engine. The output depends on the installed fonts, the graphics driver, and the operating system. A headless browser often produces a blank or simplified canvas because it cannot access the same resources.
BotRefund treats this signal as evidence, not a verdict. It adds one objective fact about the visit. Then it cross-checks that fact with other independent signals. The AI model weighs the complete pattern. This is why BotRefund claims 99% accuracy. Accuracy comes from corroboration, not one browser tell.
Why Canvas Detection Matters
The empty font canvas check is one of many signals used to identify automated traffic. Virtual machines and spoofed browser profiles often struggle to replicate the complex, hardware-accelerated rendering of a real device. They frequently reveal themselves through subtle graphical inconsistencies. If this detection is ignored, sophisticated bots may bypass your security by mimicking human headers while their underlying hardware signatures remain mismatched.
Consider the cost of bot traffic. Bot clicks steal up to 20% of your Google and Meta ad budget. They pollute your analytics, distort conversion data, and waste your spend. By detecting bots early, you can prevent them from exhausting your budget. You can also use the evidence to claim refunds from ad platforms. BotRefund proves bot clicks, negotiates with Google and Meta, and gets your money back. The empty font canvas is a critical piece of that evidence.
But the signal is not just about ad fraud. It also protects your site from scraping, credential stuffing, and other automated attacks. A bot that cannot render fonts correctly is likely a bot. Catching that early can save you from more serious damage.
Interpreting Detection Results
When you run your validation tests, you need to interpret the results correctly. A failed canvas check does not automatically mean a user is a bot. Privacy tools, corporate networks, and unusual hardware configurations can occasionally produce unexpected rendering results for genuine humans. That is why BotRefund keeps this signal as evidence, not a verdict.
In your logs, you should see a flag or a score for the empty font canvas check. A high score indicates a strong mismatch. A low score means the canvas looks normal. But you should not block a user based on this score alone. Instead, look at the overall pattern. Does the session also show suspicious network behavior? Does the device metadata match the browser? Does the user interact with the page like a human? The AI model combines all these signals to make a final prediction.
For validation, you want to see that your test bot gets a high canvas mismatch score. You also want to see that a real browser gets a low score. If your test bot is not flagged, something is wrong. Maybe your detection script is not initialized correctly. Maybe the bot is using stealth plugins that mask its headless nature. Or maybe your system is too lenient. You need to investigate.
Limitations and False Positives
No detection method is perfect. The empty font canvas check has limitations. It can produce false positives. A user with a rare font configuration might get a mismatch. A user on a virtual machine might look like a bot. A user with a privacy extension that blocks font loading might also trigger the check.
BotRefund addresses this by using 106 independent checks. A single anomaly is not a bot verdict. The system cross-checks the canvas signal with browser, network, device, and behavior data. This reduces false positives. But you should still be aware of the limitations when you test.
Another limitation is that sophisticated bots can sometimes spoof the canvas. They can use headless browsers with custom patches or use real browser engines in a virtualized environment. They might even load real fonts. In that case, the empty font canvas check might not catch them. That is why you need multiple layers of detection. The empty font canvas is just one tool in the toolbox.
When you validate, you should test with different bot frameworks. Puppeteer, Playwright, Selenium, and others may produce different results. Some are more detectable than others. You should also test with stealth plugins to see if they bypass your detection. This helps you understand the robustness of your system.
Best Practices for Testing
To ensure your empty font canvas detection is working correctly, follow these best practices:
- Use a controlled environment. Run your tests in a clean browser profile. Clear cache and cookies. Use a fresh user agent.
- Test with multiple bot frameworks. Do not rely on one. Use Puppeteer, Playwright, and Selenium to see how each behaves.
- Compare hashes. Record the canvas hash from a real browser and from each bot. Look for consistent differences.
- Check your logs. Ensure that the detection system logs the canvas signal for each session. Verify that the bot sessions have a mismatch flag.
- Test with stealth plugins. Some bots use plugins to hide their headless nature. See if your detection still catches them.
- Run a regression suite. After any changes to your site or detection script, rerun the tests to ensure nothing broke.
- Use BotRefund's live audit. The free bot audit can show you how your current traffic is being evaluated. It can identify if your site is leaking data to automated browsers.
Remember, the goal is not to block every mismatch. The goal is to identify bots accurately while letting real users through. Your testing should reflect that balance.
Practical Example: A Test Script Walkthrough
Let's walk through a concrete example. Suppose you have a website with BotRefund installed. You want to verify that the empty font canvas detection is working. Here is a simple Puppeteer script that simulates a bot visit:
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.goto('https://your-site.com');
// Wait for the detection script to run
await page.waitForTimeout(2000);
// Extract the canvas hash from the page (assuming your script exposes it)
const hash = await page.evaluate(() => window.__canvasHash);
console.log('Bot canvas hash:', hash);
await browser.close();
})();
Now, open the same page in a regular Chrome browser. Use the developer console to get the canvas hash. You might see something like:
- Real browser hash:
a1b2c3d4e5f6... - Headless Chrome hash:
000000000000...(empty or different)
If your detection system is working, the bot session should be flagged. In your BotRefund dashboard, you should see a session with a high canvas mismatch score. The real browser session should have a low score.
Now, let's compare expected vs. actual hashes. Suppose your detection script computes a hash of the canvas content. For a real browser, the hash might be 5f4dcc3b5aa765d61d8327deb882cf99. For a headless browser, it might be e3b0c44298fc1c149afbf4c8996fb924 (which is the SHA-256 of an empty string). This difference is what triggers the flag.
If your test bot is not flagged, check the following:
- Is the detection script loaded on the page? Look for errors in the console.
- Is the script running before the canvas is drawn? It might need to wait for the page to fully render.
- Is the bot using a stealth plugin? Try disabling it.
- Is your detection system configured to ignore certain user agents? Check your settings.
By following this example, you can confirm that your detection is working as intended.
Frequently Asked Questions
Does a failed canvas check mean a user is definitely a bot?
No. BotRefund treats this signal as evidence, not a verdict. It is cross-checked against other independent signals to ensure high accuracy.
Can I test this without coding a bot script?
You can use the BotRefund live audit feature to see how your current traffic is being evaluated and identify if your site is currently leaking data to automated browsers.
What if my test script is not being flagged?
Ensure your script is not using "stealth" plugins that attempt to mask the headless nature of the browser. If it still passes, check that your detection script is correctly initialized on the page.
How does this affect my ad spend?
By identifying bots that trigger fake clicks, you can prevent them from exhausting your budget and use the evidence to claim refunds from platforms like Google and Meta.
How many checks does BotRefund use?
BotRefund uses 106 independent checks, including the empty font canvas, to build a reliable picture of whether a visit is human or automated.
What is BotRefund's accuracy rate?
BotRefund claims 99% accuracy through corroboration of browser, network, and device data. The AI model weighs the complete pattern instead of trusting a raw rule.
Can I rely on the empty font canvas alone?
No. A single anomaly is not a bot verdict. You need a multi-layered approach. BotRefund cross-checks this signal with other independent data to reduce false positives.
How long does it take to set up BotRefund?
Typically about one minute. You add a script to your website, and you can start your free bot audit immediately.
Key Facts: BotRefund Detection
| Feature | Description |
|---|---|
| Detection Scope | Uses 106 independent checks, including canvas and hardware fingerprinting. |
| Verdict Logic | A single anomaly is evidence, not a verdict; AI weighs the full pattern. |
| Accuracy | 99% accuracy through corroboration of browser, network, and device data. |
| Setup Effort | Typically takes about one minute to add to your website. |
Further reading and comparison sources
These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.
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.