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

[Feature] Option to disable ITP / cross-site tracking prevention? #17368

Open
alexduhanov opened this issue Sep 15, 2022 · 7 comments
Open

[Feature] Option to disable ITP / cross-site tracking prevention? #17368

alexduhanov opened this issue Sep 15, 2022 · 7 comments

Comments

@alexduhanov
Copy link

alexduhanov commented Sep 15, 2022

Hey all,

I recently updated my project to Playwright 1.25.2 and ran into a situation where some of my tests, which rely on ITP being disabled for Safari, are now failing.

Interestingly, these tests only fail when I run playwright locally on macOS Monterey -- when I run the same tests inside of a linux Docker container using the same verson of Playwright 1.25.2, the tests pass. Perhaps this is due to a difference in the way Playwright's webkit binary is compiled for linux vs macOS?

In any case, I was wondering if there is a way to recreate disabling this Safari option when running tests against webkit:

itp

Thank you!

@mxschmitt
Copy link
Member

This is related to #17285, #16937 and #17047.

So it was working at a previous WebKit version?

@mxschmitt mxschmitt changed the title [Question] webkit 1699 - option to disable ITP / cross-site tracking prevention? [Feature] Option to disable ITP / cross-site tracking prevention? Sep 15, 2022
@alexduhanov
Copy link
Author

@mxschmitt

Comparing to the other github issues you linked: in my case, the workflow/test is not dealing with iframes--only CORS calls. Additionally, webkit doesn't prompt any pop-ups.

To reiterate: I do expect the workflow/test to fail with modern versions of Safari, unless the "prevent cross-site tracking" option (as in the screenshot) is not selected; this is the observed behavior when the workflow is executed in actual Safari 16.0 on my machine. As such, I was simply hoping to replicate disabling this option within playwright/webkit.

But yes, this was working in older versions of Playwright. I just went back through every minor version and found that the test last passed in Playwright 1.17.2 / webkit v1578. As of Playwright 1.18.1 / webkit v1596, the test begins to fail.

As I mentioned, I observed that these tests do in fact pass in Playwright 1.25.2 / webkit v1699 within Docker (using mcr.microsoft.com/playwright:v1.25.0-focal as the base for my compose file), which seems a little odd to me; they only fail when I execute playwright directly on macOS.

Please let me know if I can provide any additional information.

@mxschmitt
Copy link
Member

Yeah the networking stack on macOS is different to linux/windows thats why its not occuring there.

Our WebKit is afaik not considering the Safari settings, that's why it has no effect.

We have not decided yet if we want to disable ITP by default, we do it in Firefox, since it was there a regression between 1.24 and 1.25.

@mxschmitt
Copy link
Member

Some debugging notes for the future:

  • v1588 was the last good version
  • it's based on where the binary gets compiled. webkit-mac-10.15.zip is good, while webkit-mac-12.zip is bad.
  • after 1.17 we dropped 10.15 support, that's why we run into it then.

@RobinClowers
Copy link

I'm also running into this issue, there is no pop up, the cookies just aren't sent unless 3rd party tracking is turned off. This is only the case on localhost, on a real domain they are sent correctly. I'm not sure that's because of the domain, or because it's not https, but either way, it makes testing on Webkit much more difficult.

@kkortes
Copy link

kkortes commented Jun 20, 2023

Any updates on this? Did you successfully get into a position where you can run webkit tests @alexduhanov ? We're facing the same issue.

I've been looking for a way to tell playwright how to launch webkit safari and mabye provide a launch option to disable this but no luck :(

@alexduhanov
Copy link
Author

@kkortes It's been a while but IIRC I ended up disabling those failing tests for webkit and just let them run through Chromium - I don't believe I was able to find a solution at the time. Was hoping to hear an update from the Playwright devs at some point, as they haven't yet closed this issue.

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

No branches or pull requests

4 participants