summaryrefslogtreecommitdiffstats
path: root/chrome_frame/host.html
blob: a3da73cf5e16b8c672926e14ac9baf797e12e1e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<HTML>
<!-- TODO(slightlyoff): Move to tests directory? -->
<HEAD>
<TITLE> Chrome Frame Test </TITLE>
<SCRIPT type="text/javascript">
function GetChromeFrame() {
  var chromeFrame = window.document.ChromeFrame
  return chromeFrame;
}

function OnChromeFrameMessage(text) {
  window.alert("In host:  \r\nMessage from ChromeFrame: " + text);
  
  var chromeFrame = GetChromeFrame();
  chromeFrame.PostMessageToFrame("Hello from host");
  return "OK";
}

function OnNavigate() {
  var url = document.getElementById('inputurl');
  var chromeFrame = GetChromeFrame();
  chromeFrame.src = url.value;
}

function onLoad() {
  var chromeFrame = GetChromeFrame();
  chromeFrame.onmessage = OnChromeFrameMessage;
}

</SCRIPT>
</HEAD>
<BODY onload="onLoad();">
Chrome Frame Test activex
<br><br>
<input id="inputurl" type="text" name="URL">
<input type="submit" value="Navigate" onClick="OnNavigate();"> 
<center>
<OBJECT ID="ChromeFrame" WIDTH=500 HEIGHT=500 CODEBASE="http://www.google.com"
        CLASSID="CLSID:E0A900DF-9611-4446-86BD-4B1D47E7DB2A">
    <PARAM NAME="src" VALUE="http://www.google.com">
    <embed ID="ChromeFramePlugin" WIDTH=500 HEIGHT=500 NAME="ChromeFrame"
        SRC="http://www.google.com" TYPE="application/chromeframe">
    </embed>
</OBJECT>
</center>
</BODY>
</HTML>