imcplugin: Allow receiving messages from the NaCl process
[nativeclient.git] / imcplugin / imctest.html
blob07a5c3147814a464ba45c5b58e18ff800f798292
2 Testing plugin...
4 <object id="plugin" type="application/x-nacl-imc">Plugin not working</object>
6 <script type="text/javascript">
7 function onload() {
8 try {
9 var plugin = document.getElementById("plugin");
10 function receive(msg) {
11 dump("Javascript got message: \"" + msg + "\"\n");
13 plugin.get_file("imcread", function(file) {
14 dump("got file: " + file + "\n");
15 var proc = plugin.launch(file, receive);
16 dump("proc = " + proc + "\n");
17 proc.send("Hello from Javascript to NaCl!");
18 });
19 plugin.launch(1,2,3);
21 catch(e) {
22 dump(e + "\n");
25 window.onload = onload;
26 </script>