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

[Question] Firefox does not reload if goto has the same url #15781

Closed
cupcakearmy opened this issue Jul 19, 2022 · 5 comments
Closed

[Question] Firefox does not reload if goto has the same url #15781

cupcakearmy opened this issue Jul 19, 2022 · 5 comments

Comments

@cupcakearmy
Copy link

I wanted to ask if this is expected behaviour:
Firefox does not goto/reload the page if the url is the same as the current one. Safari and Chrome both reload/load the page even if the current url is the same.

const link = 'http://localhost/foo/bar'
await page.goto(link)
await page.goto(link) -> Firefox does not reload

(Browsers are all desktop on macos)

Thanks for the AMAZING project! ❤️

@dgozman
Copy link
Contributor

dgozman commented Jul 20, 2022

@cupcakearmy Firefox does reload the page for me. Could you please share a full repro that we can run locally?

@dgozman
Copy link
Contributor

dgozman commented Jul 24, 2022

We have to reproduce this issue locally to be able to debug it. If you can provide a full repro, please file a new issue with it, and link to this one.

@dgozman dgozman closed this as completed Jul 24, 2022
@penyaskito
Copy link

Sorry for commenting on a closed issue, landed here searching.
I thought I was having the same issue while testing there are no cached issues. My tests failed only on firefox.
In step by step debugger, if I Ctrl + R just before my navigation, my content doesn't change. If I Ctrl + Shift + R, it does. So might be the same you were experiencing, and it looks like it's not reloading. Still figuring out a way to hard refresh via playwright.

@penyaskito
Copy link

Ended up doing this and it worked:

    // Firefox does some aggressive caching, so playwright reload will load from
    // the cache instead of a hard refresh. Firefox implementation of
    // location.reload has non-standard bool argument for forcing it. That
    // argument is ignored for other browsers, so it's safe to use.
    // https://developer.mozilla.org/en-US/docs/Web/API/Location/reload
    await anonPage.evaluate(() => location.reload(true)),

@AlanJereb
Copy link

Ended up doing this and it worked:

    // Firefox does some aggressive caching, so playwright reload will load from
    // the cache instead of a hard refresh. Firefox implementation of
    // location.reload has non-standard bool argument for forcing it. That
    // argument is ignored for other browsers, so it's safe to use.
    // https://developer.mozilla.org/en-US/docs/Web/API/Location/reload
    await anonPage.evaluate(() => location.reload(true)),

After two days of debugging, this is what solved our issue.
Each Firefox test failed on the first run and passed on retry.

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