Safari doesn't redirect to a different domain

Hi. I'm developing a widget that, in certain cases, needs to redirect the user to a different domain. For example, when I open https://premium.onet.pl/ and then, through the developer console, execute a redirection such as:

  window.location.href = "https://google.com"

nothing happens in Safari (Version 18.3.1). In contrast, the same redirection works flawlessly in Chrome.



I have experimented with several methods, including:


window.location.href = "https://google.com"
setTimeout(() => { window.location.href = "https://google.com" }, 250)
window.location.assign("https://google.com")


I also disabled the Website Tracking option in Safari's Privacy tab, but the issue persists.

In browser's incognito mode the issue persist


Here are some relevant header details from the request to https://premium.onet.pl/:


Summary
URL: https://premium.onet.pl/
Status: 200
Source: Network
Address: 99.83.209.207:443


Request
:method: GET
:scheme: https
:authority: premium.onet.pl
:path: /
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-GB,en;q=0.9
Cookie: acc_segment=33; acc_segment_ts=1745305998
Priority: u=0, i
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3.1 Safari/605.1.15


Response
:status: 200
Cache-Control: max-age=120, public
Content-Encoding: br
Content-Length: 11579
Content-Type: text/html; charset=utf-8
Date: Fri, 16 May 2025 10:19:53 GMT
ETag: "11579-1b326b260dfba8b0"
Link: <https://ocdn.eu/paywall-cdn/piano/onet/lp-oneoffer/glide/glide.core.css>; rel=preload; as=style, <https://ocdn.eu/paywall-cdn/piano/onet/lp-oneoffer/glide/glide.theme.css>; rel=preload; as=style, <https://view.raspaid.pl/ocdn/paywall-cdn/onetPremium/LP/style.1ir4fkcpa.css>; rel=preload; as=style, <https://events.ocdn.eu>; rel=preconnect, <https://ocdn.eu/paywall-cdn/piano/onet/lp-oneoffer/glide/glide.core.css>; rel=preload; as=style, <https://ocdn.eu/paywall-cdn/piano/onet/lp-oneoffer/glide/glide.theme.css>; rel=preload; as=style, <https://view.raspaid.pl/ocdn/paywall-cdn/onetPremium/LP/style.1ir4fkcpa.css>; rel=preload; as=style, <https://events.ocdn.eu>; rel=preconnect, <https://www.googletagmanager.com>; rel=preconnect, <https://www.google-analytics.com>; rel=preconnect
Server: Ring Publishing - Accelerator



I found an article (https://stackoverflow.com/questions/79390056/safari-not-redirecting-using-window-location-replace-or-window-location-href-on#:~:text=Safari%20has%20ITP%20(Intelligent%20Tracking,location) on StackOverflow indicating that Safari's Intelligent Tracking Prevention (ITP) might be interfering with redirects. Could you please confirm if ITP is the cause of this behaviour? If so, is there any supported way to disable ITP for redirection purposes?


Any guidance you can provide would be greatly appreciated.


Thank you for your assistance.

MacBook Air 13″, macOS 14.6

Posted on May 16, 2025 04:49 AM

Reply

Similar questions

There are no replies.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Safari doesn't redirect to a different domain

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.