Closed Bug 1153421 Opened 11 years ago Closed 7 years ago

Can't return an array from a WebConsoleCommands callback

Categories

(DevTools :: Console, defect)

36 Branch
x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: canuckistani, Unassigned)

Details

Example add-on https://github.com/canuckistani/console-helpers I found that I can return simple scalars and also complex objects from the window like document.styleSheets, but when I try to return anything else ( a filtered array containing stylesheet urls grouped by domain, for example ) all I get is an empty object.
Panos - Brian thought you might have some idea what's going on here.
Flags: needinfo?(past)
Depends on: nsec-signing
Depends on: nsec-csp
No longer depends on: nsec-csp
No longer depends on: nsec-signing
My guess is that our security wrappers are not letting you use an array created in chrome-privileged code (add-on code) from content-privileged code. You could use the $x helper as inspiration, which goes through some hoops to avoid this problem: https://dxr.mozilla.org/mozilla-central/source/toolkit/devtools/webconsole/utils.js#1643
Flags: needinfo?(past)
(In reply to Panos Astithas [:past] from comment #2) > My guess is that our security wrappers are not letting you use an array > created in chrome-privileged code (add-on code) from content-privileged > code. You could use the $x helper as inspiration, which goes through some > hoops to avoid this problem: > > https://dxr.mozilla.org/mozilla-central/source/toolkit/devtools/webconsole/ > utils.js#1643 Makes sense, thanks. I also noticed that my code only works on non-e10s windows, and the direct access to the document in the code you linked to probably doesn't help that?
Product: Firefox → DevTools

I don't think this is relevant anymore

Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.