Closed Bug 952190 Opened 11 years ago Closed 10 years ago

Pretty output for native objects from chrome windows

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 30

People

(Reporter: msucan, Assigned: msucan)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file, 1 obsolete file)

We should have pretty output for native objects from chrome windows, like we have for objects from content tabs.

(follow up from bug 843004 comment 49)
Depends on: 952192
Priority: -- → P3
Gijs, to fix this bug, update DevToolsUtils.js:

this.isSafeJSObject = function isSafeJSObject(aObj) {
  if (Cu.getGlobalForObject(aObj) ==
      Cu.getGlobalForObject(isSafeJSObject)) {
    return true; // aObj is not a cross-compartment wrapper.
  }

  if (Cu.getObjectPrincipal(aObj) ==
      Cu.getObjectPrincipal(isSafeJSObject) {
    return true; // allow chrome objects
  }

  return Cu.isXrayWrapper(aObj);
};

... then write a test. Please use Task.spawn for the test.
And on came a deluge of other stuff that was almost-but-not-quite-literally on fire. Needinfo'ing so I don't forget.
Flags: needinfo?(gijskruitbosch+bugs)
Attached patch bug952190-1.diff (obsolete) — Splinter Review
This is a quick fix that's useful for addon authors and for Firefox devs.

My previous comment was not entirely accurate. It seems the getObjectPrincipal() method was moved to the script security manager.
Assignee: nobody → mihai.sucan
Status: NEW → ASSIGNED
Attachment #8377727 - Flags: review?(past)
Comment on attachment 8377727 [details] [diff] [review]
bug952190-1.diff

Review of attachment 8377727 [details] [diff] [review]:
-----------------------------------------------------------------

I see some breakage in tbpl, so clearing review for now.
Attachment #8377727 - Flags: review?(past)
Attached patch bug952190-2.diffSplinter Review
Fixed the variables view test.

Green try push: https://tbpl.mozilla.org/?tree=Try&rev=cc4f30d3506b
Attachment #8377727 - Attachment is obsolete: true
Attachment #8378395 - Flags: review?(past)
Comment on attachment 8378395 [details] [diff] [review]
bug952190-2.diff

Review of attachment 8378395 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM.
Attachment #8378395 - Flags: review?(past) → review+
Flags: needinfo?(gijskruitbosch+bugs)
Thanks!

Landed: https://hg.mozilla.org/integration/fx-team/rev/47fddf9651fd
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/47fddf9651fd
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 30
Whiteboard: [qa-]
Depends on: 998083
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: