4 <object id=
"plugin" type=
"application/x-nacl-imc">Plugin not working
</object>
6 <script type=
"text/javascript">
7 var prefix_dir
= "../install-stubout";
8 var args
= ["--library-path", "/lib", "../glibc/hellow-dyn"];
12 function receive(message
) {
13 var header
= message
.substring(0, 4);
14 if(header
== "Open") {
15 open(message
.substring(4));
18 dump("unrecognised message: " + message
+ "\n");
22 /* imcplugin currently does not respond if we ask for a file that doesn't
23 exist. As a temporary workaround, we whitelist allowed files. */
29 "../glibc/hellow-dyn",
31 function have_file(filename
) {
32 for(var i
= 0; i
< files
.length
; i
++)
33 if(filename
== files
[i
])
38 function open(filename
) {
39 dump("open: " + filename
+ "\n");
40 if(!have_file(filename
)) {
44 if(filename
.substring(0, 5) == "/lib/") {
45 filename
= prefix_dir
+ filename
;
47 plugin
.get_file(filename
, function(file
) {
48 proc
.send("", [file
]);
55 plugin
= document
.getElementById("plugin");
56 plugin
.get_file(prefix_dir
+ "/lib/ld-linux.so.2", function(file
) {
57 proc
= plugin
.launch(file
, args
, receive
);
64 window
.onload
= onload
;