3 <TITLE>Scriptable Plug-in Test
</TITLE>
8 <h1>Sample Scriptable Plug-in
</h1>
11 This page contains a testcase which demonstrates the work of
12 scriptable
4.x style Navigator plug-in with Mozilla. The example
13 plug-in occupies the area right below this text, and you should see a
14 frame the plug-in draws around its window. Below the plug-in window
15 there are two buttons. Clicking on the buttons will result in calling
16 native plugin methods from JavaScript. Show Version will instruct the
17 plug-in to retrieve the Mozilla user agent string and display it in
18 the plug-in window, Clear button will call plug-in method to erase the
28 document
.getElementById("result").innerHTML
+= "<p>" + "function bar(" + arg
+ ") called!" + "</p>";
35 <p>results go here:
</p>
38 <embed id=
"embed1" type=
"application/mozilla-npruntime-scriptable-plugin" width=
600 height=
40><br>
40 <embed type=
"application/x-java-mozilla-npruntime-scriptable-plugin" style=
"display: block; width: 50%; height: 100px;"><br>
43 var embed1
= document
.getElementById('embed1');
47 <form name=
"formname">
48 <input type=button
value=
"Call pluginobj.foo()" onclick='alert(pluginobj.foo())'
>
49 <input type=button
value=
"alert(pluginobj.bar)" onclick='alert(pluginobj.bar)'
>
50 <input type=button
value=
"alert(pluginobj('foo'))" onclick='alert(pluginobj(
"foo"))'
>
52 <input type=button
value=
"alert(embed1.bar)" onclick='alert(embed1.bar)'
>
53 <input type=button
value=
"alert(embed1.foo())" onclick='alert(embed1.foo())'
>
54 <input type=button
value=
"alert(embed1())" onclick='alert(embed1())'
>
55 <input type=button
value=
"embed1.bar='foo'" onclick='embed1.
bar=
"foo";'
>