iframes and firefox - back button bug

427 views
Skip to first unread message

Ming

unread,
Apr 1, 2011, 5:59:18 PM4/1/11
to fancybox
Hello,

I am using fancybox iframes to display some videos and games. There is
a bug in firefox where once the iframe is closed, the back button will
no longer work - to get to a previous page, the user has to open the
pull down and go back several history entries. In chrome and ie this
problem does not appear.

You can see the bug by going to the fancybox home page http://fancybox.net/
- open the page in firefox, click on the iframe demo then run a google
search. When fancybox closes, try to use the back button to return to
a previous page.

I tested several other lightbox plug-ins that support iframes and so
far all seem to have this problem so I believe it is a firefox issue
and not a fancybox bug.

I would really appreciate hearing if other people have run across this
problem and found a workaround. I'm also wondering if I can avoid the
iframes entirely and use ajax to display these pages inside fancybox.
However, I'm not familiar with ajax and have been unable to get this
to work - so any advice on that would also be awesome.

Many Thanks,
Ming

JFK

unread,
Apr 1, 2011, 6:22:32 PM4/1/11
to fancybox
I am using FireFox 4.0 and that problem doesn't seem to exist ... I
can use the back button with no issue

On Apr 1, 2:59 pm, Ming <beckwith.goldb...@gmail.com> wrote:
> Hello,
>
> I am using fancybox iframes to display some videos and games. There is
> a bug in firefox where once the iframe is closed, the back button will
> no longer work - to get to a previous page, the user has to open the
> pull down and go back several history entries. In chrome and ie this
> problem does not appear.
>
> You can see the bug by going to the fancybox home pagehttp://fancybox.net/

Ming

unread,
Apr 1, 2011, 7:01:22 PM4/1/11
to fancybox
Thanks for the quick reply. Yes, my understanding is it's definitely a
firefox issue that was fixed in 4.0. Also, (and this seems really
weird) if you comment out line 946 of the fancybox-1.3.4.js file
(uncompressed version) the bug is fixed to some extent. Now I only see
the back button problem on Macs - in Windows it works fine.

I believe the problem is that in older versions of FF, duplicate
history entries are created when the iframe is opened and also
whenever the url of the iframed page changes. This happens to some
extent in chrome and IE but clicking back twice will still browse to
the previous page. However, in firefox clicking multiple times and
also parent.history.back() do not do anything...

Anyway, I have been trying to fix this for several days and I'm
starting to think there is no workaround - I just hate to lose the
functionality of the iframes. Any suggestions are appreciated.

Thanks again

Joonas

unread,
Apr 1, 2011, 7:54:03 PM4/1/11
to fancybox
i tested this in Firefox 4, opera, chrome, safari and ie9

This was rather interesting.. from those browsers only chrome and
opera ( dont know if they are latest versions ) they did allow to go
back in the end but lets say you clicked 2 links inside iframe and
then clicked close, you would then have to click 2 times back before
it actually went back to the site you were previous to fancybox.net

How do you present the content.. or rather where from? really quite
depends but... as well as ajax, inline is a good way to reveal content
on some cases.

Ming

unread,
Apr 1, 2011, 9:16:35 PM4/1/11
to fancybox
Yeah the issue is very inconsistent between browsers which made it
even more of a pain... I thought I finally fixed it by commenting out
line 946 (this also took care of needing to click back multiple times
in chrome etc) but then I tested my site on a Mac running FF 3.5 and
the back button was broken again.

Anyway, I ended up hiding the content in a div then using the inline
method to show it in fancybox. So far it seems to be working - great
suggestion thanks!
Reply all
Reply to author
Forward
0 new messages