so i'm finally getting back to some old code, a sample which accesses a COM
object from JS. the code is as follows:
function evil() {
alert("one");
document.write("Asking security permission<br>");
dump("Asking security permission\n");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
alert("two");
dump("Made it here!\n");
document.write("Got permission<br>");
dump("Got permission\n");
var clazz = Components.classesByID['{d6d99f91-4c44-4aec-8ecf-0c29529fd9b6}'];
dump(clazz);
document.write("Got clazz by ID<br>");
var iid = Components.interfaces.nsIXPComTest;
dump(iid);
document.write("Got iid<br>");
var inst = clazz
}
it runs fine in mozilla 0.8 (well, the |clazz| variable is undefined, since
the component is compiled in; I put the .xpt file in dist/bin/components, so
|Components.interfaces.nsIXPComTest| is defined.).
But if i try the same thing in a little Gtk program which uses the Gtk
embedding widget (from 0.8), I get problems after I try to turn on
UniversalXPConnect. The output looks like this:
Got url file:///home/aheitner/cvs/gnome_foo/test.html
warning: property cmd_rename already exists
Start reading in bookmarks.html
Opening file bookmarks.html failed
Finished reading in bookmarks.html (89585 microseconds)
Enabling Quirk StyleSheet
###!!! ASSERTION: GetShellWidget() fails: 'mIMEShellWidget', file
nsWidget.cpp,
line 3099
###!!! Break: at file nsWidget.cpp, line 3099
###!!! ASSERTION: GetShellWidget() fails: 'mIMEShellWidget', file
nsWidget.cpp,
line 3099
###!!! Break: at file nsWidget.cpp, line 3099
we don't handle eBorderStyle_close yet... please fix me
WEBSHELL+ = 4
nsWidget::~nsWidget() of toplevel: 6 widgets still exist.
WEBSHELL- = 3
Asking security permission
we don't handle eBorderStyle_close yet... please fix me
WEBSHELL+ = 4
###!!! ASSERTION: GetShellWidget() fails: 'mIMEShellWidget', file nsWidget.cpp,
line 3099
###!!! Break: at file nsWidget.cpp, line 3099
###!!! ASSERTION: GetShellWidget() fails: 'mIMEShellWidget', file nsWidget.cpp,
line 3099
... [continues]
the "Got url ..." part is my code, right before it passes the url to
GtkMozEmbed. It does print out "Asking security permission", and the
security permission dialog pops up. But doesn't seem to reach
|alert("two");| and the |dump("Made it here!\n");| never seems to happen
either. Just a lot more of the assertion failures at nsWidget.cpp line 3099.
Which seems to me like something is broken in the embedding widget?
IIRC this worked fine with the nightlies (early january) i was using the
last time I worked on this stuff.
cheers,
Ari