My HA site will no longer display in an iframe

I use a docker container called Organizr to neatly display all of the programs I run on my server through one interface. I have used it for a while with no issues. I few days ago I updated home assistant for the first time in about 5 months. Now home assistant will not work in the iFrame on my Organizr site. It only says: "homeassistant.mydomain.com refused to connect". When i check the developer console in google crome it shows the following error: Refused to display 'https://homeassistant.mydomain.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

So I assume that the default X-Frame-Option was changed in an update for some security reason or something. Is there a way for me to change it back so I can use homeassistant in an iFrame?

Any help is much appreciated!

Update: I figured it out. If anyone else has the same problem, add the following line to your configuration.yaml:

http:
  use_x_frame_options: false
2 Likes

It was mentioned as a breaking change in one of the latest updates.
You should really always read at least the breaking changes before updating.

Hijacking because I use the same setup using organizr and HA in iFrame.
I updated from 2024.1 to .2 then it only shows the HA Logo (like its loading the dashboard). Working fine without iFrame.
Already using use_x_frame_options: false.

Not the same setup, but exactly the same symptoms.

I have 2 separate HA installs on Raspberry Pi 4s. I have accessed one page from the other system, this applies to both installs. To make the iframe content visible from outside network also, there referencing urls were the ones I am using in duckdns.org.

This used to work fine. Last autumn at some point there was a change mentioned above, due to which it was needed to add the next line to configuration.yaml:

use_x_frame_options: false under the http:

…after which it worked just fine. It is still there.

But know, and nothing else has been changed, I get only the HA logo:

image

I also have the exact same problem since the last update. I updated both the OS and Core at the same time so I’m not sure which one caused it.

I am actively looking for a solution. I’m also using duckdns.org, not sure it’s related but more info is always better.

to be clear I also have the “use_x_frame_options” set to false. I checked the breaking changes from the update but did not see anything about iframes

edit: this seems to have been already reported

Some one got it working this way:

The github topic above also lists some solutions for other occurrences of the same problem.

Adding my voice to this happening to myself since updating to 2024.2.2

This worked for me: Frontend stopped loading inside an IFRAME after upgrading to 20240207.0 · Issue #19724 · home-assistant/frontend · GitHub

You have to change the iFrame Number ID and do a full refresh.

Hmmm. When configured as a “view-” (those in the horizontal row)

image

…there are no iframe numbers etc. to be set as it is basically a card. All there is is in the format:

type: iframe
url: https://my_url:port/lovelace/page?kiosk