]> source.dussan.org Git - vaadin-framework.git/commitdiff
Ensure VBrowserFrame content is unloaded in IE (#11683)
authorLeif Åstrand <leif@vaadin.com>
Wed, 5 Jun 2013 07:08:21 +0000 (10:08 +0300)
committerArtur Signell <artur@vaadin.com>
Wed, 5 Jun 2013 09:13:14 +0000 (12:13 +0300)
Change-Id: Ic3850bf00a1cfbdae6a955256509f0389fadaaa5

client/src/com/vaadin/client/ui/VBrowserFrame.java

index c1e131a6c5729a75983281d481efbb7738c3d065..4e13921582508480f05f8cabca233631cb413839 100644 (file)
@@ -19,6 +19,7 @@ import com.google.gwt.dom.client.Document;
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.IFrameElement;
 import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.client.BrowserInfo;
 
 public class VBrowserFrame extends Widget {
 
@@ -134,4 +135,23 @@ public class VBrowserFrame extends Widget {
             iframe.setName(name);
         }
     }
+
+    @Override
+    protected void onDetach() {
+        if (BrowserInfo.get().isIE()) {
+            // Force browser to fire unload event when component is detached
+            // from the view (IE doesn't do this automatically)
+            if (iframe != null) {
+                /*
+                 * src was previously set to javascript:false, but this was not
+                 * enough to overcome a bug when detaching an iframe with a pdf
+                 * loaded in IE9. about:blank seems to cause the adobe reader
+                 * plugin to unload properly before the iframe is removed. See
+                 * #7855
+                 */
+                iframe.setSrc("about:blank");
+            }
+        }
+        super.onDetach();
+    }
 }