Pretty output for native objects from chrome windows

RESOLVED FIXED in Firefox 30

Status

()

Firefox
Developer Tools: Debugger
P3
normal
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: msucan, Assigned: msucan)

Tracking

Trunk
Firefox 30
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qa-])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

3 years ago
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)
(Assignee)

Updated

3 years ago
Depends on: 952192
Priority: -- → P3
(Assignee)

Updated

3 years ago
Duplicate of this bug: 967504
(Assignee)

Comment 2

3 years ago
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.

Comment 3

3 years ago
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)
(Assignee)

Comment 4

3 years ago
Created attachment 8377727 [details] [diff] [review]
bug952190-1.diff

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)
(Assignee)

Comment 5

3 years ago
Try push: https://tbpl.mozilla.org/?tree=Try&rev=b94df5d9ad19
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)
(Assignee)

Comment 7

3 years ago
Created attachment 8378395 [details] [diff] [review]
bug952190-2.diff

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+

Updated

3 years ago
Flags: needinfo?(gijskruitbosch+bugs)
(Assignee)

Comment 9

3 years ago
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
Last Resolved: 3 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 30

Updated

3 years ago
Whiteboard: [qa-]
Depends on: 998083
You need to log in before you can comment on or make changes to this bug.