question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Firefox page.goto broken for sites with service worker

See original GitHub issue

Context:

  • Playwright Version: 1.0.2
  • Operating System: Ubuntu 20.04 LTS
  • Node version: 12.17.0
  • Browser: Firefox

With the firefox browser page.goto seems to never be resolved nor rejected when a service worker is running. On my project I’m using Workbox for my service worker, but you can see the bug with any service worker. The following example uses the Svelte website and its service worker. The OK message is never logged and we get a timeout error:

const { firefox } = require('playwright');

(async () => {
    const browser = await firefox.launch();
    const page = await browser.newPage();
    await page.goto('https://svelte.dev');
    console.log("Waiting for the service worker…");
    await page.waitForTimeout(1000);
    console.log("Service worker running, going to the homepage again…");
    await page.goto('https://svelte.dev');
    console.log("OK");
    await browser.close();
})();

With the firefox browser I have to disable the service worker for the OK message to finally show up:

const { firefox } = require('playwright');

(async () => {
    const browser = await firefox.launch();
    const page = await browser.newPage();
    await page.addInitScript(
        () => Object.defineProperty(navigator.serviceWorker, 'register', { get: Promise.reject })
    );
    await page.goto('https://svelte.dev');
    console.log("Waiting even if no service worker to have the same test conditions…");
    await page.waitForTimeout(1000);
    console.log("Service worker not running, going to the homepage again…");
    await page.goto('https://svelte.dev');
    console.log("OK");
    await browser.close();
})();

Note that there is no bug with the chromium browser. I couldn’t test whith WebKit because of #2447.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dgozmancommented, Jun 17, 2020

This should be fixed in the next release. You can try using playwright@next to check whether this works today.

0reactions
laurentpayotcommented, Aug 29, 2022

@kishorambare As far as I remember I was using Playwright runner.

These logs you and @shirshGit are getting look like a totally different problem. You should definitively open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

1430764 - Service Worker is not working properly
Go to https://www.chromestatus.com/features 2. Open console Actual results: Error during service worker registration: DOMException: The operation is ...
Read more >
Pinned tabs that use ServiceWorkers and do not skipWaiting ...
The bug impacted page loads that happened when the target process type wasn't already running, which would be the case for non-fission-enabled Firefox...
Read more >
Firefox refuses to connect to some websites (IndexedDB ...
The site's results suggest that your profile's QuotaManager storage is broken such that any site that uses a ServiceWorker may in turn be...
Read more >
1665368 - Strict tracking protection breaks fetches from ...
It looks like the error is shared between a "real" network error and the "service worker" error, see https://searchfox.org/mozilla-central/rev/ ...
Read more >
consider allowing service workers when cookie policy is "keep ...
My cookies were set to allow for session (delete when I close firefox). Added an exception for the site to "Allow" and it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found