Serious iFrame Bug

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
User avatar
jonblock
Posts: 7
Joined: September 21st, 2006, 8:33 am

Serious iFrame Bug

Post by jonblock »

Help - our website advertisers want to use iFrame ads, and Firefox seems to have a serious iFrame glitch. I imagine this causes a huge problem for any compaines who rely on iFrame tags to pay for advertising.

Here's an example of how to recreate the problem:

Create a plain HTML document. In the body, create an iframe pointing at any site. Go into your HTML source code again, change the SRC of the iframe to another site, save, and then reload your browser. Firefox still shows the first site!

This causes a serious problem for any company that depends on iFrames to work correctly because many website advertisers send out iFrame-based advertising tags. Help!

Thank you,
Jon
User avatar
jscher2000
Posts: 11734
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Post by jscher2000 »

What happens if you hold Shift when you reload?

Fx 1.5 has a more determined caching system (versus Fx 1.0) that holds on to content longer. If you want to defeat this, you might have to tell Fx not to cache your page.
User avatar
jonblock
Posts: 7
Joined: September 21st, 2006, 8:33 am

Post by jonblock »

jscher2000 wrote:What happens if you hold Shift when you reload?

Fx 1.5 has a more determined caching system (versus Fx 1.0) that holds on to content longer. If you want to defeat this, you might have to tell Fx not to cache your page.


Yes, if I hold down CTRL and reload, it does change. However, even when I did a "Clear Private Data"... it still didn't work.

I can't be expected to have my users hold down CTRL in order to get banner ads to rotate. What should I do?

Jon
User avatar
jscher2000
Posts: 11734
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Post by jscher2000 »

jonblock wrote:I can't be expected to have my users hold down CTRL in order to get banner ads to rotate. What should I do?

Delete the ads? :-p

But seriously, are you using PHP or ASP or another server-side scripting language? If so, set the HTTP headers for the page for no-caching. Here's a PHP example I grabbed from a random page in a Google search:

Code: Select all

<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>


If you are simply serving HTML pages, then you can try the <meta> tags related to caching, but I have read these are less reliable than the server-side HTTP headers.
User avatar
jonblock
Posts: 7
Joined: September 21st, 2006, 8:33 am

Post by jonblock »

jscher2000 wrote:Delete the ads? :-p

Unfortunately, I get millions of page views daily. I can't afford to operate the site without my advertisers.

jscher2000 wrote:But seriously, are you using PHP or ASP or another server-side scripting language?


Yes, however, it doesn't seem to matter because in my example, when I hit reload, everything else on the page *does* reload *except* the iframes. <strong>Below are some examples... but this message board system doesn't display the iframe attributes so i'm using curly braces instead of greater and less than signs. Sorry this is so confusing I'm sure you'll get the point.</strong>

Code: Select all

<DOCTYPE>

<html>
<head>
   <title>Untitled</title>
</head>

<body>

This is the boston globe:

{iframe src="http://www.boston.com"}{/iframe}


</body>
</html>


Below is a link to a screen shot of what I get:

http://www.jonathanblock.com/other/images/globe.gif

But if i open the source code, change the contents to:

Code: Select all

<DOCTYPE>

<html>
<head>
   <title>Untitled</title>
</head>

<body>

This is CNN:

{iframe src="http://www.cnn.com"}{/iframe}


</body>
</html>


Below is a link to a screen shot of what I get:

http://www.jonathanblock.com/other/images/cnn.gif

<strong>** Notice how it says "This is CNN" but you see the Boston Globe. What the!?!?!</strong>

-Jon
User avatar
jscher2000
Posts: 11734
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Post by jscher2000 »

I don't use <iframe>s so I can't really help, but as far as posting goes, tick the box to "Disable HTML in this post" to preserve attributes. In your own text, use the BBcode [b] and [/b] tags rather than <strong> and </strong> for strong emphasis.
User avatar
jqp
Posts: 5070
Joined: November 17th, 2004, 10:56 am
Location: In a box
Contact:

Post by jqp »

