• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

prebid / Prebid.js / 21666852693

04 Feb 2026 09:55AM UTC coverage: 96.219% (-0.001%) from 96.22%
21666852693

Pull #14404

github

46ee63
mkomorski
getFallbackWindow -> utils
Pull Request #14404: Core: disabling fingerprinting apis

41722 of 51298 branches covered (81.33%)

46 of 53 new or added lines in 8 files covered. (86.79%)

10 existing lines in 2 files now uncovered.

209202 of 217422 relevant lines covered (96.22%)

71.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/libraries/webdriver/webdriver.js
1
import {isFingerprintingApiDisabled} from '../fingerprinting/fingerprinting.js';
2
import {getFallbackWindow} from '../../src/utils.js';
3

4
/**
5
 * Warning: accessing navigator.webdriver may impact fingerprinting scores when this API is included in the built script.
6
 * @param {Window} [win] Window to check (defaults to top or self)
7
 * @returns {boolean}
8
 */
9
export function isWebdriverEnabled(win) {
10
  if (isFingerprintingApiDisabled('webdriver')) {
33✔
11
    return false;
1✔
12
  }
13
  return getFallbackWindow(win).navigator?.webdriver === true;
32✔
14
}
15

16
/**
17
 * Detects Selenium/WebDriver via document/window properties (e.g. __webdriver_script_fn, attributes).
18
 * @param {Window} [win] Window to check
19
 * @param {Document} [doc] Document to check (defaults to win.document)
20
 * @returns {boolean}
21
 */
22
export function isSeleniumDetected(win, doc) {
23
  if (isFingerprintingApiDisabled('webdriver')) {
3!
NEW
24
    return false;
×
25
  }
26
  const _win = win || (typeof window !== 'undefined' ? window : undefined);
3!
27
  const _doc = doc || (_win?.document);
3!
28
  if (!_win || !_doc) return false;
3!
29
  const checks = [
3✔
30
    'webdriver' in _win,
31
    '_Selenium_IDE_Recorder' in _win,
32
    'callSelenium' in _win,
33
    '_selenium' in _win,
34
    '__webdriver_script_fn' in _doc,
35
    '__driver_evaluate' in _doc,
36
    '__webdriver_evaluate' in _doc,
37
    '__selenium_evaluate' in _doc,
38
    '__fxdriver_evaluate' in _doc,
39
    '__driver_unwrapped' in _doc,
40
    '__webdriver_unwrapped' in _doc,
41
    '__selenium_unwrapped' in _doc,
42
    '__fxdriver_unwrapped' in _doc,
43
    '__webdriver_script_func' in _doc,
44
    _doc.documentElement?.getAttribute('selenium') !== null,
45
    _doc.documentElement?.getAttribute('webdriver') !== null,
46
    _doc.documentElement?.getAttribute('driver') !== null
47
  ];
48
  return checks.some(Boolean);
3✔
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc