Debian Codegraph @

closure-library/closure/goog/messaging/testdata/portnetwork_inner.html

raw
1 <!DOCTYPE html>
2 <html>
3 <!--
4 Copyright 2011 The Closure Library Authors. All Rights Reserved.
5
6 Use of this source code is governed by the Apache License, Version 2.0.
7 See the COPYING file for details.
8 -->
9 <!--
10 -->
11 <head>
12 <title>
13 Closure Unit Tests - goog.messaging.PortNetwork iframe page
14 </title>
15 <script src="../../base.js"></script>
16 <script>
17 goog.require('goog.messaging.PortCaller');
18 goog.require('goog.messaging.PortChannel');
19 </script>
20 </head>
21 <body>
22 <script>
23 var peerOrigin = window.location.protocol + '//' + window.location.host;
24 var caller = new goog.messaging.PortCaller(
25 goog.messaging.PortChannel.forGlobalWindow(peerOrigin));
26
27 caller.dial('worker2').registerService('sendToWorker1', function(msg) {
28 msg.push('frame');
29 caller.dial('worker1').send('sendToMain', msg);
30 }, true);
31
32 </script>
33 </body>
34 </html>
35