Skip to content

How should refresh behave with iframes? #6465

Open
@jakearchibald

Description

@jakearchibald

The test:

https://static-misc-2.glitch.me/iframe-refresh/

  1. Navigate iframe 1 to 'one'
  2. Navigate iframe 2 to 'two'
  3. Refresh

Chrome

Reload with all four iframes set to their initial src urls.

Clicking back will navigate the first three iframes, the first one to "one", and the other two to "initial". iframes two and three reload even though they're going to the same URL.

Iframe 4 does not reload.

Clicking forward will navigate all four iframes back to initial. This is weird and asymetrical, and seems to be caused by the 4th iframe being JS-created.

Safari

Same as Chrome, except iframe 4 doesn't have special behaviour – it's treated similar to iframe 3.

I think Chrome and Safari are running their code to remap session history back to iframes, as if they haven't seen them before. Safari does include JS-created iframes in this process, but Chrome doesn't, which may explain what we're seeing here.

Firefox

Firefox changes behaviour, and it feels like time is involved.

Firefox behaviour 1

If I run the above steps in a reasonable time, then Firefox sets all iframes to their initial src urls, but it also discards other history entries related to the page (although the back/forward UI doesn't realise this). This is kinda reasonable behaviour.

Firefox behaviour 2

However, if I leave a few minutes between steps 2 & 3, then Firefox reloads with the first two iframes set to "one" and "two", as in it restores them.

Clicking back navigates just iframe 2 back to "initial", clicking back again navigates just iframe 1 back to "initial". Clicking forward does the reverse.

This is also reasonable behaviour, but it's really really weird that it changes based on time. @annevk help! Who can tell me what's actually going on here?

Correct behaviour

The state that Chrome and Safari get into seems really weird to me. Firefox's multiple-behaviours are even weirder, but either one of those behaviours seem ok. I dunno, I kinda want to just hide under a rock.

Metadata

Metadata

Assignees

No one assigned

    Labels

    interopImplementations are not interoperable with each othertopic: history

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions