puppeteer: window.performance.fetchStart is negative after page navigation
Categories
(Core :: DOM: Performance APIs, defect, P2)
Tracking
()
People
(Reporter: aslushnikov, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Steps to reproduce:
Consider the following Puppeteer 20.8.2 script that runs Firefox 117.0a1:
import pptr from 'puppeteer'
const browser = await pptr.launch({
product: 'firefox',
});
const page = await browser.newPage();
await page.goto('https://example.com');
console.log(await page.evaluate(() => {
return performance.getEntries()[0].fetchStart;
}));
await page.close();
await browser.close();
Actual results:
This script prints -1 for the fetchStart performance entry.
Expected results:
fetchStart should never be negative.
This was reported downstream to Playwright: https://github.com/microsoft/playwright/issues/21532
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Performance' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 years ago
|
||
The severity field is not set for this bug.
:fdoty, could you have a look please?
For more information, please visit BugBot documentation.
Updated•2 years ago
|
Comment 3•2 years ago
|
||
This sounds like a valid bug, but it's a "bug" bug, not a performance bug. We'll need somebody to reproduce it (I haven't tried).
Updated•2 years ago
|
Comment 4•1 year ago
|
||
yeah this is a real bug, anybody around to take a look at this?
Comment 5•1 year ago
|
||
sefeng can you review to determine next steps, or if this is actionable?
Comment 6•1 year ago
|
||
I am able to reproduce this and Bug 1429422 sounds similar to this.
sefeng can you review to determine next steps, or if this is actionable?
This is actionable and the next step is someone to do the work :)
From https://bugzilla.mozilla.org/show_bug.cgi?id=1429422#c13, it looks like we need to change how navigationStart is computed, and since it's the baseline of all other metrics, this negative fetchStart issue may just be resolved once we've done that.
We might also be able to fix this without the above mentioned bug, it's just that someone needs to investigate this a bit further.
To reproduce this, I just used node to run the provided snippet. Something like, run these commands first
mkdir my-puppeteer-project
cd my-puppeteer-project
npm init -y
npm install puppeteer
and then run this script with node index.js
const pptr = require('puppeteer');
async function run() {
const browser = await pptr.launch({
product: 'firefox',
executablePath: '/home/sefeng/.local/workspace/mozilla/mozilla-unified5/.build-obj/debug/dist/bin/firefox',
headless: false // Set to false to see the browser UI
});
const page = await browser.newPage();
await page.goto('https://example.com');
const fetchStart = await page.evaluate(() => {
return performance.getEntries()[0].fetchStart;
});
console.log(fetchStart);
await page.close();
await browser.close();
}
run().catch(console.error);
Updated•1 year ago
|
Comment 7•1 year ago
|
||
any updates?
Updated•7 months ago
|
Comment 8•16 days ago
|
||
Any chance this could get some traction?
It making our tests look sad
Description
•