# iOS doesn't load CSS sometimes when navigating between subdomains

**URL:** https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740
**Category:** Bug
**Tags:** ios
**Created:** [March 10, 2024, 10:15am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740 "2024-03-10T10:15:59Z")
**Posts on this page:** 19
**Page:** 3

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [July 18, 2024, 6:54pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/42 "2024-07-18T18:54:40Z")

</div>

Thanks @Don, 100% repro for me as well. Testing using BrowserStack this looks like a regression after Safari 17, I get no repro on Ventura (Safari 16.5), but can repro on Sonoma (Safari 17.3). I have reported the above steps and findings [upstream to Webkit](https://bugs.webkit.org/show_bug.cgi?id=274310), this should help them track this down.

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [July 18, 2024, 7:18pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/43 "2024-07-18T19:18:18Z")

</div>

Yay, reproducible steps! 👏

Can also easily reproduce it in our forum (3.2.4). The key seems to be the navigation back step, as that triggers the bug, regardless of initial or intermediate page (I tried topic, category, FAQ, badges, etc).

While Webkit looks into this (I imagine it will take a while for a fix to reach a production release), would it make sense to try to pin down the particular change in Discourse from which it started to surface the bug in Safari and, if simple&feasible, potentially have a local workaround? In our case, it only started showing up after we recently updated from 3.1.5 to the latest stable. A big window, but maybe iterating through the betas first and go from there?

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [July 18, 2024, 8:16pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/44 "2024-07-18T20:16:51Z")

</div>

PS: Just to add that, now that I can reproduce it, I tried to temporarily disable the PWA on our main website and it didn’t seem to make any difference for this. So… not multi-PWA related.

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [July 19, 2024, 5:16am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/46 "2024-07-19T05:16:48Z")

</div>

So I’ve just try it on Chrome too and I noticed a really odd thing. If I understand it correctly it should only happens on Safari? I thought it but maybe I am wrong. Because I can repro it in Chrome browser too on iPad. So it seems the issue is with the OS? Is this also reproducible with MacOS under Chrome? 🤔 Or it’s only affects iOS and iPadOS on Chrome too because of the webkit issue?

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [July 19, 2024, 8:13am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/47 "2024-07-19T08:13:28Z")

</div>

My understanding is that Apple doesn’t allow third-party browsers on iOS/iPadOS, so Chrome/Firefox/etc are just a specialised GUI, all using Webkit to render pages behind the scenes.

As the issue is on Webkit, any browser running on iOS/iPadOS is affected.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [July 19, 2024, 12:16pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/48 "2024-07-19T12:16:04Z")

</div>

Yes that’s it 👍 Although this is changing [Using alternative browser engines in the European Union - Support - Apple Developer](https://developer.apple.com/support/alternative-browser-engines/)

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [July 29, 2024, 7:37pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/49 "2024-07-29T19:37:23Z")

</div>

> [@mentalstring](#):
>
> While Webkit looks into this (I imagine it will take a while for a fix to reach a production release), would it make sense to try to pin down the particular change in Discourse from which it started to surface the bug in Safari and, if simple&feasible, potentially have a local workaround?

Thanks for prodding us on this @mentalstring, after bisecting, I think there is a very likely culprit in: [DEV: Change default of `cross_origin_opener_policy_header` (#24940) · discourse/discourse@38abc0d · GitHub](https://github.com/discourse/discourse/commit/38abc0d922ca6866d134bb9a06a78b3b08808982)

From a test in one of our instances, running `SiteSetting.cross_origin_opener_policy_header = 'unsafe-none'` on the Rails console or adding this to your ENV:

```plaintext
DISCOURSE_CROSS_ORIGIN_OPENER_POLICY="unsafe-none"

```

fixes the issue. That site setting is a security hardening measure, we’re evaluating the pros/cons of updating core as well, but if you (and others following this issue) could try this out on your end, that would be great, it would give us more confidence that this is indeed the underlying change in Discourse.

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [July 30, 2024, 9:42am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/52 "2024-07-30T09:42:25Z")

</div>

A-ah, there it is then! 👍

I can confirm that setting COOP to `'unsafe-none'` has effectively stopped the bug from showing on our 3.2.4 instance. Toggling back to `same-origin-allow-popups` immediately brings it back.

It’s good to have some kind of temporary workaround. Meanwhile, I imagine this is likely useful info to report to the Webkit team since it points to something specific that triggers it.

PS: Thank you for looking into this and sorry about the _prodding_ – I’m just fumbling around trying to help our community. 😅

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [July 30, 2024, 10:30am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/53 "2024-07-30T10:30:25Z")

</div>

> [@pmusaraj](#):
>
> or adding this to your ENV:
> 
> ```plaintext
> DISCOURSE_CROSS_ORIGIN_OPENER_POLICY="unsafe-none"
> 
> ```

Just to prevent others from missing it too, this bit should be:

> `DISCOURSE_CROSS_ORIGIN_OPENER_POLICY_HEADER: unsafe-none`

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [September 5, 2024, 2:27pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/54 "2024-09-05T14:27:29Z")

</div>

A followup here folks: a WebKit developer merged a fix for this issue a few weeks ago. I tried to test it using the nightly WebKit builds, unfortunately, I can still reproduce the problem. However, I may be doing something wrong. Will wait for the next Safari Technology Preview release (it should be soon) to test again, hopefully it is indeed fixed. (WebKit bug report [is here](https://bugs.webkit.org/show_bug.cgi?id=274310).)

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [October 9, 2024, 4:36pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/55 "2024-10-09T16:36:35Z")

</div>

Sadly this isn’t fixed yet in the latest Safari on Sequoia. I’ve reopened the upstream Webkit bug report linked above.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [October 29, 2024, 7:44pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/56 "2024-10-29T19:44:09Z")

</div>

Good news, there is a fix upstream and it worked on my machine using the [WebKit build archives](https://webkit.org/build-archives/). It will take a few more weeks before this makes it to Safari Technology Preview first and then general Safari.

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [October 31, 2024, 8:53am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/57 "2024-10-31T08:53:21Z")

</div>

did you test it?

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [November 4, 2024, 2:15am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/58 "2024-11-04T02:15:27Z")

</div>

Yes, indeed.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [December 9, 2024, 5:59pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/59 "2024-12-09T17:59:32Z")

</div>

It looks like this finally got included in Safari Technology Preview, Release 209 (Safari 18.2, WebKit 20621.1.6).

Would love to have some confirmation from other users in this topic before closing. TIA!

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [December 22, 2024, 4:11pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/61 "2024-12-22T16:11:22Z")

</div>

I just tried with Release 210 and can confirm that the issue no longer happens in our forum (on stable) with Safari TP, while it still does with current Safari. 👍

Any clue how long it can take for it make it to mainline Safari?

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [December 23, 2024, 5:07pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/62 "2024-12-23T17:07:41Z")

</div>

I would guess it will be in the next Safari release, likely within a few weeks. Thanks for testing!

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [February 6, 2025, 9:04pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/63 "2025-02-06T21:04:33Z")

</div>

Looks like this is indeed fixed in Safari 18.3!

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [February 10, 2025, 1:00pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/65 "2025-02-10T13:00:02Z")

</div>

This topic was automatically closed after 3 days. New replies are no longer allowed.

[Previous page](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740.md?page=2)
