Home | History | Annotate | Download | only in data
      1 <html>
      2   <head><title>window.close test</title>
      3     <script type="text/javascript" src="chrome_frame_tester_helpers.js">
      4     </script>
      5     <script type="text/javascript">
      6       function OnNavigationFailed() {
      7         onFailure("WindowCloseTest", 1, "ChromeFrame Navigation failed");
      8       }
      9 
     10       function OnChromeFrameLoaded(url) {
     11         appendStatus("Loaded URL: " + url.data);
     12         var cf = window.document.ChromeFrame;
     13         if (cf.attachEvent) { // Special case for IE
     14           appendStatus("Attaching close event handler");
     15           cf.attachEvent("onclose", OnCloseWindow);
     16         }
     17       }
     18 
     19       function OnCloseWindow() {
     20         appendStatus("Received window close event.");
     21         return onSuccess("WindowCloseTest", 1);
     22       }
     23 
     24     </script>
     25   </head>
     26   <body>
     27       <div id="statusPanel" style="border: 1px solid red; width: 100%">
     28       Test running....
     29       </div>
     30 
     31       <span id="ChromeFrameSpan"></span>
     32       <script type="text/javascript">
     33 insertControl(
     34     "ChromeFrameSpan",
     35     { "src": "window_close_frame.html",
     36       "eventHandlers": {
     37         "onload": "return OnChromeFrameLoaded(arguments[0]);",
     38         "onloaderror": "return OnNavigationFailed(arguments[0]);",
     39         "onclose": "return OnCloseWindow();"
     40       }
     41     });
     42       </script>
     43       <p>Tests window.close notification from ChromeFrame to its container</p>
     44   </body>
     45 </html>
     46