Hi,
Can somebody please tell me how to access XPCOM objects from mozilla on
MacOS? I have downloaded mozilla 1.6 and compiled it on MacOS X. I could
access the sample XPCOM object provided through xpcshell javascript as
follows.
In mozilla/dist/bin directory:
$ ./run-mozilla.sh ./xpcshell
..........
js> var SamCl = new Components.Constructor("@mozilla.org/sample;1",
"nsISample");
js> var s = new SamCl();
js> s.value;
initial value
Now, I have copied the libxpcomsample.dylib and xpcomsample.xpt files
into /Applications/Mozilla.app/Contents/MacOS/componts directory. Then I
restarted Mozilla on my MacOS machine. The test.html has the following
JavaScript.
<script type="application/x-JavaScript">
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
alert("Getting the privileges successful");
var s = Components.classes["@mozilla.org/sample;1"].createInstance();
s = s.QueryInterface(Components.interfaces.nsISample);
alert("Creation of sample object successful");
alert(s.value);
</script>
I get the first alert message saying that getting the privileges is
successful. After that there is an error in javascript and no more alerts
come up. Can somebody please tell me what I am doing wrong here?
Thanks in advance,
Anil
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom