Revision: 6381
Author: [email protected]
Date: Thu Oct 15 08:36:29 2009
Log: Modifying hosted.html so it only reaches up to windows that it has  
permission to access.

Patch by: jlabanca
Review by: jat
http://code.google.com/p/google-web-toolkit/source/detail?r=6381

Modified:
  /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html

=======================================
--- /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html Tue  
Oct 13 16:57:19 2009
+++ /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html Thu  
Oct 15 08:36:29 2009
@@ -30,7 +30,16 @@
  function getTopWindow() {
    var topWin = window.top;
    while (topWin.opener) {
-    topWin = topWin.opener.top;
+    // Check that we can access the url of the opener. If we can't, then  
return
+    // the window up to the current point. This happens with selenium  
because
+    // the parent window is a file, but the child window is the hosted URL.
+    var nextTopWin = topWin.opener.top;
+    try {
+      nextTopWin.location.href;
+    } catch (e) {
+      return topWin;
+    }
+    topWin = nextTopWin;
    }
    return topWin;
  }

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to