Iframe | Hotspots not showing on first load

  • Hello everyone,


    I need help for something I try to figure out these past few days.

    Here's the situation, I have a scene with multiple hotspots, everything works as expected.
    But once this scene is included into an embedded iframe, hotspots won't show, and I have to reload the page in order to display them.

    Things I've noticed :

    • When the hotspots aren't displayed, they are actually into the DOM, with exact same CSS as when it's loaded
    • The problem seems to be with the visual elements (png elements forming the hotspots) related to the DOM elements. I can't see them for the first load in the "Performance" tab in the Chrome dev tools
    • The same problem happens with other Chromium browsers (Opera, Edge...), everything is fine with Mozilla though.

    I thought about a CORS problem, knowing that the website embedding the iframe is on another server, but if that was the case the hotspots wouldn't load at all I guess.


    Thank you in advance,

  • Hi thank you for the reply,

    Here's an example : https://cubiik.fr/. The iframe is near the middle of the page.
    You'll see that the hotspots won't show, it will require reloading the page...

    I also tried to embed the iframe in a page on a another server as you did, just to test, but it works fine so yeah, it's probably not CORS.

  • Nothing is jumping out just glancing at your code but then you would have found it, I'm sure.

    I see that you are using KRPano v1.20. There have been a lot of changes since then and I seem to recall that some of them involved Chrome. Why not update to the current 1.20.9 and see if that makes a difference.

    A crude workaround might be to automatically reload the embedded page once the first load is complete. Since it is down the page the viewer won't notice.

    Good luck.

  • Hi, thank you for the tips and for your time.


    - I tried to update the krpano version but unfortunately the problem is still here.

    - Regarding the workaround, I'm having a hard time updating the scene or the iframe.
    Tried to use updatescreen() and invalidatescreen() but it doesn't seem to work, or else I didn't use them correctly.
    I also tried to update the iframe but it doesn't seem like I can do this from the iframe code to the client site.

    In any case, I have to find a way to tell if it's the first load of the page. Tried to use cookies and local storage for that but since the iframe is embeded, it isn't authorized to store this kind of data.

    Never though I'd spend that much time on it ahah.
    Please let me know if I missed something, thanks

  • Hi,


    I had a hard time trying to figure out how to do it without using cookies or localStorage, I must say that your solution is very smart for this context.

    It actually didn't work at first, because the reloading happened too early in the process. Had to put a short setTimeout() for now to make it reload a bit after and make it work. I'll try to not use it and put the reloading in the right place though.

    Thanks again for the workaround.


    I'm curious to know why this bug is happening without a workaround though, so if anyone has an idea feel free to keep this thread active.

  • Hi,

    when testing the latest krpano version make sure to clear the browser cache.

    There was a problem with invisible hotspots in some cases when the viewer was invisible at startup (e.g. hidden from DOM or having a 0/0 DOM-size), but that's already fixed in the latest version.

    Best regards,
    Klaus

  • Hi Klaus thank you for your reply,


    Well in order to test without cache I try to load the client site (embedding the iframe) in private browsing.
    Doesn't seem to work better with the new version unfortunately. On the first load, no hotspots are displayed.

    Best regards

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!