[not part of build] 2-way scripting test.
git-svn-id: svn://10.0.0.236/trunk@117539 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<html>
|
||||
<body>
|
||||
<embed type="application/mozilla-4x-scriptable-plugin" width=0 height=0>
|
||||
</embed>
|
||||
<script language="javascript">
|
||||
var plugin = document.embeds[0];
|
||||
document.write("version = " + plugin.version);
|
||||
|
||||
function jsScriptObject(obj)
|
||||
{
|
||||
// implementation detail, to allow unwrapping.
|
||||
this.wrappedJSObject = obj;
|
||||
}
|
||||
jsScriptObject.prototype = {
|
||||
getProperty : function(name)
|
||||
{
|
||||
return new jsScriptObject(this.wrappedJSObject[name]);
|
||||
}
|
||||
,
|
||||
setProperty : function(name, value)
|
||||
{
|
||||
this.wrappedJSObject[name] = value;
|
||||
}
|
||||
,
|
||||
evaluate : function(expression)
|
||||
{
|
||||
return new jsScriptObject(eval(expression));
|
||||
}
|
||||
,
|
||||
toString : function()
|
||||
{
|
||||
return this.wrappedJSObject.toString();
|
||||
}
|
||||
,
|
||||
toNumber : function()
|
||||
{
|
||||
return this.wrappedJSObject.valueOf();
|
||||
}
|
||||
,
|
||||
fromString : function(value)
|
||||
{
|
||||
return new jsScriptObject(value);
|
||||
}
|
||||
,
|
||||
fromNumber : function(value)
|
||||
{
|
||||
return new jsScriptObject(value);
|
||||
}
|
||||
};
|
||||
plugin.setWindow(new jsScriptObject(window));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user