can you link to a live page with this problem?
User avatar
jonblock
Posts: 7
Joined: September 21st, 2006, 8:33 am

I already provided the source code

Post by jonblock »

jqp wrote:can you link to a live page with this problem?


In my post above, I have provided the HTML source code where you can recreate the problem on your own desktop. You just create the file, open it, then change the source to the 2nd file, and reload.

Jon
old np
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old np »

Bug 235185, comment 2 wrote:Frame state is kept on reload, purposefully. That way if you click a link in a frame and then hit reload, the right thing happens (the frame reloads the page you went to with that click).
User avatar
Vectorspace
Moderator
Posts: 14455
Joined: November 27th, 2003, 4:50 am
Location: Warwickshire, UK
Contact:

Post by Vectorspace »

When changed by link click or JavaScript, that's correct. But, it also occurs when the html file is manually modified - that's going too far, surely?
"All things being equal, the simplest answer is usually the correct one" - Occam's Razor
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0
User avatar
jonblock
Posts: 7
Joined: September 21st, 2006, 8:33 am

Post by jonblock »

Vectorspace wrote:When changed by link click or JavaScript, that's correct. But, it also occurs when the html file is manually modified - that's going too far, surely?


What sence does it make to have firefox display cached iframe from one site when the *plain html* iframe embed tag SRC value is pointing at a *different site*??? If I am trying to iFrame to site "a" but firefox shows me content from site "b", that's a bug. I just don't understand how this can be seen as a feature. There is no javascript involved here. Its plain HTML.

We operate a newspaper and our advertisers give us iFrame based advertising tags. Our system automatically rotates ads but the fact that Firefox is saving the iFrame makes our ads not rotate, even though we are changing the source of the iFrames. Take this situation as an example: 1) User reads a newspaper article. 2) They "go back" in the browser history 3) They click on the article link again 4) My web application creates a new iframe with a new SRC attribute above the others. 5) Firefox incorrectly displays what used to be the first iframe inside of the new iframe which appears at the top of the page.

The basic issue at hand is that saving the frame state is a good idea, but the saved state should be linked to the iframe SRC that I have specified. When I have a new iFrame SRC, Firefox should not show me the previous iFrame.

Jon
old np
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old np »

Try it with a nightly build. If the issue's still there, file a bug report saying that.
User avatar
jonblock
Posts: 7
Joined: September 21st, 2006, 8:33 am

Post by jonblock »

np wrote:Try it with a nightly build. If the issue's still there, file a bug report saying that.


Boris Zbarsky asked me to submit it as a new bug so I just did:

https://bugzilla.mozilla.org/show_bug.cgi?id=354176

-Jon
User avatar
ldh058
Posts: 1
Joined: December 10th, 2004, 9:10 pm
Location: Warsaw, Ohio
Contact:

Post by ldh058 »

I am having a similar problem with iframe on a family site that I have designed. The iframe holds a news document that I edit from time to time. I have found that if I hit reload three times, the content finally changes. I am using version 1.5.07 and was wondering if this issue exists in the new 2.0 RC1 version of FF? Here is the link to my site: hettingerfamily.us

Lawrence
ancon
Posts: 1
Joined: January 28th, 2011, 6:00 am

Re: Serious iFrame Bug

Post by ancon »

it's work with reload button on firefox

the point is delete your src="mypage.html" code from iframe then place it in body onload with this script.
example :
I have <iframe name="myframe" width="100%" frameborder="no" height="1400px" scrolling="no" onload="return function_name();" src="mypage.html"> </iframe> Then i del the src="mypage.html" code.
in body segment i put this:
<body onload = "parent.myframe.location='mypage.html'">


And if you encounter problem using both javascript window.onload or html body onload, then try this :
try to put window.onload = yourcode; together with body unload.
i have the tool tip javascript on <head></head> which contain window.onload = initTip; but conflict with my onload iframe <body onload = "parent.myframe.location='mypage.html'">
my solution : delete that window.onload = initTip; from <head></head>, then put them into <body>.
<body onload = "initTip(); parent.myframe.location='mypage.html'">
Locked