glanceapp / glance

A self-hosted dashboard that puts all your feeds in one place
GNU Affero General Public License v3.0
8.56k stars 297 forks source link

Iframe not loading #140

Closed Rom0067 closed 5 months ago

Rom0067 commented 5 months ago

Hello,

Im trying to use a status link from uptime Kuma in an Iframe. I have tried other urls and they work fine but the one In trying to use from up time gives me an error. (See pic)

Any help would be appreciated thank you! Screenshot_20240610_193058_Opera

svilenmarkov commented 5 months ago

Hey,

Could you check the network tab in the developer tools and look at the response for that request? What status code is it returning, what headers, is there a X-Frame-Options header returned that might be preventing that page from being embedded?

Rom0067 commented 5 months ago

I am really dont know much about alot of this stuff so I apologize in advance. Thank you for responding!

After looking around where you suggested in the dev console I found a few things:

  1. chrome-error://chromewebdata/:1 Refused to display 'https://kuma.mydomain.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
  2. I believe I found the status code of 200 OK
  3. I also found a different error: Blocked autofocusing on a element in a cross-origin subframe. However I am not entirely sure that is related but I assumed it was.
  4. Lastly when I visit my glance instance on a laptop instead of mobile the error in the iframe is different then on mobile:

image_2024-06-10_214712343

Again thank you for helping. I understand Glance is still in the oven and if I need to remove the iframe all together I am definitely ok with that.

svilenmarkov commented 5 months ago

Thanks for providing all that info. The first error seems to be the cause:

Refused to display 'https://kuma.mydomain.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

Basically, Uptime Kuma is configured so that it prevents any pages which aren't on the same domain from displaying it in an iframe. There isn't really anything I can do within Glance to change this, however fortunately Uptime Kuma provides an easy way of disabling this behavior via setting the environment variable UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN=1. How you set this variable depends on your method of installation, however I'm assuming that's something you'd be able to figure out.

Rom0067 commented 5 months ago

Well Im not going to lie my brain hurts! I have not had to configure an .env file yet in my new journey with selfhosting but I managed! Thank you for addressing an issue that didnt have anything to do with Glance!

Screenshot 2024-06-10 230323

isnt she pretty?!

svilenmarkov commented 5 months ago

Nicely done, happy to hear you managed to sort it out!