Query parameters are unavaialble in Safari in Private mode

Recently I noticed that users with Safari 17 have some troubles using my website. I found out that the problem affects only users who use Safari in a private mode. After I dug deeper I realised that for some reason when I execute "window.location" for these users, query parameters do not present there even though they are actually present in the URL.

For example, user is on the URL
https://mywebsite.com/?code=TULEnfW1zRlqazI7XhM_QV7mxqPr-bV&state=5c5dbb2a-2332-4db7-a657-d2dc713d3e67

But the "window.location.search" returns an empty string.
Also, the issue is only reproduced when user is actually redirected to the "broken" page, but it works fine if the user opens the page in a new tab.

Issue is reproduced on both iOS and MacOS.
I have a suspicion that the issue is somehow related to the recently added feature which prevents cross-site tracking, however, disabling that feature did not help.

Does anyone aware of any recent changes to the behaviour of "window.location" in Safari?

Thanks!

Post not yet marked as solved Up vote post of botsman Down vote post of botsman
1.5k views
  • I'm encountering the same problem. It's a very weird behaviour that needs explanation by Apple.

    For me it can at least be resolved by unchecking the "Use advanced tracking and fingerprinting protection ..." checkbox in Settings > Advanced > Privacy

  • It doesn't make sense, if it's really about complete privacy, then why not block path as well? There is no fundamental difference between path and query.

  • This is breaking our production apps because the JS needs to know what to render based on the query string upon redirection.

Replies

It doesn't make sense, if it's really about complete privacy, then why not block path as well? There is no fundamental difference between path and query.