mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 22:55:23 +00:00
21 lines
896 B
HTML
21 lines
896 B
HTML
<html>
|
|
<head>
|
|
<script>
|
|
// We want to put an expando on the object, but we want this object
|
|
// to be wrapped in other compartments. This means that the expando
|
|
// must implement precreate, which happens (in general) for nodes.
|
|
// So we just do a cyclic reference to the document body.
|
|
window.expando = document.documentElement;
|
|
|
|
function testme(obj) {
|
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
const Ci = Components.interfaces;
|
|
const utils = window.QueryInterface(Ci.nsIInterfaceRequestor)
|
|
.getInterface(Ci.nsIDOMWindowUtils);
|
|
|
|
return utils.getClassName(obj) != "Proxy" &&
|
|
typeof obj.QueryInterface == 'function';
|
|
}
|
|
</script>
|
|
</head>
|