1 <script type=
"text/javascript">
3 var plugin
= document
.getElementById('plugin');
6 function SetSize(w
, h
) {
7 var plugin
= document
.getElementById('plugin');
11 function PostMessage(data
, shouldTargetIframe
) {
12 plugin
= document
.getElementById('plugin');
13 // TODO(fsamuel): contentWindow can be accessed directly once
14 // http://wkbug.com/85679 lands.
15 if (shouldTargetIframe
) {
16 plugin
.contentWindow
.frames
[0].postMessage('testing123', '*');
18 plugin
.contentWindow
.frames
.postMessage('testing123', '*');
21 function SetTitle(str
) {
24 document
.title
= 'embedder';
29 type=
"application/browser-plugin"
32 border=
"0px"></object>
33 <script type=
"text/javascript">
35 function receiveMessage(event
) {
38 document
.title
= 'ready';
41 if (msg
.indexOf('stop_ack') == -1) {
42 event
.source
.postMessage('stop', '*');
44 var name
= msg
.replace("stop_ack", "").trim();
46 window
.document
.title
= name
;
48 window
.document
.title
= 'main guest';
53 var plugin
= document
.getElementById('plugin');
54 window
.addEventListener('message', receiveMessage
, false);
55 plugin
.addEventListener('-internal-instanceid-allocated', function(e
) {
56 plugin
['-internal-attach']({});