Iframes in firefox not updating when hidden

2019-09-17 08:20发布

问题:

I'm having troubles with a page that display a slideshow using the jquery.cycle2 plugin. The "slides" are actually divs containing Iframes that the plugin will show as a slideshow.

The problem is that the Firefox and Chrome will pre-load the iframes and then show a cached version of the Iframe which in my case is not acceptable since these Iframes are showing data from reports that need to be up-to-date.

Weirdly enough Internet Explorer reloads the Iframe each time the slideshow plugin changes the visibility of the dom-element so in my case It works as expected : Every time an Iframe is visible the content of the IFrame is refreshed.

I have tried a lot of things using JavaScript in Chrome and Firefox to refresh the IFrame when it's hidden, but the browser will not refresh the Iframe or the Iframe content will be broken.

I can refresh the Iframe when its visible but this causes a nasty white flash when the IFrame reloads.

My question is : Can I force Chrome/Firefox to refresh an Iframe when it's hidden? if so how?

I'm using :

  • IE 11
  • Firefox 26
  • Chrome 32

Also weirdly on some older versions of firefox (like 3.x) this works as expected

Thanks in advance