2 <!-- TODO(slightlyoff): Move to tests directory? -->
4 <TITLE> Chrome Frame Test
</TITLE>
5 <SCRIPT type=
"text/javascript">
8 document.getElementById(
"my_text").innerHTML = txt;
14 function GetChromeFrame() {
15 var chromeFrame = window.document.ChromeFrame
19 function OnChromeFrameMessage(text) {
20 msg(
"In host: \r\nMessage from ChromeFrame: " + text);
22 var chromeFrame = GetChromeFrame();
23 chromeFrame.PostMessageToFrame(
"OnHostMessage",
"Hello from host");
27 function OnNavigate() {
28 var url = document.getElementById('inputurl');
29 GetChromeFrame().src = url.value;
36 window.onload = function() {
37 var chromeFrame = GetChromeFrame();
38 var url = location.href;
39 url = url.substr(
0, url.lastIndexOf('/') +
1) +
"frame_w_controls.html";
40 chromeFrame.src = url;
43 var cf = document.getElementById('ChromeFrame');
44 cf.addEventListener(
"focus", OnFocus, true);
45 cf.addEventListener(
"blur", function() { msg('blur'); }, true);
52 function setFocusToCf() {
53 var cf = document.getElementById('ChromeFrame');
55 // alert(cf.hasFocus());
61 /* CSS magic to avoid the focus rect */
67 object:focus { outline: none; }
68 :focus { outline: none }
69 a:focus { outline: 1px dotted invert }
73 Chrome Frame Test activex
75 <input id=
"inputurl" type=
"text" name=
"URL">
76 <input type=
"submit" value=
"Navigate" onClick=
"OnNavigate();">
78 <OBJECT ID=
"ChromeFrame" tabindex=
"0"
81 CODEBASE=
"http://www.google.com"
82 CLASSID=
"CLSID:E0A900DF-9611-4446-86BD-4B1D47E7DB2A">
83 <!-- <PARAM NAME="BackColor" VALUE="100"> -->
84 <!-- <PARAM NAME="src" VALUE="file:///z:/code/debug/test.html"> -->
85 <embed ID=
"ChromeFramePlugin" WIDTH=
500 HEIGHT=
300 NAME=
"ChromeFrame"
86 SRC=
"http://www.google.com" TYPE=
"application/chromeframe">
89 <p>To test the focus:
<input id=
"fake_edit" type=
"text" name=
"fake"></p>
90 <p><button onclick=
"return setFocusToCf();">SetFocusToCF
</button></p>
93 <pre><p id=
"my_text"></p></pre>