Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
laurentpayot opened this issue Jun 3, 2020 · 10 comments
Closed

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

laurentpayot opened this issue Jun 3, 2020 · 10 comments

Comments

@laurentpayot
Copy link

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.

@laurentpayot laurentpayot changed the title [BUG] unresolved page.goto when service worker used with Firefox browser [BUG] Firefox: unresolved page.goto when service worker running Jun 3, 2020
@laurentpayot
Copy link
Author

I could test it's working WebKit as well as Chromium. Only a Firefox issue.

@laurentpayot laurentpayot changed the title [BUG] Firefox: unresolved page.goto when service worker running [BUG] Firefox page.goto broken for sites with service worker Jun 9, 2020
@laurentpayot
Copy link
Author

I changed the title to point out the severity of this issue 👋

@dgozman
Copy link
Contributor

dgozman commented Jun 17, 2020

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

@dgozman dgozman closed this as completed Jun 17, 2020
@laurentpayot
Copy link
Author

It fixed it indeed. Thanks a lot! 👍

@shirshGit
Copy link

shirshGit commented Apr 1, 2022

Getting 'Potential security settings ahead' for firefox browser for page.goto().

Console prints below error :
page.goto: SEC_ERROR_UNKNOWN_ISSUER
=========================== logs ===========================
navigating to "https://www.google.com/", waiting until "networkidle"

changed the below firefox settings:
security.insecure_field_warning.contextual.enabled = false
security.certerrors.permanentOverride = false
network.stricttransportsecurity.preloadlist = false
security.enterprise_roots.enabled = true

But it is not resolving the issue. Any suggestion how to get rid of this?

@kishorambare
Copy link

kishorambare commented Aug 9, 2022

What was the resolutions pls ? @laurentpayot

@laurentpayot
Copy link
Author

@kishorambare sorry for the late post-vacation answer. As mentioned before, a June 2020 release fixed it. This issue didn't occur again for my app. If it's still a problem for you then I think you should create a new issue with your own environment details (mentioning this issue to link it).

@kishorambare
Copy link

Thanks @laurentpayot . N worries at all.
Was it with playwright test runner ? I am currently facing it with test runner and not jest.

@kishorambare
Copy link

Getting 'Potential security settings ahead' for firefox browser for page.goto().

Console prints below error : page.goto: SEC_ERROR_UNKNOWN_ISSUER =========================== logs =========================== navigating to "https://www.google.com/", waiting until "networkidle"

changed the below firefox settings: security.insecure_field_warning.contextual.enabled = false security.certerrors.permanentOverride = false network.stricttransportsecurity.preloadlist = false security.enterprise_roots.enabled = true

But it is not resolving the issue. Any suggestion how to get rid of this?

Any resolution on this too pls ? @laurentpayot @shirshGit

@laurentpayot
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants