• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<script>
4var logWin = window.parent.opener;
5logWin.log('Initializing Iframe');
6
7var notificationCenter = null;
8function test() {
9  notificationCenter = window.webkitNotifications;
10  logWin.log("Before transfer: checkPermission returned (should be 1): " + notificationCenter.checkPermission());
11  setTimeout("window.parent.transferIframe();", 5000); // Wait long enough for Chrome popup blocker to release the window so it can actually close.
12}
13
14function testAfterClose()
15{
16  logWin.log("After transfer: checkPermission returned (should be 2): " + notificationCenter.checkPermission());
17}
18window.finish = function() {
19  logWin.log("After transfer, the checkPermission call is accessing a destroyed object and can return invalid value or crash, depending on circumstances.");
20  setInterval(testAfterClose, 1000); // Do it several times in a row, it'll crash after 1-3 times
21}
22</script>
23</head>
24<body onload=test()>
25</body>
26</html>