← Back to microsoft/playwright
microsoft / playwright · Issue No. 42174
In Playwright 1.62.0, a page created on a BrowserContext that is already offline (context.setOffline(true) before newPage()) reports navigator.onLine === true from the first script and never receives an offline event. 1.61.1 correctly reports onLine === false.
Toggle-offline on an already-open page works in both versions.
const { chromium } = require('@playwright/test');
(async () => {
const browser = await chromium.launch();
const context = await browser.newContext();
await context.setOffline(true);
const page = await context.newPage();
const probe = await page.evaluate(() => ({
initOnLine: navigator.onLine,
}));
console.log(probe); // 1.62.0: { initOnLine: true } — wrong
// 1.61.1: { initOnLine: false } — correct
await browser.close();
})();
Filed from Pyrenza (LIFTV-2200) after LIFTV-2189 adjudication. We currently pin @playwright/test at 1.62.1 in two package.json locations; confirming whether 1.62.1 still reproduces or if a later fix landed.
Nearest prior art mentioned: microsoft/playwright#34402.
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.