Hi All,

I am currently working on a Firefox plugin based on the scriptable
sample of Gecko SDK. My IDL file looks like that:

[scriptable, uuid(d2d536a0-b6fc-11d5-9d10-0060b0fbd8ac)]
interface nsIScriptTest : nsISupports
{
  void showMessage();
  void clear();

  attribute string message;
};

showMessage and clear methods work fine.

The trouble comes from message attribute. Although there is no readonly
keyword, JavaScript can just read from this attribute. In the C++ part,
only the GetMessage(char** msg) function is called. The
SetMessage(const char* msg) function is always ignored.

Here is a JS snippet:
<object id="objPlugin" type="application/scripttest-plugin" width=600
height=200></object>
<script>
var plugin = document.getElementById("objPlugin");
document.write("test=" + plugin.message); // WORKS
plugin.message = "hello2"; // DOES NOT WORK
plugin.setAttribute("message", "hello3"); DOES NOT WORK
</script>

This makes me crazy. Please help me if you can.

Thanks in advance,
Alexis

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to