Bug 952190 - Pretty output for native objects from chrome windows; r=past

This commit is contained in:
Mihai Sucan 2014-02-19 14:33:56 +02:00
parent 67e6b36b20
commit 077abafc2f
3 changed files with 7 additions and 2 deletions

View File

@ -91,7 +91,7 @@ function test()
},
{
name: "console.dir output",
consoleDir: "XULDocument {",
consoleDir: /XULDocument .+ chrome:\/\/.+\/browser\.xul/,
},
{
name: "console.time output",

View File

@ -260,6 +260,11 @@ this.isSafeJSObject = function isSafeJSObject(aObj) {
return true; // aObj is not a cross-compartment wrapper.
}
let principal = Services.scriptSecurityManager.getObjectPrincipal(aObj);
if (Services.scriptSecurityManager.isSystemPrincipal(principal)) {
return true; // allow chrome objects
}
return Cu.isXrayWrapper(aObj);
};

View File

@ -3656,7 +3656,7 @@ DebuggerServer.ObjectActorPreviewers.Object = [
},
function DOMNode({obj, threadActor}, aGrip, aRawObj) {
if (!aRawObj || !(aRawObj instanceof Ci.nsIDOMNode)) {
if (obj.class == "Object" || !aRawObj || !(aRawObj instanceof Ci.nsIDOMNode)) {
return false;
}