Open Bug 1747936 Opened 3 years ago Updated 21 days ago

iframes can load incorrect documents when going back in history


(Core :: DOM: Navigation, defect, P3)

Firefox 95





(Reporter: aprilsylph, Unassigned, NeedInfo)


User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0

Steps to reproduce:

  1. Go to
  2. Scroll to the bottom of the page to trigger loading of more articles, updating the URL to (endless scrolling code @
  3. Load any new page from the same tab
  4. Disable JavaScript
  5. Go backwards one page (to page 6)

Actual results:

Every iframe on the page loads a document that corresponds to the iframes which were present on the first pageload, which now does not match the page being loaded; Firefox otherwise loads the page fresh, not restoring the top document to the state in which it was unloaded. Following the steps exactly (starting at page 5), you can see window.frames in the bugged page 6 matches window.frames from a fresh page 5 up to item 20.

Expected results:

The iframes should load from their src attributes instead of assuming the document structure that was loaded by going back in history is identical to the document structure which was unloaded.

(Note: step 4 is not actually necessary to reproduce the bug, it just proves this is not the fault of any page scripts.)

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Navigation' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → DOM: Navigation
Product: Firefox → Core
Flags: needinfo?(peterv)
Flags: needinfo?(bugs)
No longer blocks: 836567
Severity: -- → S3
Priority: -- → P3

I seemed to get the same behavior on Chrome.

Hi Adam, since you've been working on this area recently, care to check how this is specified in the spec? Thanks!

Flags: needinfo?(smaug)
Flags: needinfo?(peterv)
Flags: needinfo?(avandolder)
You need to log in before you can comment on or make changes to this bug.