Don't restore iframes from history if the node's id has changed

NEW
Unassigned

Status

()

Core
Document Navigation
--
major
9 years ago
2 months ago

People

(Reporter: Joel, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6

IFrames don't reload on refresh.  We have two companies that pay us to display their iframe on our page, company a and company b.  On the first load, company a's description comes up, with their iframe below it.  Pressing 'refresh' on the page, shows company b's description BUT company a's iframe is still displayed.  The src on the page shows the proper src (company b's src) on the iframe, but the content of the iframe stays as company a's content.

Reproducible: Always

Steps to Reproduce:
1.Create an html page with just the text "Yahoo<br/><iframe src="http://www.yahoo.com" />"
2.View the page in firefox.
3.Change the html to be just the text "Google<br/><iframe src="http://www.google.ca" />"
4.Press 'refresh'.
Actual Results:  
Yahoo's page will still be displayed in the iframe, even though the text above it has changed to "Google", and viewing the src of the page shows google as the src of the iframe.

Expected Results:  
Google's page should show in the iframe.

This bug has already been reported and marked as resolved/duplicate, but I have the latest version of Firefox 3 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6), and it happens for me every time.

Here are the bugs marked as resolved:
https://bugzilla.mozilla.org/show_bug.cgi?id=235185
and this one is listed as a duplicate of the bug above, but is more closely related to the bug I'm reporting now:
https://bugzilla.mozilla.org/show_bug.cgi?id=354176

Thanks for your help :),
Joel.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 235185
(Reporter)

Comment 2

9 years ago
At the request of Boris, I am re-opening this bug with the following amendments:

Certainly iframes with different ids should be considered two different iframes, and not reloaded with the same content, ie., if the steps to reproduce include ids in the iframe:

Steps to Reproduce:
1.Create an html page with just the text "Yahoo<br/><iframe
id="yahoo" src="http://www.yahoo.com" />"
2.View the page in firefox.
3.Change the html to be just the text "Google<br/><iframe
id="google" src="http://www.google.ca" />"
4.Press 'refresh'.
Actual Results:  
Yahoo's page will still be displayed in the iframe, even though the text above
it has changed to "Google", and the ids of the iframes have changed, and viewing the src of the page shows google as the
src of the iframe.

Expected Results:  
Google's page should show in the iframe.

I would also like to ask if there is some way to detect what the iframe's src was initialized with?  This would only take into account iframes that are loaded via static HTML (not javascript - somebody else can elaborate on this if they choose to, but the bug I am concerned with has nothing to do with dynamically created iframes), then the src I would be referring to as "original url" would be the src that was passed to the browser via the HTML code "<iframe src='ORGINAL_URL' />".  If there was some way to detect this variable, would it make sense to treat iframes as different and have the content reloaded if this original url was different from the next url passed on 'refresh'?  Such as the case listed above (google vs. yahoo)?

Thanks for your thoughts :),
Joel.
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
The other thing Joel and I talked about was possibly detecting iframes that have never been navigated (i.e. still have the original URI from their @src loaded) and not restoring those from history either, at least if the @src has changed.

Smaug, you're working on this mess, right?  ;)
Status: UNCONFIRMED → NEW
Component: General → Document Navigation
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → docshell
Summary: IFrames Don't Reload on Refresh. → Don't restore iframes from history if the node's id has changed

Updated

9 years ago
Depends on: 527897

Updated

7 years ago
Duplicate of this bug: 235185
(Reporter)

Comment 5

7 years ago
This still happens in Firefox 8.

Comment 6

6 years ago
Still happens Nightly 18.0a1.  This is driving me nuts.  The Facebook Like button iframes are restored every session reload.  This makes the facebook like buttons like the older post when a new post comes out.

Comment 7

5 years ago
Not sure if this is the same bug, but I'm currently developing a website with iframes.  My iframe HTML loads certain CSS and JS resources, as does the main (top-level) page (a completely different set of files).  As I update files on the server, I can refresh the page, and FF will load the updated versions of my resources for the MAIN page.  But it will continue to load stale CSS/JS files into the iframes, even if I press SHIFT-refresh.

To work around this I either need to completely clear my cache (ensuring my page is not open in any tabs while I do so), or else I can open the relevant JS and CSS files directly in their own tabs and refresh each one, before refreshing my page.

It's getting to be really annoying!
Dean, that sounds like a different bug, worth filing separately...

Comment 9

5 years ago
Boris - you're right.  In fact it turned out it has nothing to do with iframes at all.  For some reason my JS/CSS is being served from the BFcache without checking modification date at the server, even when loading the (normally iframed) page in the full window.

Sorry for the irrelevant post!

Comment 10

4 years ago
Is there anything that I can do to help fix this bug? :)
Duplicate of this bug: 1003334

Comment 12

2 months ago
Already posted this on bug 356558 but it seems to be relevant here, too.

I've created a scrolling activity feed, sometimes these posts contain content embedded in iframes, like YouTube videos. It's sorted from newest to oldest. No dynamic client side activity with javascript or anything like that.

If I have these 3 iframe scattered down the page:

<iframe src="C"></iframe> - video C displays
<iframe src="B"></iframe> - video B displays
<iframe src="A"></iframe> - video A displays

Everything matches and all is right. If a new video gets added to the top of the feed, I end up with this

<iframe src="D"></iframe> - video C displays
<iframe src="C"></iframe> - video B displays
<iframe src="B"></iframe> - video A displays
<iframe src="A"></iframe> - video A displays

So it *seems* to be caching the iframes purely based on their relative position in the document. So far it seems like reloading each iframe with javascript (this.contentWindow.location.href = this.src;) is the easiest way to work around this. Doesn't seem like any amount of change to the markup (unique names, IDs, changes to any other attribute) is enough to convince firefox to lay off the cache.
You need to log in before you can comment on or make changes to this bug.