| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- |
| 3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --> |
| 10 <html lang="en"> |
| 11 <head> |
| 12 <meta charset="UTF-8"> |
| 13 <title></title> |
| 14 </head> |
| 15 <body> |
| 16 <pre id="output"></pre> |
| 17 <script type="application/dart"> |
| 18 import 'dart:html'; |
| 19 |
| 20 main() { |
| 21 var output = document.querySelector('#output'); |
| 22 window.on['message'].listen((e) { |
| 23 if (e.data == 'close') { |
| 24 output.text += 'close request\n'; |
| 25 e.source.postMessage('popup-closed', window.location.origin); |
| 26 window.close(); |
| 27 } |
| 28 }); |
| 29 if (window.opener) { |
| 30 // TODO(jakemac): Not in dart html? Is this necessary? |
| 31 // window.focus(); |
| 32 output.text += 'send initialized'; |
| 33 window.opener.postMessage( |
| 34 'popup-initialized', window.location.origin); |
| 35 } |
| 36 } |
| 37 </script> |
| 38 </body> |
| 39 </html> |
| OLD | NEW |