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

prebid / Prebid.js / 19507630881

19 Nov 2025 03:56PM UTC coverage: 96.231% (+0.02%) from 96.214%
19507630881

push

github

web-flow
CI: reduce dependency on browserstack (#14165)

* try safari testing

* try macos-latest

* adjust save/load

* adjust again

* why

* adjust -C

* try safarinative

* use SafariNative

* separate build from run-tests

* browser tests

* add safari

* refactor

* use setup step

* add firefoxHeadless

* add edge

* try force-local

* temporarily remove build logic testing

* --force-local only on win

* add npm install to build

* run npm install on windows

* use script to generate id

* use --force-local on save as well

* setup edge

* remove run npm install option

* enable debug logging

* try edge headless

* define EdgeHeadless

* try chromium edge

* remove edge launcher

* disable debug logging

* add build logic test step

* set shell bash

* move id generation to actions/save

* browser_testing.json

* fix coverage

* add browerstack

* fix bstack secrets

* remove unnecessary checkout

* Clean up unused input

* try clearing localStorage

53257 of 65255 branches covered (81.61%)

1 of 1 new or added line in 1 file covered. (100.0%)

52 existing lines in 18 files now uncovered.

203226 of 211186 relevant lines covered (96.23%)

71.89 hits per line

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

66.67
/libraries/timeToFirstBytesUtils/timeToFirstBytesUtils.js
1
/**
2
 * Calculates the Time to First Byte (TTFB) for the given window object.
3
 *
4
 * This function attempts to use the Navigation Timing Level 2 API first, and falls back to
5
 * the Navigation Timing Level 1 API if the former is not available.
6
 *
7
 * @param {Window} win - The window object from which to retrieve performance timing information.
8
 * @returns {string} The TTFB in milliseconds as a string, or an empty string if the TTFB cannot be determined.
9
 */
10
export function getTimeToFirstByte(win) {
11
  const performance = win.performance || win.webkitPerformance || win.msPerformance || win.mozPerformance;
66!
12

13
  const ttfbWithTimingV2 = performance &&
66✔
14
        typeof performance.getEntriesByType === 'function' &&
15
        Object.prototype.toString.call(performance.getEntriesByType) === '[object Function]' &&
16
        performance.getEntriesByType('navigation')[0] &&
17
        performance.getEntriesByType('navigation')[0].responseStart &&
18
        performance.getEntriesByType('navigation')[0].requestStart &&
19
        performance.getEntriesByType('navigation')[0].responseStart > 0 &&
20
        performance.getEntriesByType('navigation')[0].requestStart > 0 &&
21
        Math.round(
22
          performance.getEntriesByType('navigation')[0].responseStart - performance.getEntriesByType('navigation')[0].requestStart
23
        );
24

25
  if (ttfbWithTimingV2) {
66✔
26
    return ttfbWithTimingV2.toString();
66✔
27
  }
28

UNCOV
29
  const ttfbWithTimingV1 = performance &&
×
30
        performance.timing.responseStart &&
31
        performance.timing.requestStart &&
32
        performance.timing.responseStart > 0 &&
33
        performance.timing.requestStart > 0 &&
34
        performance.timing.responseStart - performance.timing.requestStart;
35

UNCOV
36
  return ttfbWithTimingV1 ? ttfbWithTimingV1.toString() : '';
×
37
}
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